use of com.sequenceiq.distrox.api.v1.distrox.model.database.DistroXDatabaseRequest in project cloudbreak by hortonworks.
the class DistroXDatabaseRequestToStackDatabaseRequestConverter method convert.
public DatabaseRequest convert(DistroXDatabaseRequest source) {
DatabaseRequest request = new DatabaseRequest();
request.setAvailabilityType(convertAvailabilityType(source.getAvailabilityType()));
request.setDatabaseEngineVersion(source.getDatabaseEngineVersion());
return request;
}
use of com.sequenceiq.distrox.api.v1.distrox.model.database.DistroXDatabaseRequest in project cloudbreak by hortonworks.
the class EnvironmentStopStartTests method testCreateStopStartEnvironment.
@Test(dataProvider = TEST_CONTEXT, timeOut = 9000000)
@Description(given = "there is a running cloudbreak", when = "create an attached SDX and Datahubs (in case of AWS, create one of the Datahub with external database)", then = "should be stopped first and started after it, and required services should be in running state in CM")
public void testCreateStopStartEnvironment(TestContext testContext) {
LOGGER.info("Environment stop-start test execution has been started....");
DistroXDatabaseRequest distroXDatabaseRequest = new DistroXDatabaseRequest();
distroXDatabaseRequest.setAvailabilityType(DistroXDatabaseAvailabilityType.NON_HA);
testContext.given(CredentialTestDto.class).when(credentialTestClient.create()).given("telemetry", TelemetryTestDto.class).withLogging().withReportClusterLogs().given(EnvironmentTestDto.class).withNetwork().withTelemetry("telemetry").withCreateFreeIpa(Boolean.TRUE).addTags(ENV_TAGS).when(environmentTestClient.create()).given(SdxInternalTestDto.class).addTags(SDX_TAGS).withCloudStorage(getCloudStorageRequest(testContext)).when(sdxTestClient.createInternal()).given(EnvironmentTestDto.class).await(EnvironmentStatus.AVAILABLE).then(cloudProviderSideTagAssertion.verifyEnvironmentTags(ENV_TAGS)).given(SdxInternalTestDto.class).await(SdxClusterStatusResponse.RUNNING).then(cloudProviderSideTagAssertion.verifyInternalSdxTags(SDX_TAGS)).given("dx1", DistroXTestDto.class).withExternalDatabaseOnAws(distroXDatabaseRequest).addTags(DX1_TAGS).when(distroXTestClient.create(), RunningParameter.key("dx1")).given("dx2", DistroXTestDto.class).when(distroXTestClient.create(), RunningParameter.key("dx2")).given("dx1", DistroXTestDto.class).await(STACK_AVAILABLE, RunningParameter.key("dx1")).then(cloudProviderSideTagAssertion.verifyDistroxTags(DX1_TAGS)).given("dx2", DistroXTestDto.class).await(STACK_AVAILABLE, RunningParameter.key("dx2")).given(EnvironmentTestDto.class).when(environmentTestClient.stop()).await(EnvironmentStatus.ENV_STOPPED).given(EnvironmentTestDto.class).when(environmentTestClient.start()).await(EnvironmentStatus.AVAILABLE).given("dx1", DistroXTestDto.class).await(STACK_AVAILABLE, RunningParameter.key("dx1")).awaitForHealthyInstances().then(this::verifyCmServicesStartedSuccessfully).validate();
LOGGER.info("Environment stop-start test execution has been finished....");
}
use of com.sequenceiq.distrox.api.v1.distrox.model.database.DistroXDatabaseRequest in project cloudbreak by hortonworks.
the class AbstractIntegrationTest method createDatahubWithDatabase.
protected void createDatahubWithDatabase(TestContext testContext) {
DistroXDatabaseRequest databaseRequest = new DistroXDatabaseRequest();
databaseRequest.setAvailabilityType(DistroXDatabaseAvailabilityType.NON_HA);
testContext.given(DistroXTestDto.class).withExternalDatabase(databaseRequest).when(distroXTestClient.create()).await(STACK_AVAILABLE).awaitForHealthyInstances().when(distroXTestClient.get()).validate();
}
use of com.sequenceiq.distrox.api.v1.distrox.model.database.DistroXDatabaseRequest in project cloudbreak by hortonworks.
the class DistroXEncryptedVolumeTest method testCreateDistroXWithEncryptedVolumesInSingleRG.
@Test(dataProvider = TEST_CONTEXT, groups = { "azure_singlerg" })
@UseSpotInstances
@Description(given = "there is a valid Azure credential and a new resource group", when = "environment with freeIpa should be created in the resource group with encrypted volume", and = "SDX then distroX also with encrypted volumes should be created for environment", then = "freeIpa, sdx and distroX volumes should be encrypted with the provided key")
public void testCreateDistroXWithEncryptedVolumesInSingleRG(TestContext testContext) {
DistroXDatabaseRequest distroXDatabaseRequest = new DistroXDatabaseRequest();
List<DistroXInstanceGroupTestDto> distroXInstanceGroupTestDtos = new DistroXInstanceGroupsBuilder(testContext).defaultHostGroup().withDiskEncryption().build();
distroXDatabaseRequest.setAvailabilityType(DistroXDatabaseAvailabilityType.NON_HA);
createResourceGroupForEnvironment(testContext);
testContext.given(EnvironmentNetworkTestDto.class).withServiceEndpoints().given("telemetry", TelemetryTestDto.class).withLogging().withReportClusterLogs().given(EnvironmentTestDto.class).withNetwork().withResourceGroup(ResourceGroupTest.AZURE_RESOURCE_GROUP_USAGE_SINGLE, resourceGroupForTest).withResourceEncryption().withTelemetry("telemetry").withTunnel(Tunnel.CLUSTER_PROXY).withCreateFreeIpa(Boolean.FALSE).when(environmentTestClient.create()).then((context, dto, client) -> {
context.getCloudProviderAssertion().assertServiceEndpoint(dto);
return dto;
}).await(EnvironmentStatus.AVAILABLE).given(FreeIpaTestDto.class).withEnvironment().withTelemetry("telemetry").withCatalog(commonCloudProperties().getImageValidation().getFreeIpaImageCatalog(), commonCloudProperties().getImageValidation().getFreeIpaImageUuid()).when(freeIpaTestClient.create()).await(Status.AVAILABLE).awaitForHealthyInstances().given(FreeIpaUserSyncTestDto.class).when(freeIpaTestClient.getLastSyncOperationStatus()).await(OperationState.COMPLETED).given(EnvironmentTestDto.class).when(environmentTestClient.describe()).then(this::verifyEnvironmentResponseDiskEncryptionKey).given(FreeIpaTestDto.class).then(this::verifyFreeIpaVolumeEncryptionKey).given(SdxTestDto.class).withCloudStorage().when(sdxTestClient.create()).await(SdxClusterStatusResponse.RUNNING).awaitForHealthyInstances().then(this::verifySdxVolumeEncryptionKey).given(DistroXTestDto.class).withInstanceGroupsEntity(distroXInstanceGroupTestDtos).withExternalDatabase(distroXDatabaseRequest).when(distroXTestClient.create()).await(STACK_AVAILABLE).awaitForHealthyInstances().then(this::verifyDistroxVolumeEncryptionKey).then(this::verifyAwsEnaDriver).then(new AwsAvailabilityZoneAssertion()).then(validateTemplateContainsExternalDatabaseHostname()).validate();
}
use of com.sequenceiq.distrox.api.v1.distrox.model.database.DistroXDatabaseRequest in project cloudbreak by hortonworks.
the class DistroXDatabaseRequestToStackDatabaseRequestConverterTest method convertDatabaseEngineVersion.
void convertDatabaseEngineVersion() {
DatabaseRequest source = new DatabaseRequest();
source.setDatabaseEngineVersion(DB_VERSION);
DistroXDatabaseRequest result = underTest.convert(source);
assertThat(result.getDatabaseEngineVersion()).isEqualTo(DB_VERSION);
}
Aggregations