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();
}
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....");
}
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();
}
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();
}
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();
}
Aggregations