Search in sources :

Example 1 with Description

use of com.sequenceiq.it.cloudbreak.context.Description in project cloudbreak by hortonworks.

the class DistroXClusterStopStartTest method testCreateNewRegularDistroXClusterScaleStartStop.

// CB-7294
@Ignore
@Test(dataProvider = TEST_CONTEXT_WITH_MOCK)
@Description(given = "there is a running DistroX cluster", when = "a scale, start stop called many times", then = "the cluster should be available")
public void testCreateNewRegularDistroXClusterScaleStartStop(MockedTestContext testContext, ITestContext testNgContext) {
    DistroXStartStopTestParameters params = new DistroXStartStopTestParameters(testNgContext.getCurrentXmlTest().getAllParameters());
    String stack = resourcePropertyProvider().getName();
    int step = params.getStep();
    int current = step;
    DistroXTestDto currentContext = testContext.given(DIX_NET_KEY, DistroXNetworkTestDto.class).given(DIX_IMG_KEY, DistroXImageTestDto.class).withImageCatalog().withImageId(IMAGE_CATALOG_ID).given(CM_FOR_DISTRO_X, DistroXClouderaManagerTestDto.class).given(CLUSTER_KEY, DistroXClusterTestDto.class).withValidateBlueprint(false).withClouderaManager(CM_FOR_DISTRO_X).given(stack, DistroXTestDto.class).withCluster(CLUSTER_KEY).withName(stack).withImageSettings(DIX_IMG_KEY).withNetwork(DIX_NET_KEY).when(distroXClient.create(), key(stack)).await(STACK_AVAILABLE, key(stack));
    for (int i = 0; i < params.getTimes(); i++, current += step) {
        currentContext = currentContext.when(distroXClient.stop(), key(stack)).await(STACK_STOPPED, key(stack)).then(auditGrpcServiceAssertion::stop).when(distroXClient.start(), key(stack)).await(STACK_AVAILABLE, key(stack)).then(auditGrpcServiceAssertion::start).when(distroXClient.scale(params.getHostgroup(), current)).await(STACK_AVAILABLE, key(stack).withPollingInterval(POLLING_INTERVAL));
    }
    currentContext.validate();
}
Also used : DistroXTestDto(com.sequenceiq.it.cloudbreak.dto.distrox.DistroXTestDto) DistroXImageTestDto(com.sequenceiq.it.cloudbreak.dto.distrox.image.DistroXImageTestDto) DistroXClusterTestDto(com.sequenceiq.it.cloudbreak.dto.distrox.cluster.DistroXClusterTestDto) Ignore(org.testng.annotations.Ignore) Description(com.sequenceiq.it.cloudbreak.context.Description) AbstractClouderaManagerTest(com.sequenceiq.it.cloudbreak.testcase.mock.clouderamanager.AbstractClouderaManagerTest) Test(org.testng.annotations.Test)

Example 2 with Description

use of com.sequenceiq.it.cloudbreak.context.Description 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 Description

use of com.sequenceiq.it.cloudbreak.context.Description 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 4 with Description

use of com.sequenceiq.it.cloudbreak.context.Description 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 5 with Description

use of com.sequenceiq.it.cloudbreak.context.Description 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)

Aggregations

Description (com.sequenceiq.it.cloudbreak.context.Description)72 Test (org.testng.annotations.Test)71 EnvironmentTestDto (com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto)30 Inject (javax.inject.Inject)30 TestContext (com.sequenceiq.it.cloudbreak.context.TestContext)29 DistroXTestDto (com.sequenceiq.it.cloudbreak.dto.distrox.DistroXTestDto)24 AbstractE2ETest (com.sequenceiq.it.cloudbreak.testcase.e2e.AbstractE2ETest)22 RunningParameter.key (com.sequenceiq.it.cloudbreak.context.RunningParameter.key)19 UseSpotInstances (com.sequenceiq.it.cloudbreak.util.spot.UseSpotInstances)19 SdxTestClient (com.sequenceiq.it.cloudbreak.client.SdxTestClient)17 SdxInternalTestDto (com.sequenceiq.it.cloudbreak.dto.sdx.SdxInternalTestDto)17 FreeIpaTestDto (com.sequenceiq.it.cloudbreak.dto.freeipa.FreeIpaTestDto)16 SdxClusterStatusResponse (com.sequenceiq.sdx.api.model.SdxClusterStatusResponse)16 SdxDatabaseRequest (com.sequenceiq.sdx.api.model.SdxDatabaseRequest)15 EnvironmentNetworkTestDto (com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentNetworkTestDto)14 List (java.util.List)14 ImageCatalogTestDto (com.sequenceiq.it.cloudbreak.dto.imagecatalog.ImageCatalogTestDto)13 TestFailException (com.sequenceiq.it.cloudbreak.exception.TestFailException)13 AbstractIntegrationTest (com.sequenceiq.it.cloudbreak.testcase.AbstractIntegrationTest)13 DistroXTestClient (com.sequenceiq.it.cloudbreak.client.DistroXTestClient)12