use of com.sequenceiq.it.cloudbreak.context.Description in project cloudbreak by hortonworks.
the class SdxResizeTests method testSDXResize.
@Test(dataProvider = TEST_CONTEXT)
@UseSpotInstances
@Description(given = "there is a running Cloudbreak, and an SDX cluster in available state", when = "resize called on the SDX cluster", then = "SDX resize should be successful, the cluster should be up and running")
public void testSDXResize(TestContext testContext) {
String sdx = resourcePropertyProvider().getName();
AtomicReference<String> expectedShape = new AtomicReference<>();
AtomicReference<String> expectedCrn = new AtomicReference<>();
AtomicReference<String> expectedName = new AtomicReference<>();
SdxDatabaseRequest sdxDatabaseRequest = new SdxDatabaseRequest();
sdxDatabaseRequest.setAvailabilityType(SdxDatabaseAvailabilityType.NONE);
testContext.given(sdx, SdxInternalTestDto.class).withDatabase(sdxDatabaseRequest).withCloudStorage(getCloudStorageRequest(testContext)).withClusterShape(SdxClusterShape.CUSTOM).when(sdxTestClient.createInternal(), key(sdx)).await(SdxClusterStatusResponse.RUNNING, key(sdx)).awaitForHealthyInstances().then((tc, testDto, client) -> {
expectedShape.set(sdxUtil.getShape(testDto, client));
expectedCrn.set(sdxUtil.getCrn(testDto, client));
expectedName.set(testDto.getName());
return testDto;
}).when(sdxTestClient.resize(), key(sdx)).await(SdxClusterStatusResponse.STOP_IN_PROGRESS, key(sdx).withWaitForFlow(Boolean.FALSE)).await(SdxClusterStatusResponse.STACK_CREATION_IN_PROGRESS, key(sdx).withWaitForFlow(Boolean.FALSE)).await(SdxClusterStatusResponse.RUNNING, key(sdx)).awaitForHealthyInstances().then((tc, dto, client) -> validateStackCrn(expectedCrn, dto)).then((tc, dto, client) -> validateCrn(expectedCrn, dto)).then((tc, dto, client) -> validateShape(dto)).then((tc, dto, client) -> validateClusterName(expectedName, dto)).validate();
}
use of com.sequenceiq.it.cloudbreak.context.Description in project cloudbreak by hortonworks.
the class AwsSdxSpotInstanceTest method testSdxOnSpotInstances.
@Test(dataProvider = TEST_CONTEXT)
@Description(given = "there is a running cloudbreak ", when = "creating an SDX with 100% spot percentage ", then = "SDX is started on spot instances, or fails with insufficient spot capacity")
public void testSdxOnSpotInstances(TestContext testContext) {
String sdx = resourcePropertyProvider().getName();
SdxDatabaseRequest database = new SdxDatabaseRequest();
database.setCreate(false);
testContext.given(SdxTestDto.class).withCloudStorage().withExternalDatabase(database).withSpotPercentage(100).when(sdxTestClient.create(), key(sdx)).then((tc, testDto, client) -> {
testDto.await(STACK_CREATED, key(sdx));
Map<String, Exception> exceptionMap = testContext.getExceptionMap();
if (!exceptionMap.isEmpty()) {
String key = testDto.getAwaitExceptionKey(STACK_CREATED);
if (exceptionMap.containsKey(key)) {
LOGGER.info("Awaiting STACK_CREATED failed, clearing exception to check status reason", exceptionMap.get(key));
exceptionMap.remove(key);
}
}
return testDto;
}).when(sdxTestClient.describe()).then(assertSpotInstances()).validate();
}
use of com.sequenceiq.it.cloudbreak.context.Description in project cloudbreak by hortonworks.
the class AzureAdlsGen2Tests method testCreateStopAndStartClusterWithAdlsGen2AndCloudStorage.
@Test(dataProvider = TEST_CONTEXT, enabled = false)
@Description(given = "there is a running cloudbreak", when = "a valid azure stack create request with attached ADLS Gen2 cloud storage and defined storage location is sent", and = "the stack is started", then = "the stack should be available AND deletable")
public void testCreateStopAndStartClusterWithAdlsGen2AndCloudStorage(TestContext testContext) {
String name = resourcePropertyProvider().getName();
CloudStorageRequest cloudStorageRequest = adlsGen2CloudStorageV4RequestWithStorageLocations(name);
testContext.given("clusterWithAdlsGen2", ClusterTestDto.class).withCloudStorage(cloudStorageRequest).withName(name).given(StackTestDto.class).withCluster("clusterWithAdlsGen2").withName(name).when(stackTestClient.createV4()).await(STACK_AVAILABLE).then(stackTestClient.deleteV4()::action).then(stackContainsStorageLocations()).then(stackContainsAdlsGen2Properties()).validate();
}
use of com.sequenceiq.it.cloudbreak.context.Description in project cloudbreak by hortonworks.
the class DistroXClusterCreationTest method testDistroxCloudStorage.
@Test(dataProvider = TEST_CONTEXT_WITH_MOCK)
@Description(given = "there is a running Cloudbreak", when = "a valid SDX create request is sent with an attached cloud storage", then = "DistroX should be available with the inherited cloud storage AND both the DistroX and the SDX is deletable")
public void testDistroxCloudStorage(MockedTestContext testContext) {
String storageEnvKey = resourcePropertyProvider().getName();
String sdxInternal = resourcePropertyProvider().getName();
String networkKey = "someNetwork";
testContext.given(networkKey, EnvironmentNetworkTestDto.class).withMock(new EnvironmentNetworkMockParams()).given(storageEnvKey, EnvironmentTestDto.class).withDescription("Env with telemetry").withLocation(ENVIRONMENT_LOCATION).withNetwork(networkKey).withTelemetry(telemetry()).withCreateFreeIpa(Boolean.FALSE).withMockIDBMS().when(getEnvironmentTestClient().create(), key(storageEnvKey)).await(EnvironmentStatus.AVAILABLE).when(getEnvironmentTestClient().describe(), key(storageEnvKey)).given(FreeIpaTestDto.class).withEnvironment(storageEnvKey).when(freeIpaTestClient.create()).await(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.Status.AVAILABLE).given(sdxInternal, SdxInternalTestDto.class).withDatabase(sdxDatabaseRequestWithCreateTrue()).withCloudStorage(testStorage()).withEnvironmentKey(key(storageEnvKey)).when(sdxTestClient.createInternal(), key(sdxInternal)).await(SdxClusterStatusResponse.RUNNING).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).withBlueprintName(getBlueprintName(testContext)).withValidateBlueprint(false).withClouderaManager(CM_FOR_DISTRO_X).withRdsConfigNames().given(DistroXTestDto.class).withEnvironmentKey(storageEnvKey).withCluster(CLUSTER_KEY).withImageSettings(DIX_IMG_KEY).withNetwork(DIX_NET_KEY).when(distroXClient.create(), key(DISTRO_X_STACK)).await(STACK_AVAILABLE).then(DistroXClusterCreationTest::distroxInheritedCloudStorage).then(DistroXClusterCreationTest::distroxCloudStorageLocationNotEmpty).validate();
}
use of com.sequenceiq.it.cloudbreak.context.Description in project cloudbreak by hortonworks.
the class RecipeClusterTest method testDeletedRecipeCannotBeAssignedToCluster.
@Test(dataProvider = TEST_CONTEXT_WITH_MOCK)
@Description(given = "a deleted recipe", when = "starting cluster with deleted recipe", then = "badrequest exception is received")
public void testDeletedRecipeCannotBeAssignedToCluster(MockedTestContext testContext) {
LOGGER.info("testing recipe execution for type: {}", PRE_CLOUDERA_MANAGER_START.name());
String recipeName = resourcePropertyProvider().getName();
String stackName = resourcePropertyProvider().getName();
String instanceGroupName = resourcePropertyProvider().getName();
HostGroupType hostGroupTypeForRecipe = HostGroupType.WORKER;
testContext.given(recipeName, RecipeTestDto.class).withName(recipeName).withContent(RECIPE_CONTENT).withRecipeType(PRE_CLOUDERA_MANAGER_START).when(recipeTestClient.createV4(), RunningParameter.key(recipeName)).when(recipeTestClient.deleteV4(), RunningParameter.key(recipeName)).given(instanceGroupName, InstanceGroupTestDto.class).withHostGroup(hostGroupTypeForRecipe).withNodeCount(NODE_COUNT).withRecipes(recipeName).given(stackName, StackTestDto.class).replaceInstanceGroups(instanceGroupName).whenException(stackTestClient.createV4(), BadRequestException.class, expectedMessage(String.format("The given recipe does not exist" + " for the instance group \"%s\": %s", hostGroupTypeForRecipe.getName(), recipeName))).validate();
}
Aggregations