Search in sources :

Example 1 with CommonCloudProperties

use of com.sequenceiq.it.cloudbreak.cloud.v4.CommonCloudProperties 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)

Aggregations

ResourceGroup (com.microsoft.azure.management.resources.ResourceGroup)1 Tunnel (com.sequenceiq.common.api.type.Tunnel)1 DistroXDatabaseAvailabilityType (com.sequenceiq.distrox.api.v1.distrox.model.database.DistroXDatabaseAvailabilityType)1 DistroXDatabaseRequest (com.sequenceiq.distrox.api.v1.distrox.model.database.DistroXDatabaseRequest)1 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)1 EnvironmentStatus (com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentStatus)1 Status (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.Status)1 OperationState (com.sequenceiq.freeipa.api.v1.operation.model.OperationState)1 CloudbreakClient (com.sequenceiq.it.cloudbreak.CloudbreakClient)1 EnvironmentClient (com.sequenceiq.it.cloudbreak.EnvironmentClient)1 FreeIpaClient (com.sequenceiq.it.cloudbreak.FreeIpaClient)1 ResourceGroupTest (com.sequenceiq.it.cloudbreak.ResourceGroupTest)1 SdxClient (com.sequenceiq.it.cloudbreak.SdxClient)1 AwsAvailabilityZoneAssertion (com.sequenceiq.it.cloudbreak.assertion.distrox.AwsAvailabilityZoneAssertion)1 DistroXExternalDatabaseAssertion.validateTemplateContainsExternalDatabaseHostname (com.sequenceiq.it.cloudbreak.assertion.distrox.DistroXExternalDatabaseAssertion.validateTemplateContainsExternalDatabaseHostname)1 DistroXTestClient (com.sequenceiq.it.cloudbreak.client.DistroXTestClient)1 EnvironmentTestClient (com.sequenceiq.it.cloudbreak.client.EnvironmentTestClient)1 FreeIpaTestClient (com.sequenceiq.it.cloudbreak.client.FreeIpaTestClient)1 SdxTestClient (com.sequenceiq.it.cloudbreak.client.SdxTestClient)1 MASTER (com.sequenceiq.it.cloudbreak.cloud.HostGroupType.MASTER)1