use of com.sequenceiq.sdx.api.model.SdxDatabaseRequest 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.sdx.api.model.SdxDatabaseRequest 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.sdx.api.model.SdxDatabaseRequest in project cloudbreak by hortonworks.
the class AbstractIntegrationTest method createDatalakeWithoutDatabase.
protected void createDatalakeWithoutDatabase(TestContext testContext) {
SdxDatabaseRequest database = new SdxDatabaseRequest();
database.setCreate(false);
testContext.given(SdxInternalTestDto.class).withDatabase(database).withCloudStorage(getCloudStorageRequest(testContext)).when(sdxTestClient.createInternal()).await(SdxClusterStatusResponse.RUNNING).awaitForHealthyInstances().when(sdxTestClient.describeInternal()).validate();
}
use of com.sequenceiq.sdx.api.model.SdxDatabaseRequest in project cloudbreak by hortonworks.
the class DistroXUpgradeTests method testDistroXUpgrades.
@Test(dataProvider = TEST_CONTEXT)
@UseSpotInstances
@Description(given = "there is a running Cloudbreak, and an environment with SDX and two DistroX clusters in " + "available state, one cluster created with deafult catalog and one cluster created with production catalog", when = "upgrade called on both DistroX clusters", then = "Both DistroX upgrade should be successful," + " the clusters should be up and running")
public void testDistroXUpgrades(TestContext testContext) {
String imageSettings = resourcePropertyProvider().getName();
String currentRuntimeVersion = commonClusterManagerProperties.getUpgrade().getDistroXUpgradeCurrentVersion();
String targetRuntimeVersion = commonClusterManagerProperties.getUpgrade().getDistroXUpgradeTargetVersion();
String currentRuntimeVersion3rdParty = commonClusterManagerProperties.getUpgrade().getDistroXUpgrade3rdPartyCurrentVersion();
String targetRuntimeVersion3rdParty = commonClusterManagerProperties.getUpgrade().getDistroXUpgrade3rdPartyTargetVersion();
String sdxName = resourcePropertyProvider().getName();
String distroXName = resourcePropertyProvider().getName();
String distroX3rdPartyName = resourcePropertyProvider().getName();
String thirdPartyCatalogName = resourcePropertyProvider().getName();
AtomicReference<String> uuid = new AtomicReference<>();
SdxDatabaseRequest sdxDatabaseRequest = new SdxDatabaseRequest();
sdxDatabaseRequest.setAvailabilityType(SdxDatabaseAvailabilityType.NONE);
testContext.given(sdxName, SdxTestDto.class).withRuntimeVersion(currentRuntimeVersion).withCloudStorage(getCloudStorageRequest(testContext)).withExternalDatabase(sdxDatabaseRequest).when(sdxTestClient.create(), key(sdxName)).await(SdxClusterStatusResponse.RUNNING, key(sdxName)).awaitForHealthyInstances().validate();
testContext.given(distroXName, DistroXTestDto.class).withTemplate(String.format(commonClusterManagerProperties.getInternalDistroXBlueprintType(), currentRuntimeVersion)).withPreferredSubnetsForInstanceNetworkIfMultiAzEnabledOrJustFirst().when(distroXTestClient.create(), key(distroXName)).validate();
createImageValidationSourceCatalog(testContext, commonClusterManagerProperties.getUpgrade().getImageCatalogUrl3rdParty(), thirdPartyCatalogName);
uuid.set(getUuid(testContext, thirdPartyCatalogName, currentRuntimeVersion3rdParty));
testContext.given(imageSettings, DistroXImageTestDto.class).withImageCatalog(thirdPartyCatalogName).withImageId(uuid.get()).given(distroX3rdPartyName, DistroXTestDto.class).withTemplate(String.format(commonClusterManagerProperties.getInternalDistroXBlueprintType(), currentRuntimeVersion3rdParty)).withPreferredSubnetsForInstanceNetworkIfMultiAzEnabledOrJustFirst().withImageSettings(imageSettings).when(distroXTestClient.create(), key(distroX3rdPartyName)).await(STACK_AVAILABLE, key(distroX3rdPartyName)).awaitForHealthyInstances().then((tc, testDto, client) -> checkImageId(testDto, uuid.get())).given(distroXName, DistroXTestDto.class).await(STACK_AVAILABLE, key(distroXName)).awaitForHealthyInstances().then(new AwsAvailabilityZoneAssertion()).validate();
testContext.given(DistroXUpgradeTestDto.class).withRuntime(targetRuntimeVersion).given(distroXName, DistroXTestDto.class).when(distroXTestClient.upgrade(), key(distroXName)).given(DistroXUpgradeTestDto.class).withRuntime(targetRuntimeVersion3rdParty).given(distroX3rdPartyName, DistroXTestDto.class).when(distroXTestClient.upgrade(), key(distroX3rdPartyName)).await(STACK_AVAILABLE, key(distroX3rdPartyName)).awaitForHealthyInstances().given(distroXName, DistroXTestDto.class).await(STACK_AVAILABLE, key(distroXName)).awaitForHealthyInstances().then(new AwsAvailabilityZoneAssertion()).validate();
}
Aggregations