use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class CsdParcelDecoratorTest method createProducts.
private Set<ClouderaManagerProduct> createProducts() {
ClouderaManagerProduct product = new ClouderaManagerProduct();
product.setCsd(CSD_LIST);
return Collections.singleton(product);
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class ClouderaManagerClusterCreationSetupServiceTest method testPrewarmedClouderaManagerClusterComponentsWhenTheStackTypeIsDataLake.
@Test
public void testPrewarmedClouderaManagerClusterComponentsWhenTheStackTypeIsDataLake() throws IOException, CloudbreakImageCatalogException {
Component cmRepoComponent = spy(new Component(ComponentType.CM_REPO_DETAILS, ComponentType.CM_REPO_DETAILS.name(), new Json(getClouderaManagerRepo(false)), stack));
Component productComponent = spy(new Component(ComponentType.CDH_PRODUCT_DETAILS, ComponentType.CDH_PRODUCT_DETAILS.name(), new Json(getClouderaManagerProductRepo()), stack));
List<Component> productComponentList = List.of(productComponent);
ClouderaManagerProduct cdhProduct = clouderaManagerProduct("CDH", "1.5.0");
stack.setType(StackType.DATALAKE);
when(blueprintUtils.getCDHStackVersion(any())).thenReturn(SOME_CDH_VERSION);
when(clouderaManagerProductsProvider.getCdhProducts(anySet())).thenReturn(cdhProduct);
List<ClusterComponent> clusterComponents = underTest.prepareClouderaManagerCluster(clusterRequest, cluster, Optional.of(cmRepoComponent), productComponentList, Optional.of(imageComponent));
assertVersionsMatch(clusterComponents, CM_VERSION, SOME_CDH_VERSION);
verify(clouderaManagerProductsProvider).getCdhProducts(anySet());
verifyNoInteractions(parcelFilterService);
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class ClouderaManagerClusterCreationSetupServiceTest method getClouderaManagerProductRepo.
private ClouderaManagerProduct getClouderaManagerProductRepo() {
ClouderaManagerProduct product = new ClouderaManagerProduct();
product.withName("CDH").withVersion(SOME_CDH_VERSION).withParcel("https://archive.cloudera.com/cdh6/6.2.0/parcels/");
return product;
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class ClouderaManagerClusterCreationSetupServiceTest method testPrewarmedClouderaManagerClusterComponents.
@Test
public void testPrewarmedClouderaManagerClusterComponents() throws IOException, CloudbreakImageCatalogException {
Component cmRepoComponent = spy(new Component(ComponentType.CM_REPO_DETAILS, ComponentType.CM_REPO_DETAILS.name(), new Json(getClouderaManagerRepo(false)), stack));
Component productComponent = spy(new Component(ComponentType.CDH_PRODUCT_DETAILS, ComponentType.CDH_PRODUCT_DETAILS.name(), new Json(getClouderaManagerProductRepo()), stack));
List<Component> productComponentList = List.of(productComponent);
Set<ClouderaManagerProduct> clouderaManagerProductSet = new HashSet<>();
clouderaManagerProductSet.add(clouderaManagerProduct("CDH", "1.5.0"));
when(blueprintUtils.getCDHStackVersion(any())).thenReturn(SOME_CDH_VERSION);
when(parcelFilterService.filterParcelsByBlueprint(eq(STACK_ID), anySet(), any(Blueprint.class))).thenReturn(clouderaManagerProductSet);
List<ClusterComponent> clusterComponents = underTest.prepareClouderaManagerCluster(clusterRequest, cluster, Optional.of(cmRepoComponent), productComponentList, Optional.of(imageComponent));
assertVersionsMatch(clusterComponents, CM_VERSION, SOME_CDH_VERSION);
verify(parcelFilterService, times(1)).filterParcelsByBlueprint(eq(STACK_ID), anySet(), any(Blueprint.class));
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class KnoxGatewayConfigProviderTest method roleConfigsWithGatewayWithLdapConfig.
@Test
public void roleConfigsWithGatewayWithLdapConfig() {
Gateway gateway = new Gateway();
gateway.setKnoxMasterSecret("admin");
gateway.setPath("/a/b/c");
IdBroker idBroker = new IdBroker();
idBroker.setMasterSecret("supersecret");
BlueprintTextProcessor blueprintTextProcessor = mock(BlueprintTextProcessor.class);
LdapView ldapConfig = LdapViewBuilder.aLdapView().build();
BlueprintView blueprintView = new BlueprintView("text", "7.2.11", "CDH", blueprintTextProcessor);
GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
generalClusterConfigs.setAccountId(Optional.of("1234"));
TemplatePreparationObject source = Builder.builder().withGateway(gateway, "key", new HashSet<>()).withLdapConfig(ldapConfig).withGeneralClusterConfigs(generalClusterConfigs).withBlueprintView(blueprintView).withVirtualGroupView(new VirtualGroupRequest(TestConstants.CRN, "")).withProductDetails(new ClouderaManagerRepo().withVersion("7.4.2"), List.of(new ClouderaManagerProduct().withVersion("7.2.10").withName("CDH"))).withIdBroker(idBroker).build();
when(virtualGroupService.createOrGetVirtualGroup(source.getVirtualGroupRequest(), UmsVirtualGroupRight.KNOX_ADMIN)).thenReturn("knox_admins");
when(entitlementService.isOjdbcTokenDhOneHour(anyString())).thenReturn(true);
assertEquals(List.of(config("idbroker_master_secret", "supersecret"), config("idbroker_gateway_knox_admin_groups", "knox_admins"), config("idbroker_gateway_signing_keystore_name", "signing.jks"), config("idbroker_gateway_signing_keystore_type", "JKS"), config("idbroker_gateway_signing_key_alias", "signing-identity")), underTest.getRoleConfigs(KnoxRoles.IDBROKER, source));
assertEquals(List.of(config("gateway_master_secret", gateway.getKnoxMasterSecret()), config("gateway_default_topology_name", "cdp-proxy"), config("gateway_knox_admin_groups", "knox_admins"), config("gateway_auto_discovery_enabled", "false"), config("gateway_path", gateway.getPath()), config("gateway_signing_keystore_name", "signing.jks"), config("gateway_signing_keystore_type", "JKS"), config("gateway_signing_key_alias", "signing-identity"), config("gateway_dispatch_whitelist", "^*.*$"), config("gateway_service_tokenstate_impl", "org.apache.knox.gateway.services.token.impl.JDBCTokenStateService")), ThreadBasedUserCrnProvider.doAs(TEST_USER_CRN, () -> underTest.getRoleConfigs(KnoxRoles.KNOX_GATEWAY, source)));
assertEquals(List.of(), underTest.getRoleConfigs("NAMENODE", source));
}
Aggregations