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"));
}
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"));
}
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);
}
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));
}
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"));
}
Aggregations