use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo in project cloudbreak by hortonworks.
the class RangerCloudStorageServiceConfigProviderTest method defaultRangerHdfsAuditUrlWithSingleNamenode.
@Test
public void defaultRangerHdfsAuditUrlWithSingleNamenode() {
CmTemplateProcessor templateProcessor = mock(CmTemplateProcessor.class);
BlueprintView blueprintView = mock(BlueprintView.class);
when(blueprintView.getProcessor()).thenReturn(templateProcessor);
when(templateProcessor.getHostGroupsWithComponent(HdfsRoles.NAMENODE)).thenReturn(Set.of("gateway"));
TemplatePreparationObject preparationObject = getTemplatePreparationObjectForAws(false, false).withBlueprintView(blueprintView).withProductDetails(new ClouderaManagerRepo().withVersion("7.2.0"), List.of()).build();
List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(templateProcessor, preparationObject);
assertEquals(1, serviceConfigs.size());
assertEquals("ranger_plugin_hdfs_audit_url", serviceConfigs.get(0).getName());
assertEquals("hdfs://g", serviceConfigs.get(0).getValue());
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo in project cloudbreak by hortonworks.
the class RangerCloudStorageServiceConfigProviderTest method testGetRangerCloudStorageServiceConfigsWithBackup.
@Test
public void testGetRangerCloudStorageServiceConfigsWithBackup() {
CmTemplateProcessor templateProcessor = mock(CmTemplateProcessor.class);
TemplatePreparationObject preparationObject = getTemplatePreparationObjectForAws(true, true, true).withBlueprintView(mock(BlueprintView.class)).withCloudPlatform(CloudPlatform.AWS).withProductDetails(new ClouderaManagerRepo().withVersion("7.2.2"), List.of()).build();
List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(templateProcessor, preparationObject);
assertEquals(2, serviceConfigs.size());
assertEquals("ranger_plugin_hdfs_audit_url", serviceConfigs.get(0).getName());
assertEquals("s3a://bucket/ranger/audit", serviceConfigs.get(0).getValue());
assertEquals("cloud_storage_paths", serviceConfigs.get(1).getName());
assertEquals("HIVE_METASTORE_WAREHOUSE=s3a://bucket/warehouse/tablespace/managed/hive," + "HIVE_REPLICA_WAREHOUSE=s3a://bucket/hive_replica_functions_dir," + "HIVE_METASTORE_EXTERNAL_WAREHOUSE=s3a://bucket/warehouse/tablespace/external/hive," + "RANGER_AUDIT=s3a://bucket/ranger/audit," + "HBASE_ROOT=s3a://bucket/hbase," + "BACKUP_LOCATION=s3a://bucket/backup/location", serviceConfigs.get(1).getValue());
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo in project cloudbreak by hortonworks.
the class RangerCloudStorageServiceConfigProviderTest method testGetRangerAwsCloudStorageServiceConfigs.
@Test
public void testGetRangerAwsCloudStorageServiceConfigs() {
CmTemplateProcessor templateProcessor = mock(CmTemplateProcessor.class);
TemplatePreparationObject preparationObject = getTemplatePreparationObjectForAws(true, true).withBlueprintView(mock(BlueprintView.class)).withCloudPlatform(CloudPlatform.AWS).withProductDetails(new ClouderaManagerRepo().withVersion("7.2.2"), List.of()).build();
List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(templateProcessor, preparationObject);
assertEquals(2, serviceConfigs.size());
assertEquals("ranger_plugin_hdfs_audit_url", serviceConfigs.get(0).getName());
assertEquals("s3a://bucket/ranger/audit", serviceConfigs.get(0).getValue());
assertEquals("cloud_storage_paths", serviceConfigs.get(1).getName());
assertEquals("HIVE_METASTORE_WAREHOUSE=s3a://bucket/warehouse/tablespace/managed/hive," + "HIVE_REPLICA_WAREHOUSE=s3a://bucket/hive_replica_functions_dir," + "HIVE_METASTORE_EXTERNAL_WAREHOUSE=s3a://bucket/warehouse/tablespace/external/hive," + "RANGER_AUDIT=s3a://bucket/ranger/audit," + "HBASE_ROOT=s3a://bucket/hbase", serviceConfigs.get(1).getValue());
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo in project cloudbreak by hortonworks.
the class RangerUserSyncRoleConfigProviderTest method testAwsWhenCmVersionIs726ShouldReturnWithRangerAsSysAdmin.
@Test
public void testAwsWhenCmVersionIs726ShouldReturnWithRangerAsSysAdmin() {
TemplatePreparationObject preparationObject = TemplatePreparationObject.Builder.builder().withCloudPlatform(CloudPlatform.AWS).withServicePrincipals(null).withProductDetails(new ClouderaManagerRepo().withVersion("7.2.6"), new ArrayList<>()).withGeneralClusterConfigs(new GeneralClusterConfigs()).build();
List<ApiClusterTemplateConfig> serviceConfigs = underTest.getRoleConfigs(RANGER_USERSYNC, preparationObject);
assertEquals(2, serviceConfigs.size());
assertEquals("conf/ranger-ugsync-site.xml_role_safety_valve", serviceConfigs.get(0).getName());
assertEquals("<property><name>ranger.usersync.unix.backend</name><value>nss</value></property>", serviceConfigs.get(0).getValue());
assertEquals("ranger.usersync.group.based.role.assignment.rules", serviceConfigs.get(1).getName());
assertEquals("&ROLE_SYS_ADMIN:g:mockAdmin", serviceConfigs.get(1).getValue());
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo in project cloudbreak by hortonworks.
the class RangerUserSyncRoleConfigProviderTest method testAzureWithRaz.
@Test
public void testAzureWithRaz() {
GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
generalClusterConfigs.setEnableRangerRaz(true);
TemplatePreparationObject preparationObject = TemplatePreparationObject.Builder.builder().withCloudPlatform(CloudPlatform.AZURE).withProductDetails(new ClouderaManagerRepo().withVersion("7.2.6"), new ArrayList<>()).withServicePrincipals(generateServicePrincipals()).withGeneralClusterConfigs(generalClusterConfigs).build();
List<ApiClusterTemplateConfig> serviceConfigs = underTest.getRoleConfigs(RANGER_USERSYNC, preparationObject);
assertEquals(3, serviceConfigs.size());
assertEquals("conf/ranger-ugsync-site.xml_role_safety_valve", serviceConfigs.get(0).getName());
assertEquals("<property><name>ranger.usersync.unix.backend</name><value>nss</value></property>", serviceConfigs.get(0).getValue());
assertEquals("ranger.usersync.group.based.role.assignment.rules", serviceConfigs.get(1).getName());
assertEquals("&ROLE_SYS_ADMIN:g:mockAdmin", serviceConfigs.get(1).getValue());
assertEquals("ranger_usersync_azure_user_mapping", serviceConfigs.get(2).getName());
assertEquals("hive=3d4fcb5f-51b7-473c-9ca4-9d1e501f47u8;" + "ranger=f346892c-8d70-464c-8330-6ed1112bd880;hbase=286463ce-41c5-4f03-89f6-adb7109394ec", serviceConfigs.get(2).getValue());
}
Aggregations