use of com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigWithAdlsGen2Path.
@Test
public void testCreateFluentConfigWithAdlsGen2Path() {
// GIVEN
Logging logging = new Logging();
logging.setStorageLocation("abfs://mycontainer@myaccount.dfs.core.windows.net");
AdlsGen2CloudStorageV1Parameters parameters = new AdlsGen2CloudStorageV1Parameters();
parameters.setAccountKey("myAccountKey");
logging.setAdlsGen2(parameters);
Telemetry telemetry = new Telemetry();
telemetry.setLogging(logging);
// WHEN
FluentConfigView result = underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
// THEN
assertTrue(result.isEnabled());
assertTrue(result.isCloudStorageLoggingEnabled());
assertEquals("myAccountKey", result.getAzureStorageAccessKey());
assertTrue(result.getLogFolderName().isBlank());
assertEquals("mycontainer", result.getAzureContainer());
}
use of com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigWithFullAdlsGen2PathWithContainer.
@Test
public void testCreateFluentConfigWithFullAdlsGen2PathWithContainer() {
// GIVEN
Logging logging = new Logging();
logging.setStorageLocation("abfs://mycontainer/my/custom/path@myaccount.dfs.core.windows.net");
AdlsGen2CloudStorageV1Parameters parameters = new AdlsGen2CloudStorageV1Parameters();
parameters.setAccountKey("myAccountKey");
logging.setAdlsGen2(parameters);
Telemetry telemetry = new Telemetry();
telemetry.setLogging(logging);
// WHEN
FluentConfigView result = underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
// THEN
assertTrue(result.isEnabled());
assertEquals("myAccountKey", result.getAzureStorageAccessKey());
assertEquals("/my/custom/path", result.getLogFolderName());
assertEquals("mycontainer", result.getAzureContainer());
}
use of com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class CloudStorageFolderResolverServiceTest method testUpdateStorageLocationAdlsGen2.
@Test
public void testUpdateStorageLocationAdlsGen2() {
// GIVEN
Telemetry telemetry = createTelemetry();
telemetry.getLogging().setS3(null);
telemetry.getLogging().setAdlsGen2(new AdlsGen2CloudStorageV1Parameters());
telemetry.getLogging().setStorageLocation("abfs://mycontainer");
// WHEN
underTest.updateStorageLocation(telemetry, FluentClusterType.DATAHUB.value(), "mycluster", "crn:cdp:cloudbreak:us-west-1:someone:stack:12345");
// THEN
assertEquals("abfs://mycontainer@null.dfs.core.windows.net/cluster-logs/datahub/mycluster_12345", telemetry.getLogging().getStorageLocation());
}
use of com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class StorageValidationServiceTest method whenAzureConfiguredWithManagedIdentityShouldNotThrowException.
@Test
public void whenAzureConfiguredWithManagedIdentityShouldNotThrowException() {
SdxCloudStorageRequest cloudStorageRequest = new SdxCloudStorageRequest();
cloudStorageRequest.setBaseLocation("abfs://example-path");
cloudStorageRequest.setFileSystemType(FileSystemType.ADLS_GEN_2);
AdlsGen2CloudStorageV1Parameters adlsGen2 = new AdlsGen2CloudStorageV1Parameters();
adlsGen2.setManagedIdentity("managedidentity");
cloudStorageRequest.setAdlsGen2(adlsGen2);
underTest.validateCloudStorage("AZURE", cloudStorageRequest);
}
use of com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class EnvironmentBackupStorageConfigurationValidatorTest method validateBackupStorageConfigAzureWhenConfigValidationSuccess.
@Test
public void validateBackupStorageConfigAzureWhenConfigValidationSuccess() {
when(environment.getCloudPlatform()).thenReturn(CloudConstants.AZURE);
when(environment.getBackup()).thenReturn(backup);
AdlsGen2CloudStorageV1Parameters adlsGen2 = new AdlsGen2CloudStorageV1Parameters();
adlsGen2.setManagedIdentity("/subscriptions/12345678-1234-0234-8234-123456789123/resourceGroups/test/" + "providers/Microsoft.ManagedIdentity/userAssignedIdentities/cdp-assumer");
when(backup.getAdlsGen2()).thenReturn(adlsGen2);
ValidationResult result = underTest.validateBackupStorageConfiguration(environment);
assertFalse(result.hasError());
}
Aggregations