Search in sources :

Example 1 with DistroXDatabaseRequest

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;
}
Also used : DatabaseRequest(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.database.DatabaseRequest) DistroXDatabaseRequest(com.sequenceiq.distrox.api.v1.distrox.model.database.DistroXDatabaseRequest)

Example 2 with DistroXDatabaseRequest

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....");
}
Also used : EnvironmentTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto) DistroXTestDto(com.sequenceiq.it.cloudbreak.dto.distrox.DistroXTestDto) SdxInternalTestDto(com.sequenceiq.it.cloudbreak.dto.sdx.SdxInternalTestDto) DistroXDatabaseRequest(com.sequenceiq.distrox.api.v1.distrox.model.database.DistroXDatabaseRequest) Description(com.sequenceiq.it.cloudbreak.context.Description) Test(org.testng.annotations.Test) AbstractE2ETest(com.sequenceiq.it.cloudbreak.testcase.e2e.AbstractE2ETest)

Example 3 with DistroXDatabaseRequest

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();
}
Also used : DistroXDatabaseRequest(com.sequenceiq.distrox.api.v1.distrox.model.database.DistroXDatabaseRequest)

Example 4 with DistroXDatabaseRequest

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();
}
Also used : DistroXInstanceGroupTestDto(com.sequenceiq.it.cloudbreak.dto.distrox.instancegroup.DistroXInstanceGroupTestDto) AwsCloudProvider(com.sequenceiq.it.cloudbreak.cloud.v4.aws.AwsCloudProvider) FreeIpaTestDto(com.sequenceiq.it.cloudbreak.dto.freeipa.FreeIpaTestDto) LoggerFactory(org.slf4j.LoggerFactory) Test(org.testng.annotations.Test) AfterMethod(org.testng.annotations.AfterMethod) Description(com.sequenceiq.it.cloudbreak.context.Description) EnvironmentNetworkTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentNetworkTestDto) Map(java.util.Map) DetailedEnvironmentResponse(com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse) DistroXInstanceGroupsBuilder(com.sequenceiq.it.cloudbreak.dto.distrox.instancegroup.DistroXInstanceGroupsBuilder) SdxUtil(com.sequenceiq.it.cloudbreak.util.SdxUtil) Tunnel(com.sequenceiq.common.api.type.Tunnel) Status(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.Status) FreeIpaClient(com.sequenceiq.it.cloudbreak.FreeIpaClient) SdxTestDto(com.sequenceiq.it.cloudbreak.dto.sdx.SdxTestDto) OperationState(com.sequenceiq.freeipa.api.v1.operation.model.OperationState) GcpCloudProvider(com.sequenceiq.it.cloudbreak.cloud.v4.gcp.GcpCloudProvider) UseSpotInstances(com.sequenceiq.it.cloudbreak.util.spot.UseSpotInstances) List(java.util.List) DistroXTestClient(com.sequenceiq.it.cloudbreak.client.DistroXTestClient) DistroXExternalDatabaseAssertion.validateTemplateContainsExternalDatabaseHostname(com.sequenceiq.it.cloudbreak.assertion.distrox.DistroXExternalDatabaseAssertion.validateTemplateContainsExternalDatabaseHostname) EnvironmentClient(com.sequenceiq.it.cloudbreak.EnvironmentClient) EnvironmentStatus(com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentStatus) SdxClusterStatusResponse(com.sequenceiq.sdx.api.model.SdxClusterStatusResponse) CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) FreeIpaUserSyncTestDto(com.sequenceiq.it.cloudbreak.dto.freeipa.FreeIpaUserSyncTestDto) AbstractE2ETest(com.sequenceiq.it.cloudbreak.testcase.e2e.AbstractE2ETest) TelemetryTestDto(com.sequenceiq.it.cloudbreak.dto.telemetry.TelemetryTestDto) DistroXDatabaseAvailabilityType(com.sequenceiq.distrox.api.v1.distrox.model.database.DistroXDatabaseAvailabilityType) AzureCloudFunctionality(com.sequenceiq.it.cloudbreak.util.azure.AzureCloudFunctionality) HashMap(java.util.HashMap) AzureCloudProvider(com.sequenceiq.it.cloudbreak.cloud.v4.azure.AzureCloudProvider) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) ResourceGroup(com.microsoft.azure.management.resources.ResourceGroup) ResourceGroupTest(com.sequenceiq.it.cloudbreak.ResourceGroupTest) DistroXInstanceGroupTestDto(com.sequenceiq.it.cloudbreak.dto.distrox.instancegroup.DistroXInstanceGroupTestDto) AwsAvailabilityZoneAssertion(com.sequenceiq.it.cloudbreak.assertion.distrox.AwsAvailabilityZoneAssertion) Logger(org.slf4j.Logger) TestContext(com.sequenceiq.it.cloudbreak.context.TestContext) MASTER(com.sequenceiq.it.cloudbreak.cloud.HostGroupType.MASTER) SdxTestClient(com.sequenceiq.it.cloudbreak.client.SdxTestClient) SshEnaDriverCheckActions(com.sequenceiq.it.cloudbreak.util.ssh.action.SshEnaDriverCheckActions) FreeIpaInstanceUtil(com.sequenceiq.it.cloudbreak.util.FreeIpaInstanceUtil) DistroXTestDto(com.sequenceiq.it.cloudbreak.dto.distrox.DistroXTestDto) FreeIpaTestClient(com.sequenceiq.it.cloudbreak.client.FreeIpaTestClient) EnvironmentTestClient(com.sequenceiq.it.cloudbreak.client.EnvironmentTestClient) EnvironmentTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto) DistroxUtil(com.sequenceiq.it.cloudbreak.util.DistroxUtil) SdxClient(com.sequenceiq.it.cloudbreak.SdxClient) DistroXDatabaseRequest(com.sequenceiq.distrox.api.v1.distrox.model.database.DistroXDatabaseRequest) EnvironmentTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto) AwsAvailabilityZoneAssertion(com.sequenceiq.it.cloudbreak.assertion.distrox.AwsAvailabilityZoneAssertion) DistroXDatabaseRequest(com.sequenceiq.distrox.api.v1.distrox.model.database.DistroXDatabaseRequest) DistroXInstanceGroupsBuilder(com.sequenceiq.it.cloudbreak.dto.distrox.instancegroup.DistroXInstanceGroupsBuilder) FreeIpaTestDto(com.sequenceiq.it.cloudbreak.dto.freeipa.FreeIpaTestDto) Description(com.sequenceiq.it.cloudbreak.context.Description) Test(org.testng.annotations.Test) AbstractE2ETest(com.sequenceiq.it.cloudbreak.testcase.e2e.AbstractE2ETest) ResourceGroupTest(com.sequenceiq.it.cloudbreak.ResourceGroupTest) UseSpotInstances(com.sequenceiq.it.cloudbreak.util.spot.UseSpotInstances)

Example 5 with DistroXDatabaseRequest

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);
}
Also used : DistroXDatabaseRequest(com.sequenceiq.distrox.api.v1.distrox.model.database.DistroXDatabaseRequest) DatabaseRequest(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.database.DatabaseRequest) DistroXDatabaseRequest(com.sequenceiq.distrox.api.v1.distrox.model.database.DistroXDatabaseRequest)

Aggregations

DistroXDatabaseRequest (com.sequenceiq.distrox.api.v1.distrox.model.database.DistroXDatabaseRequest)14 DatabaseRequest (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.database.DatabaseRequest)5 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)4 Description (com.sequenceiq.it.cloudbreak.context.Description)3 EnvironmentTestDto (com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto)3 AbstractE2ETest (com.sequenceiq.it.cloudbreak.testcase.e2e.AbstractE2ETest)3 Test (org.testng.annotations.Test)3 StackV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request)2 DistroXV1Request (com.sequenceiq.distrox.api.v1.distrox.model.DistroXV1Request)2 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)2 ResourceGroupTest (com.sequenceiq.it.cloudbreak.ResourceGroupTest)2 AwsAvailabilityZoneAssertion (com.sequenceiq.it.cloudbreak.assertion.distrox.AwsAvailabilityZoneAssertion)2 DistroXTestDto (com.sequenceiq.it.cloudbreak.dto.distrox.DistroXTestDto)2 DistroXInstanceGroupTestDto (com.sequenceiq.it.cloudbreak.dto.distrox.instancegroup.DistroXInstanceGroupTestDto)2 DistroXInstanceGroupsBuilder (com.sequenceiq.it.cloudbreak.dto.distrox.instancegroup.DistroXInstanceGroupsBuilder)2 EnvironmentNetworkTestDto (com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentNetworkTestDto)2 FreeIpaTestDto (com.sequenceiq.it.cloudbreak.dto.freeipa.FreeIpaTestDto)2 Test (org.junit.jupiter.api.Test)2 EnumSource (org.junit.jupiter.params.provider.EnumSource)2 ResourceGroup (com.microsoft.azure.management.resources.ResourceGroup)1