use of com.sequenceiq.it.cloudbreak.cloud.v4.CloudProvider in project cloudbreak by hortonworks.
the class DistroXInstanceGroupsBuilder method withDiskEncryption.
public DistroXInstanceGroupsBuilder withDiskEncryption() {
CloudProvider cloudProvider = testContext.getCloudProvider();
getInstanceTemplates().forEach(cloudProvider::setInstanceTemplateV1Parameters);
return this;
}
use of com.sequenceiq.it.cloudbreak.cloud.v4.CloudProvider in project cloudbreak by hortonworks.
the class DistroXInstanceGroupsBuilder method withStorageOptimizedInstancetype.
public DistroXInstanceGroupsBuilder withStorageOptimizedInstancetype() {
CloudProvider cloudProvider = testContext.getCloudProvider();
getInstanceTemplates().forEach(template -> template.setInstanceType(cloudProvider.getStorageOptimizedInstanceType()));
return this;
}
use of com.sequenceiq.it.cloudbreak.cloud.v4.CloudProvider in project cloudbreak by hortonworks.
the class DistroXImagesTests method testDistroXWithBaseImageCanBeCreatedSuccessfully.
@Test(dataProvider = TEST_CONTEXT)
@UseSpotInstances
@Description(given = "there is a running cloudbreak", when = "a valid DistroX create request is sent (latest Base Image)", then = "DistroX should be available and deletable")
public void testDistroXWithBaseImageCanBeCreatedSuccessfully(TestContext testContext) {
String imageSettings = resourcePropertyProvider().getName();
String imageCatalog = resourcePropertyProvider().getName();
String distrox = resourcePropertyProvider().getName();
AtomicReference<String> selectedImageID = new AtomicReference<>();
CloudProvider cloudProvider = testContext.getCloudProvider();
testContext.given(imageCatalog, ImageCatalogTestDto.class).when((tc, dto, client) -> {
selectedImageID.set(cloudProvider.getLatestBaseImageID(tc, dto, client));
return dto;
}).given(imageSettings, DistroXImageTestDto.class).withImageCatalog(cloudProvider.getImageCatalogName()).withImageId(selectedImageID.get()).given(distrox, DistroXTestDto.class).withImageSettings(imageSettings).when(distroXTestClient.create(), key(distrox)).await(STACK_AVAILABLE).awaitForHealthyInstances().then((tc, dto, client) -> {
Log.log(LOGGER, format(" Image Catalog Name: %s ", dto.getResponse().getImage().getCatalogName()));
Log.log(LOGGER, format(" Image Catalog URL: %s ", dto.getResponse().getImage().getCatalogUrl()));
Log.log(LOGGER, format(" Image ID: %s ", dto.getResponse().getImage().getId()));
if (!dto.getResponse().getImage().getId().equals(selectedImageID.get())) {
throw new TestFailException(" The selected image ID is: " + dto.getResponse().getImage().getId() + " instead of: " + selectedImageID.get());
}
return dto;
}).validate();
}
use of com.sequenceiq.it.cloudbreak.cloud.v4.CloudProvider in project cloudbreak by hortonworks.
the class ReportListener method logUrl.
private void logUrl(ITestResult tr) {
TestContext testContext;
Object[] parameters = tr.getParameters();
if (parameters == null || parameters.length == 0) {
return;
}
try {
testContext = (TestContext) parameters[0];
} catch (ClassCastException e) {
return;
}
Iterable<Searchable> searchables = Iterables.filter(testContext.getResourceNames().values(), Searchable.class);
List<Searchable> listOfSearchables = StreamSupport.stream(searchables.spliterator(), false).collect(Collectors.toList());
if (listOfSearchables.size() == 0) {
return;
}
SearchUrl searchUrl = new KibanaSearchUrl();
tr.getTestContext().setAttribute(tr.getName() + SEARCH_URL, searchUrl.getSearchUrl(listOfSearchables, new Date(tr.getStartMillis()), new Date(tr.getEndMillis())));
String baseLocation = getCloudStorageBaseLocation(testContext);
CloudProviderProxy cloudProvider = testContext.getCloudProvider();
generateClusterLogsUrl(FreeIpaTestDto.class, tr, testContext.getResourceNames(), testContext.getResourceCrns(), baseLocation, cloudProvider);
generateClusterLogsUrl(SdxTestDto.class, tr, testContext.getResourceNames(), testContext.getResourceCrns(), baseLocation, cloudProvider);
generateClusterLogsUrl(SdxInternalTestDto.class, tr, testContext.getResourceNames(), testContext.getResourceCrns(), baseLocation, cloudProvider);
generateClusterLogsUrl(DistroXTestDto.class, tr, testContext.getResourceNames(), testContext.getResourceCrns(), baseLocation, cloudProvider);
}
Aggregations