Search in sources :

Example 1 with SdxDatabaseRequest

use of com.sequenceiq.sdx.api.model.SdxDatabaseRequest in project cloudbreak by hortonworks.

the class NewNetworkWithNoInternetEnvironmentTests method testCreateNewEnvironmentWithNewNetworkAndNoInternet.

@Test(dataProvider = TEST_CONTEXT)
@UseSpotInstances
@Description(given = "there is a running cloudbreak", when = "create an Environment with new network which CIDR is 10.0.0.0/16, outbound internet traffic is disabled with FreeIPA and SDX", then = "should create new Subnets and the number depends on the provider and should create instances without internet access.")
public void testCreateNewEnvironmentWithNewNetworkAndNoInternet(TestContext testContext) {
    String networkKey = "someOtherNetwork";
    String sdx = resourcePropertyProvider().getName();
    SdxDatabaseRequest database = new SdxDatabaseRequest();
    database.setCreate(false);
    testContext.given(CredentialTestDto.class).when(credentialTestClient.create()).given("telemetry", TelemetryTestDto.class).withLogging().withReportClusterLogs().given(EnvironmentTestDto.class).given(networkKey, EnvironmentNetworkTestDto.class).withNetworkCIDR("10.0.0.0/16").withPrivateSubnets().withNoOutboundInternetTraffic().withServiceEndpoints().given(EnvironmentTestDto.class).withNetwork(networkKey).withTelemetry("telemetry").withCreateFreeIpa(Boolean.TRUE).when(environmentTestClient.create()).await(EnvironmentStatus.AVAILABLE).then((tc, testDto, cc) -> environmentTestClient.describe().action(tc, testDto, cc)).then(EnvironmentNetworkTestAssertion.environmentContainsNeccessaryConfigs()).init(FreeIpaTestDto.class).when(freeIpaTestClient.describe()).then((tc, testDto, client) -> sshJClientActions.checkNoOutboundInternetTraffic(testDto, client)).given(sdx, SdxTestDto.class).withExternalDatabase(database).withCloudStorage().when(sdxTestClient.create(), RunningParameter.key(sdx)).await(SdxClusterStatusResponse.RUNNING).then((tc, testDto, client) -> sshJClientActions.checkNoOutboundInternetTraffic(testDto, getInstanceGroups(testDto, client), List.of(HostGroupType.MASTER.getName()))).validate();
}
Also used : TelemetryTestDto(com.sequenceiq.it.cloudbreak.dto.telemetry.TelemetryTestDto) CredentialTestDto(com.sequenceiq.it.cloudbreak.dto.credential.CredentialTestDto) FreeIpaTestDto(com.sequenceiq.it.cloudbreak.dto.freeipa.FreeIpaTestDto) Test(org.testng.annotations.Test) SdxDatabaseRequest(com.sequenceiq.sdx.api.model.SdxDatabaseRequest) Description(com.sequenceiq.it.cloudbreak.context.Description) EnvironmentNetworkTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentNetworkTestDto) Inject(javax.inject.Inject) CredentialTestClient(com.sequenceiq.it.cloudbreak.client.CredentialTestClient) SdxTestDto(com.sequenceiq.it.cloudbreak.dto.sdx.SdxTestDto) TestContext(com.sequenceiq.it.cloudbreak.context.TestContext) InstanceGroupV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.instancegroup.InstanceGroupV4Response) SdxTestClient(com.sequenceiq.it.cloudbreak.client.SdxTestClient) UseSpotInstances(com.sequenceiq.it.cloudbreak.util.spot.UseSpotInstances) FreeIpaTestClient(com.sequenceiq.it.cloudbreak.client.FreeIpaTestClient) List(java.util.List) EnvironmentTestClient(com.sequenceiq.it.cloudbreak.client.EnvironmentTestClient) EnvironmentTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto) RunningParameter(com.sequenceiq.it.cloudbreak.context.RunningParameter) EnvironmentStatus(com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentStatus) SdxClient(com.sequenceiq.it.cloudbreak.SdxClient) SdxClusterStatusResponse(com.sequenceiq.sdx.api.model.SdxClusterStatusResponse) EnvironmentNetworkTestAssertion(com.sequenceiq.it.cloudbreak.assertion.environment.EnvironmentNetworkTestAssertion) Collections(java.util.Collections) SshJClientActions(com.sequenceiq.it.cloudbreak.util.ssh.action.SshJClientActions) HostGroupType(com.sequenceiq.it.cloudbreak.cloud.HostGroupType) AbstractE2ETest(com.sequenceiq.it.cloudbreak.testcase.e2e.AbstractE2ETest) EnvironmentTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto) SdxDatabaseRequest(com.sequenceiq.sdx.api.model.SdxDatabaseRequest) 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) UseSpotInstances(com.sequenceiq.it.cloudbreak.util.spot.UseSpotInstances)

Example 2 with SdxDatabaseRequest

use of com.sequenceiq.sdx.api.model.SdxDatabaseRequest in project cloudbreak by hortonworks.

the class FreeIpaUpgradeTests method testHAFreeIpaInstanceUpgrade.

@Test(dataProvider = TEST_CONTEXT)
@Description(given = "there is a running cloudbreak", when = "a valid stack create request is sent with 3 FreeIPA instances " + "AND the stack is upgraded one node at a time", then = "the stack should be available AND deletable")
public void testHAFreeIpaInstanceUpgrade(TestContext testContext) {
    String freeIpa = resourcePropertyProvider().getName();
    SdxDatabaseRequest sdxDatabaseRequest = new SdxDatabaseRequest();
    sdxDatabaseRequest.setAvailabilityType(SdxDatabaseAvailabilityType.NONE);
    sdxDatabaseRequest.setCreate(false);
    testContext.given("telemetry", TelemetryTestDto.class).withLogging().withReportClusterLogs().given(freeIpa, FreeIpaTestDto.class).withFreeIpaHa(1, 3).withTelemetry("telemetry").withUpgradeCatalogAndImage().when(freeIpaTestClient.create(), key(freeIpa)).await(FREEIPA_AVAILABLE).given(SdxTestDto.class).withCloudStorage().withExternalDatabase(sdxDatabaseRequest).when(sdxTestClient.create()).await(SdxClusterStatusResponse.RUNNING).given(freeIpa, FreeIpaTestDto.class).when(freeIpaTestClient.upgrade()).await(Status.UPDATE_IN_PROGRESS, waitForFlow().withWaitForFlow(Boolean.FALSE)).given(FreeIpaOperationStatusTestDto.class).withOperationId(((FreeIpaTestDto) testContext.get(freeIpa)).getOperationId()).then((tc, testDto, freeIpaClient) -> testFreeIpaAvailabilityDuringUpgrade(tc, testDto, freeIpaClient, freeIpa)).await(COMPLETED, waitForFlow().withWaitForFlow(Boolean.FALSE).withTimeoutChecker(new AbsolutTimeBasedTimeoutChecker(TWO_HOURS_IN_SEC))).given(freeIpa, FreeIpaTestDto.class).await(FREEIPA_AVAILABLE, waitForFlow().withWaitForFlow(Boolean.FALSE)).then((tc, testDto, client) -> freeIpaTestClient.delete().action(tc, testDto, client)).await(FREEIPA_DELETE_COMPLETED, waitForFlow().withWaitForFlow(Boolean.FALSE)).validate();
}
Also used : AbsolutTimeBasedTimeoutChecker(com.sequenceiq.cloudbreak.polling.AbsolutTimeBasedTimeoutChecker) TelemetryTestDto(com.sequenceiq.it.cloudbreak.dto.telemetry.TelemetryTestDto) SdxDatabaseRequest(com.sequenceiq.sdx.api.model.SdxDatabaseRequest) 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)

Example 3 with SdxDatabaseRequest

use of com.sequenceiq.sdx.api.model.SdxDatabaseRequest in project cloudbreak by hortonworks.

the class FreeIpaUpgradeTests method testSingleFreeIpaInstanceUpgrade.

@Test(dataProvider = TEST_CONTEXT)
@Description(given = "there is a running cloudbreak", when = "a valid stack create request is sent with 1 FreeIPA instances " + "AND the stack is upgraded one node at a time", then = "the stack should be available AND deletable")
public void testSingleFreeIpaInstanceUpgrade(TestContext testContext) {
    String freeIpa = resourcePropertyProvider().getName();
    SdxDatabaseRequest sdxDatabaseRequest = new SdxDatabaseRequest();
    sdxDatabaseRequest.setAvailabilityType(SdxDatabaseAvailabilityType.NONE);
    sdxDatabaseRequest.setCreate(false);
    testContext.given("telemetry", TelemetryTestDto.class).withLogging().withReportClusterLogs().given(freeIpa, FreeIpaTestDto.class).withTelemetry("telemetry").withUpgradeCatalogAndImage().when(freeIpaTestClient.create(), key(freeIpa)).await(FREEIPA_AVAILABLE).given(SdxTestDto.class).withCloudStorage().withExternalDatabase(sdxDatabaseRequest).when(sdxTestClient.create()).await(SdxClusterStatusResponse.RUNNING).given(freeIpa, FreeIpaTestDto.class).when(freeIpaTestClient.upgrade()).await(Status.UPDATE_IN_PROGRESS, waitForFlow().withWaitForFlow(Boolean.FALSE)).given(FreeIpaOperationStatusTestDto.class).withOperationId(((FreeIpaTestDto) testContext.get(freeIpa)).getOperationId()).then((tc, testDto, freeIpaClient) -> testFreeIpaAvailabilityDuringUpgrade(tc, testDto, freeIpaClient, freeIpa)).await(COMPLETED).given(freeIpa, FreeIpaTestDto.class).await(FREEIPA_AVAILABLE, waitForFlow().withWaitForFlow(Boolean.FALSE)).then((tc, testDto, client) -> freeIpaTestClient.delete().action(tc, testDto, client)).await(FREEIPA_DELETE_COMPLETED, waitForFlow().withWaitForFlow(Boolean.FALSE)).validate();
}
Also used : SdxDatabaseRequest(com.sequenceiq.sdx.api.model.SdxDatabaseRequest) 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)

Example 4 with SdxDatabaseRequest

use of com.sequenceiq.sdx.api.model.SdxDatabaseRequest in project cloudbreak by hortonworks.

the class SdxInternalTestDto method withoutDatabase.

public SdxInternalTestDto withoutDatabase() {
    final SdxDatabaseRequest sdxDatabaseRequest = new SdxDatabaseRequest();
    sdxDatabaseRequest.setCreate(false);
    sdxDatabaseRequest.setAvailabilityType(SdxDatabaseAvailabilityType.NONE);
    getRequest().setExternalDatabase(sdxDatabaseRequest);
    return this;
}
Also used : SdxDatabaseRequest(com.sequenceiq.sdx.api.model.SdxDatabaseRequest)

Example 5 with SdxDatabaseRequest

use of com.sequenceiq.sdx.api.model.SdxDatabaseRequest 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)));
}
Also used : SdxInternalTestDto(com.sequenceiq.it.cloudbreak.dto.sdx.SdxInternalTestDto) SdxDatabaseRequest(com.sequenceiq.sdx.api.model.SdxDatabaseRequest)

Aggregations

SdxDatabaseRequest (com.sequenceiq.sdx.api.model.SdxDatabaseRequest)29 Description (com.sequenceiq.it.cloudbreak.context.Description)15 Test (org.testng.annotations.Test)15 SdxTestClient (com.sequenceiq.it.cloudbreak.client.SdxTestClient)10 TestContext (com.sequenceiq.it.cloudbreak.context.TestContext)10 Inject (javax.inject.Inject)10 CloudPlatform (com.sequenceiq.cloudbreak.common.mappable.CloudPlatform)9 RunningParameter.key (com.sequenceiq.it.cloudbreak.context.RunningParameter.key)9 SdxInternalTestDto (com.sequenceiq.it.cloudbreak.dto.sdx.SdxInternalTestDto)9 SdxClusterStatusResponse (com.sequenceiq.sdx.api.model.SdxClusterStatusResponse)9 SdxCluster (com.sequenceiq.datalake.entity.SdxCluster)8 SdxTestDto (com.sequenceiq.it.cloudbreak.dto.sdx.SdxTestDto)8 UseSpotInstances (com.sequenceiq.it.cloudbreak.util.spot.UseSpotInstances)8 SdxDatabaseAvailabilityType (com.sequenceiq.sdx.api.model.SdxDatabaseAvailabilityType)8 Test (org.junit.jupiter.api.Test)8 TestFailException (com.sequenceiq.it.cloudbreak.exception.TestFailException)5 AbstractE2ETest (com.sequenceiq.it.cloudbreak.testcase.e2e.AbstractE2ETest)5 HostGroupType (com.sequenceiq.it.cloudbreak.cloud.HostGroupType)4 FreeIpaTestDto (com.sequenceiq.it.cloudbreak.dto.freeipa.FreeIpaTestDto)4 List (java.util.List)4