use of com.sequenceiq.it.cloudbreak.dto.distrox.DistroXTestDto 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.dto.distrox.DistroXTestDto in project cloudbreak by hortonworks.
the class DataHubListFilteringTest method testDataHubListFiltering.
@Test(dataProvider = TEST_CONTEXT_WITH_MOCK)
@Description(given = "there are datahubs", when = "users share with each other", then = "they see the other's datahub in the list")
public void testDataHubListFiltering(TestContext testContext) {
useRealUmsUser(testContext, AuthUserKeys.USER_ENV_CREATOR_A);
resourceCreator.createDefaultCredential(testContext);
EnvironmentTestDto environment = resourceCreator.createDefaultEnvironment(testContext);
resourceCreator.createNewFreeIpa(testContext, environment);
resourceCreator.createDefaultDataLake(testContext);
DistroXTestDto datahubA = resourceCreator.createDefaultDataHubAndWaitAs(testContext, Optional.of(AuthUserKeys.USER_ACCOUNT_ADMIN));
testContext.given(UmsTestDto.class).assignTarget(EnvironmentTestDto.class.getSimpleName()).withDatahubCreator().when(umsTestClient.assignResourceRole(AuthUserKeys.USER_ENV_CREATOR_B, regionAwareInternalCrnGeneratorFactory)).withEnvironmentUser().when(umsTestClient.assignResourceRole(AuthUserKeys.USER_ENV_CREATOR_B, regionAwareInternalCrnGeneratorFactory)).validate();
assertUserSeesAll(testContext, AuthUserKeys.USER_ENV_CREATOR_A, datahubA.getName());
assertUserSeesAll(testContext, AuthUserKeys.USER_ACCOUNT_ADMIN, datahubA.getName());
assertUserSeesAll(testContext, AuthUserKeys.USER_ENV_CREATOR_B, datahubA.getName());
useRealUmsUser(testContext, AuthUserKeys.USER_ENV_CREATOR_B);
DistroXTestDto dataHubB = resourceCreator.createNewDataHubAndWaitAs(testContext, Optional.of(AuthUserKeys.USER_ACCOUNT_ADMIN));
assertUserSeesAll(testContext, AuthUserKeys.USER_ENV_CREATOR_A, datahubA.getName(), dataHubB.getName());
assertUserSeesAll(testContext, AuthUserKeys.USER_ACCOUNT_ADMIN, datahubA.getName(), dataHubB.getName());
assertUserSeesAll(testContext, AuthUserKeys.USER_ENV_CREATOR_B, datahubA.getName(), dataHubB.getName());
testContext.given(UmsTestDto.class).assignTarget(DistroXTestDto.class.getSimpleName()).withDatahubAdmin().when(umsTestClient.assignResourceRole(AuthUserKeys.USER_ENV_CREATOR_B, regionAwareInternalCrnGeneratorFactory)).validate();
assertUserSeesAll(testContext, AuthUserKeys.USER_ENV_CREATOR_A, datahubA.getName(), dataHubB.getName());
assertUserSeesAll(testContext, AuthUserKeys.USER_ACCOUNT_ADMIN, datahubA.getName(), dataHubB.getName());
assertUserSeesAll(testContext, AuthUserKeys.USER_ENV_CREATOR_B, datahubA.getName(), dataHubB.getName());
useRealUmsUser(testContext, AuthUserKeys.USER_ACCOUNT_ADMIN);
}
use of com.sequenceiq.it.cloudbreak.dto.distrox.DistroXTestDto in project cloudbreak by hortonworks.
the class RenewDistroXCertificateTestDto method valid.
@Override
public RenewDistroXCertificateTestDto valid() {
DistroXTestDto distroXTestDto = getTestContext().get(DistroXTestDto.class);
this.stackCrn = distroXTestDto.getCrn();
return this;
}
use of com.sequenceiq.it.cloudbreak.dto.distrox.DistroXTestDto in project cloudbreak by hortonworks.
the class DistroXClusterUpscaleDownscaleTest method testScaleDownAndUp.
@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 testScaleDownAndUp(MockedTestContext testContext, ITestContext testNgContext) {
DistroXStartStopTestParameters params = new DistroXStartStopTestParameters(testNgContext.getCurrentXmlTest().getAllParameters());
String stack = resourcePropertyProvider().getName();
createDatalake(testContext);
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 < 3; i++) {
currentContext = currentContext.when(distroXClient.scale(params.getHostgroup(), UPPER_NODE_COUNT)).await(STACK_AVAILABLE, key(stack).withPollingInterval(POLLING_INTERVAL));
currentContext = currentContext.when(distroXClient.scale(params.getHostgroup(), LOWER_NODE_COUNT)).await(STACK_AVAILABLE, key(stack).withPollingInterval(POLLING_INTERVAL));
}
currentContext.validate();
}
use of com.sequenceiq.it.cloudbreak.dto.distrox.DistroXTestDto in project cloudbreak by hortonworks.
the class DistroXClusterUpscaleDownscaleTest method scalingTestWithManyNodes.
private void scalingTestWithManyNodes(MockedTestContext testContext, int workerInitialNodeCount, int workerNodeCountAfterUpscale, int workerNodeCountAfterDownscale, int scalingCycles) {
String stack = resourcePropertyProvider().getName();
createDatalake(testContext);
DistroXTestDto currentContext = createDistroxDto(testContext, stack, workerInitialNodeCount).when(distroXClient.create(), key(stack)).await(STACK_AVAILABLE, key(stack));
for (int i = 0; i < scalingCycles; i++) {
currentContext = currentContext.when(distroXClient.scale(HostGroupType.WORKER.getName(), workerNodeCountAfterDownscale)).await(STACK_AVAILABLE, key(stack).withPollingInterval(POLLING_INTERVAL));
currentContext = currentContext.when(distroXClient.scale(HostGroupType.WORKER.getName(), workerNodeCountAfterUpscale)).await(STACK_AVAILABLE, key(stack).withPollingInterval(POLLING_INTERVAL));
}
currentContext.validate();
}
Aggregations