use of com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs in project cloudbreak by hortonworks.
the class RangerRazDatahubConfigProviderTest method getAdditionalServicesWhenProductDetailsIsMissing.
@ParameterizedTest(name = "{0}")
@MethodSource("razCloudPlatformDataProvider")
@DisplayName("CM 7.2.2 DH is used and product details is missing at template generation before datahub cluster creations")
void getAdditionalServicesWhenProductDetailsIsMissing(String testCaseName, CloudPlatform cloudPlatform) {
GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
HostgroupView master = new HostgroupView("master", 0, InstanceGroupType.GATEWAY, List.of());
HostgroupView worker = new HostgroupView("worker", 0, InstanceGroupType.CORE, List.of());
TemplatePreparationObject preparationObject = Builder.builder().withStackType(StackType.WORKLOAD).withCloudPlatform(cloudPlatform).withDataLakeView(new DatalakeView(true)).withGeneralClusterConfigs(generalClusterConfigs).withHostgroupViews(Set.of(master, worker)).build();
Map<String, ApiClusterTemplateService> additionalServices = configProvider.getAdditionalServices(cmTemplateProcessor, preparationObject);
assertEquals(0, additionalServices.size());
}
use of com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs in project cloudbreak by hortonworks.
the class RangerRazDatalakeConfigProviderTest method getAdditionalServicesWhenRazIsEnabledWithCm721AndAws.
@Test
@DisplayName("CM 7.2.1 DL is used and Raz is requested, AWS, no additional service needs to be added to the template")
void getAdditionalServicesWhenRazIsEnabledWithCm721AndAws() {
ClouderaManagerRepo cmRepo = new ClouderaManagerRepo();
cmRepo.setVersion("7.2.1");
GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
generalClusterConfigs.setEnableRangerRaz(true);
HostgroupView master = new HostgroupView("master", 0, InstanceGroupType.GATEWAY, List.of());
HostgroupView idbroker = new HostgroupView("idbroker", 0, InstanceGroupType.CORE, List.of());
TemplatePreparationObject preparationObject = Builder.builder().withStackType(StackType.DATALAKE).withCloudPlatform(CloudPlatform.AWS).withProductDetails(cmRepo, List.of()).withGeneralClusterConfigs(generalClusterConfigs).withHostgroupViews(Set.of(master, idbroker)).build();
Map<String, ApiClusterTemplateService> additionalServices = configProvider.getAdditionalServices(cmTemplateProcessor, preparationObject);
assertEquals(0, additionalServices.size());
}
use of com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs in project cloudbreak by hortonworks.
the class RangerRazDatalakeConfigProviderTest method getAdditionalServicesWhenRazIsEnabledWithCm720.
@ParameterizedTest(name = "{0}")
@MethodSource("razCloudPlatformDataProvider")
@DisplayName("CM 7.2.0 DL is used and Raz is requested, no additional service needs to be added to the template")
void getAdditionalServicesWhenRazIsEnabledWithCm720(String testCaseName, CloudPlatform cloudPlatform) {
ClouderaManagerRepo cmRepo = new ClouderaManagerRepo();
cmRepo.setVersion("7.2.0");
GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
generalClusterConfigs.setEnableRangerRaz(true);
HostgroupView master = new HostgroupView("master", 0, InstanceGroupType.GATEWAY, List.of());
HostgroupView idbroker = new HostgroupView("idbroker", 0, InstanceGroupType.CORE, List.of());
TemplatePreparationObject preparationObject = Builder.builder().withStackType(StackType.DATALAKE).withCloudPlatform(cloudPlatform).withProductDetails(cmRepo, List.of()).withGeneralClusterConfigs(generalClusterConfigs).withHostgroupViews(Set.of(master, idbroker)).build();
Map<String, ApiClusterTemplateService> additionalServices = configProvider.getAdditionalServices(cmTemplateProcessor, preparationObject);
assertEquals(0, additionalServices.size());
}
use of com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs in project cloudbreak by hortonworks.
the class RangerRazDatalakeConfigProviderTest method getAdditionalServicesWhenRazIsEnabledAndDataHub.
@ParameterizedTest(name = "{0}")
@MethodSource("razCloudPlatformDataProvider")
@DisplayName("CM 7.2.0 DL is used and Raz is requested, but Data Hub, no additional service needs to be added to the template")
void getAdditionalServicesWhenRazIsEnabledAndDataHub(String testCaseName, CloudPlatform cloudPlatform) {
ClouderaManagerRepo cmRepo = new ClouderaManagerRepo();
cmRepo.setVersion("7.2.0");
GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
HostgroupView master = new HostgroupView("master", 0, InstanceGroupType.GATEWAY, List.of());
HostgroupView worker = new HostgroupView("worker", 0, InstanceGroupType.CORE, List.of());
TemplatePreparationObject preparationObject = Builder.builder().withStackType(StackType.WORKLOAD).withCloudPlatform(cloudPlatform).withProductDetails(cmRepo, List.of()).withDataLakeView(new DatalakeView(true)).withGeneralClusterConfigs(generalClusterConfigs).withHostgroupViews(Set.of(master, worker)).build();
Map<String, ApiClusterTemplateService> additionalServices = configProvider.getAdditionalServices(cmTemplateProcessor, preparationObject);
assertEquals(0, additionalServices.size());
}
use of com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs in project cloudbreak by hortonworks.
the class HueConfigProviderTest method getProxyHostsWhenLoadBalancerConfigured.
@Test
public void getProxyHostsWhenLoadBalancerConfigured() {
BlueprintView blueprintView = getMockBlueprintView("7.0.1", "7.0.1");
RDSConfig rdsConfig = new RDSConfig();
rdsConfig.setType(HUE);
rdsConfig.setConnectionURL(String.format("jdbc:%s://%s:%s/%s", DB_PROVIDER, HOST, PORT, DB_NAME));
rdsConfig.setConnectionUserName(USER_NAME);
rdsConfig.setConnectionPassword(PASSWORD);
String expectedExternalFQDN = "myaddress.cloudera.site";
String expectedLBFQDN = "loadbalancer-gateway.cloudera.site";
GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
generalClusterConfigs.setExternalFQDN(expectedExternalFQDN);
generalClusterConfigs.setKnoxUserFacingCertConfigured(true);
generalClusterConfigs.setPrimaryGatewayInstanceDiscoveryFQDN(Optional.empty());
generalClusterConfigs.setLoadBalancerGatewayFqdn(Optional.of(expectedLBFQDN));
TemplatePreparationObject tpo = new Builder().withGeneralClusterConfigs(generalClusterConfigs).withGateway(new Gateway(), "", new HashSet<>()).withBlueprintView(blueprintView).withRdsConfigs(Set.of(rdsConfig)).build();
List<ApiClusterTemplateVariable> result = underTest.getServiceConfigVariables(tpo);
Map<String, String> paramToVariable = result.stream().collect(Collectors.toMap(ApiClusterTemplateVariable::getName, ApiClusterTemplateVariable::getValue));
String proxyHostsExpected1 = String.join(",", expectedExternalFQDN, expectedLBFQDN);
String proxyHostsExpected2 = String.join(",", expectedLBFQDN, expectedExternalFQDN);
String expectedSafetyValveValue1 = "[desktop]\n[[knox]]\nknox_proxyhosts=".concat(proxyHostsExpected1);
String expectedSafetyValveValue2 = "[desktop]\n[[knox]]\nknox_proxyhosts=".concat(proxyHostsExpected2);
assertThat(paramToVariable).containsAnyOf(new SimpleEntry<>("hue-hue_service_safety_valve", expectedSafetyValveValue1), new SimpleEntry<>("hue-hue_service_safety_valve", expectedSafetyValveValue2));
}
Aggregations