use of com.sequenceiq.it.cloudbreak.dto.sdx.SdxInternalTestDto in project cloudbreak by hortonworks.
the class ResourceCreator method createNewDataLake.
public SdxInternalTestDto createNewDataLake(TestContext testContext, EnvironmentTestDto environment) {
SdxDatabaseRequest sdxDatabaseRequest = new SdxDatabaseRequest();
sdxDatabaseRequest.setAvailabilityType(SdxDatabaseAvailabilityType.NONE);
String name = resourcePropertyProvider.getName();
return create(testContext.given(name, SdxInternalTestDto.class).withName(name).withEnvironmentName(environment.getName()).withDatabase(sdxDatabaseRequest).withCloudStorage(getCloudStorageRequest(testContext)));
}
use of com.sequenceiq.it.cloudbreak.dto.sdx.SdxInternalTestDto in project cloudbreak by hortonworks.
the class ResourceCreator method createDefaultDataLake.
public SdxInternalTestDto createDefaultDataLake(TestContext testContext) {
SdxDatabaseRequest sdxDatabaseRequest = new SdxDatabaseRequest();
sdxDatabaseRequest.setAvailabilityType(SdxDatabaseAvailabilityType.NONE);
return create(testContext.given(SdxInternalTestDto.class).withDatabase(sdxDatabaseRequest).withCloudStorage(getCloudStorageRequest(testContext)));
}
use of com.sequenceiq.it.cloudbreak.dto.sdx.SdxInternalTestDto in project cloudbreak by hortonworks.
the class SdxBackupRestoreTest method testSDXBackupRestoreCanBeSuccessful.
@Test(dataProvider = TEST_CONTEXT)
@UseSpotInstances
@Description(given = "there is a running Manowar SDX cluster in available state", when = "a basic SDX backup then restore request has been sent", then = "SDX restore should be done successfully")
public void testSDXBackupRestoreCanBeSuccessful(TestContext testContext) {
SdxInternalTestDto sdxInternalTestDto = testContext.given(SdxInternalTestDto.class);
String cloudStorageBaseLocation = sdxInternalTestDto.getResponse().getCloudStorageBaseLocation();
String backupObject = "backups";
testContext.given(SdxInternalTestDto.class).when(sdxTestClient.syncInternal()).await(SdxClusterStatusResponse.RUNNING).awaitForHealthyInstances().when(sdxTestClient.backupInternal(StringUtils.join(List.of(cloudStorageBaseLocation, backupObject), "/"), null)).await(SdxClusterStatusResponse.RUNNING).awaitForHealthyInstances().then(this::validateDatalakeBackupStatus).then(this::validateDatalakeStatus).then((tc, testDto, client) -> {
getCloudFunctionality(tc).cloudStorageListContainer(cloudStorageBaseLocation, backupObject, true);
return testDto;
}).validate();
testContext.given(SdxInternalTestDto.class).when(sdxTestClient.restoreInternal(backupId, null)).await(SdxClusterStatusResponse.RUNNING).awaitForHealthyInstances().then(this::validateDatalakeRestoreStatus).then(this::validateDatalakeStatus).validate();
}
use of com.sequenceiq.it.cloudbreak.dto.sdx.SdxInternalTestDto in project cloudbreak by hortonworks.
the class DataLakeListFilteringTest method testDataLakeListFiltering.
@Test(dataProvider = TEST_CONTEXT_WITH_MOCK)
@Description(given = "there are datalakes", when = "users share with each other", then = "they see the other's datalake in the list")
public void testDataLakeListFiltering(TestContext testContext) {
useRealUmsUser(testContext, AuthUserKeys.USER_ENV_CREATOR_A);
resourceCreator.createDefaultCredential(testContext);
resourceCreator.createDefaultEnvironment(testContext);
SdxInternalTestDto dataLakeA = resourceCreator.createDefaultDataLake(testContext);
useRealUmsUser(testContext, AuthUserKeys.USER_ENV_CREATOR_B);
CredentialTestDto credential = resourceCreator.createNewCredential(testContext);
EnvironmentTestDto environmentB = resourceCreator.createNewEnvironment(testContext, credential);
SdxInternalTestDto dataLakeB = resourceCreator.createNewDataLake(testContext, environmentB);
assertUserSeesAll(testContext, AuthUserKeys.USER_ENV_CREATOR_A, dataLakeA.getName());
assertUserSeesAll(testContext, AuthUserKeys.USER_ENV_CREATOR_B, dataLakeB.getName());
assertUserSeesAll(testContext, AuthUserKeys.USER_ACCOUNT_ADMIN, dataLakeA.getName(), dataLakeB.getName());
assertUserDoesNotSeeAnyOf(testContext, AuthUserKeys.USER_ENV_CREATOR_A, dataLakeB.getName());
assertUserDoesNotSeeAnyOf(testContext, AuthUserKeys.USER_ENV_CREATOR_B, dataLakeA.getName());
testContext.given(UmsTestDto.class).assignTarget(EnvironmentTestDto.class.getSimpleName()).withEnvironmentAdmin().when(umsTestClient.assignResourceRole(AuthUserKeys.USER_ENV_CREATOR_B, regionAwareInternalCrnGeneratorFactory)).validate();
testContext.given(UmsTestDto.class).assignTarget(environmentB.getName()).withEnvironmentUser().when(umsTestClient.assignResourceRole(AuthUserKeys.USER_ENV_CREATOR_A, regionAwareInternalCrnGeneratorFactory)).validate();
assertUserSeesAll(testContext, AuthUserKeys.USER_ENV_CREATOR_A, dataLakeA.getName(), dataLakeB.getName());
assertUserSeesAll(testContext, AuthUserKeys.USER_ENV_CREATOR_B, dataLakeA.getName(), dataLakeB.getName());
assertUserSeesAll(testContext, AuthUserKeys.USER_ACCOUNT_ADMIN, dataLakeA.getName(), dataLakeB.getName());
useRealUmsUser(testContext, AuthUserKeys.USER_ACCOUNT_ADMIN);
}
Aggregations