Search in sources :

Example 11 with KerberosConfig

use of com.sequenceiq.cloudbreak.domain.KerberosConfig in project cloudbreak by hortonworks.

the class KerberosConfigToKerberosRequestConverterTest method testCustom.

@Test
public void testCustom() {
    KerberosConfig config = new KerberosConfig();
    config.setType(KerberosType.CUSTOM);
    config.setPassword("");
    config.setPrincipal("");
    config.setDescriptor("");
    config.setKrb5Conf("");
    config.setTcpAllowed(true);
    KerberosRequest request = underTest.convert(config);
    assertAllFieldsNotNull(request, Lists.newArrayList("admin", "url", "adminUrl", "realm", "ldapUrl", "containerDn", "masterKey", "principal"));
}
Also used : KerberosConfig(com.sequenceiq.cloudbreak.domain.KerberosConfig) KerberosRequest(com.sequenceiq.cloudbreak.api.model.KerberosRequest) AbstractConverterTest(com.sequenceiq.cloudbreak.converter.AbstractConverterTest) Test(org.junit.Test)

Example 12 with KerberosConfig

use of com.sequenceiq.cloudbreak.domain.KerberosConfig in project cloudbreak by hortonworks.

the class KerberosConfigToKerberosRequestConverterTest method testCbManaged.

@Test
public void testCbManaged() {
    KerberosConfig config = TestUtil.kerberosConfig();
    KerberosRequest request = underTest.convert(config);
    assertAllFieldsNotNull(request, Lists.newArrayList("url", "adminUrl", "realm", "ldapUrl", "containerDn", "descriptor", "krb5Conf", "principal"));
}
Also used : KerberosConfig(com.sequenceiq.cloudbreak.domain.KerberosConfig) KerberosRequest(com.sequenceiq.cloudbreak.api.model.KerberosRequest) AbstractConverterTest(com.sequenceiq.cloudbreak.converter.AbstractConverterTest) Test(org.junit.Test)

Example 13 with KerberosConfig

use of com.sequenceiq.cloudbreak.domain.KerberosConfig in project cloudbreak by hortonworks.

the class KerberosBlueprintServiceTest method testExtendBlueprintWithKerberosExisting.

@Test
public void testExtendBlueprintWithKerberosExisting() throws IOException {
    String blueprintText = FileReaderUtils.readFileFromClasspath("blueprints-jackson/bp-not-kerberized.bp");
    Blueprint blueprint = TestUtil.blueprint("name", blueprintText);
    KerberosConfig kerberosConfig = new KerberosConfig();
    kerberosConfig.setPrincipal("principal.conf");
    kerberosConfig.setPrincipal("passwd.conf");
    kerberosConfig.setUrl("url.conf");
    kerberosConfig.setAdminUrl("adminUrl.conf");
    kerberosConfig.setRealm("realm.conf");
    kerberosConfig.setLdapUrl("ldapUrl.conf");
    kerberosConfig.setContainerDn("containerDn.conf");
    kerberosConfig.setTcpAllowed(true);
    Stack stack = TestUtil.stack();
    GeneralClusterConfigs generalClusterConfigs = BlueprintTestUtil.generalClusterConfigs();
    generalClusterConfigs.setPrimaryGatewayInstanceDiscoveryFQDN(Optional.of("test-1-1"));
    generalClusterConfigs.setGatewayInstanceMetadataPresented(false);
    Cluster cluster = TestUtil.cluster(blueprint, stack, 1L, kerberosConfig);
    BlueprintPreparationObject object = BlueprintPreparationObject.Builder.builder().withKerberosConfig(cluster.getKerberosConfig()).withGeneralClusterConfigs(generalClusterConfigs).build();
    BlueprintTextProcessor b = new BlueprintTextProcessor(blueprint.getBlueprintText());
    String actualBlueprint = underTest.customTextManipulation(object, b).asText();
    String expectedBlueprint = FileReaderUtils.readFileFromClasspath("blueprints-jackson/bp-not-kerberized-existing-expected.bp");
    JsonNode expectedNode = JsonUtil.readTree(expectedBlueprint);
    JsonNode resultNode = JsonUtil.readTree(actualBlueprint);
    Assert.assertEquals(expectedNode, resultNode);
}
Also used : GeneralClusterConfigs(com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs) Blueprint(com.sequenceiq.cloudbreak.domain.Blueprint) BlueprintTextProcessor(com.sequenceiq.cloudbreak.blueprint.BlueprintTextProcessor) KerberosConfig(com.sequenceiq.cloudbreak.domain.KerberosConfig) Cluster(com.sequenceiq.cloudbreak.domain.Cluster) BlueprintPreparationObject(com.sequenceiq.cloudbreak.blueprint.BlueprintPreparationObject) JsonNode(com.fasterxml.jackson.databind.JsonNode) Stack(com.sequenceiq.cloudbreak.domain.Stack) Test(org.junit.Test)

Example 14 with KerberosConfig

use of com.sequenceiq.cloudbreak.domain.KerberosConfig in project cloudbreak by hortonworks.

the class KerberosDetailServiceTest method testAmbariManagedKerberosMissing.

@Test
public void testAmbariManagedKerberosMissing() throws IOException {
    KerberosConfig config = new KerberosConfig();
    Assert.assertTrue(underTest.isAmbariManagedKerberosPackages(config));
}
Also used : KerberosConfig(com.sequenceiq.cloudbreak.domain.KerberosConfig) Test(org.junit.Test)

Example 15 with KerberosConfig

use of com.sequenceiq.cloudbreak.domain.KerberosConfig in project cloudbreak by hortonworks.

the class KerberosConfigToKerberosRequestConverterTest method testExistingAd.

@Test
public void testExistingAd() {
    KerberosConfig config = new KerberosConfig();
    config.setType(KerberosType.EXISTING_AD);
    config.setPassword("");
    config.setPrincipal("");
    config.setUrl("");
    config.setAdminUrl("");
    config.setRealm("");
    config.setLdapUrl("");
    config.setContainerDn("");
    config.setTcpAllowed(true);
    KerberosRequest request = underTest.convert(config);
    assertAllFieldsNotNull(request, Lists.newArrayList("admin", "descriptor", "krb5Conf", "masterKey"));
}
Also used : KerberosConfig(com.sequenceiq.cloudbreak.domain.KerberosConfig) KerberosRequest(com.sequenceiq.cloudbreak.api.model.KerberosRequest) AbstractConverterTest(com.sequenceiq.cloudbreak.converter.AbstractConverterTest) Test(org.junit.Test)

Aggregations

KerberosConfig (com.sequenceiq.cloudbreak.domain.KerberosConfig)21 Test (org.junit.Test)10 KerberosRequest (com.sequenceiq.cloudbreak.api.model.KerberosRequest)5 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)5 Cluster (com.sequenceiq.cloudbreak.domain.Cluster)5 AbstractConverterTest (com.sequenceiq.cloudbreak.converter.AbstractConverterTest)4 Stack (com.sequenceiq.cloudbreak.domain.Stack)3 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 BlueprintPreparationObject (com.sequenceiq.cloudbreak.blueprint.BlueprintPreparationObject)2 BlueprintTextProcessor (com.sequenceiq.cloudbreak.blueprint.BlueprintTextProcessor)2 GeneralClusterConfigs (com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs)2 FileSystem (com.sequenceiq.cloudbreak.domain.FileSystem)2 RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)2 CloudbreakServiceException (com.sequenceiq.cloudbreak.service.CloudbreakServiceException)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 BlueprintInputJson (com.sequenceiq.cloudbreak.api.model.BlueprintInputJson)1 BlueprintResponse (com.sequenceiq.cloudbreak.api.model.BlueprintResponse)1 FileSystemBase (com.sequenceiq.cloudbreak.api.model.FileSystemBase)1 FileSystemRequest (com.sequenceiq.cloudbreak.api.model.FileSystemRequest)1 GatewayJson (com.sequenceiq.cloudbreak.api.model.GatewayJson)1