Search in sources :

Example 1 with CloudProvider

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;
}
Also used : CloudProvider(com.sequenceiq.it.cloudbreak.cloud.v4.CloudProvider)

Example 2 with CloudProvider

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;
}
Also used : CloudProvider(com.sequenceiq.it.cloudbreak.cloud.v4.CloudProvider)

Example 3 with CloudProvider

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();
}
Also used : Ignore(org.testng.annotations.Ignore) CloudProvider(com.sequenceiq.it.cloudbreak.cloud.v4.CloudProvider) Logger(org.slf4j.Logger) TestContext(com.sequenceiq.it.cloudbreak.context.TestContext) DistroXImageTestDto(com.sequenceiq.it.cloudbreak.dto.distrox.image.DistroXImageTestDto) LoggerFactory(org.slf4j.LoggerFactory) InstanceStatus(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.InstanceStatus) Log(com.sequenceiq.it.cloudbreak.log.Log) RunningParameter.key(com.sequenceiq.it.cloudbreak.context.RunningParameter.key) HashMap(java.util.HashMap) Test(org.testng.annotations.Test) UseSpotInstances(com.sequenceiq.it.cloudbreak.util.spot.UseSpotInstances) AtomicReference(java.util.concurrent.atomic.AtomicReference) String.format(java.lang.String.format) DistroXTestDto(com.sequenceiq.it.cloudbreak.dto.distrox.DistroXTestDto) Description(com.sequenceiq.it.cloudbreak.context.Description) Inject(javax.inject.Inject) DistroXTestClient(com.sequenceiq.it.cloudbreak.client.DistroXTestClient) TestFailException(com.sequenceiq.it.cloudbreak.exception.TestFailException) Map(java.util.Map) HostGroupType(com.sequenceiq.it.cloudbreak.cloud.HostGroupType) AbstractE2ETest(com.sequenceiq.it.cloudbreak.testcase.e2e.AbstractE2ETest) ImageCatalogTestDto(com.sequenceiq.it.cloudbreak.dto.imagecatalog.ImageCatalogTestDto) DistroXImageTestDto(com.sequenceiq.it.cloudbreak.dto.distrox.image.DistroXImageTestDto) CloudProvider(com.sequenceiq.it.cloudbreak.cloud.v4.CloudProvider) ImageCatalogTestDto(com.sequenceiq.it.cloudbreak.dto.imagecatalog.ImageCatalogTestDto) TestFailException(com.sequenceiq.it.cloudbreak.exception.TestFailException) AtomicReference(java.util.concurrent.atomic.AtomicReference) Description(com.sequenceiq.it.cloudbreak.context.Description) Test(org.testng.annotations.Test) AbstractE2ETest(com.sequenceiq.it.cloudbreak.testcase.e2e.AbstractE2ETest) UseSpotInstances(com.sequenceiq.it.cloudbreak.util.spot.UseSpotInstances)

Example 4 with CloudProvider

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);
}
Also used : MeasuredTestContext(com.sequenceiq.it.cloudbreak.context.MeasuredTestContext) TestContext(com.sequenceiq.it.cloudbreak.context.TestContext) KibanaSearchUrl(com.sequenceiq.it.cloudbreak.search.KibanaSearchUrl) SearchUrl(com.sequenceiq.it.cloudbreak.search.SearchUrl) KibanaSearchUrl(com.sequenceiq.it.cloudbreak.search.KibanaSearchUrl) Searchable(com.sequenceiq.it.cloudbreak.search.Searchable) CloudProviderProxy(com.sequenceiq.it.cloudbreak.cloud.v4.CloudProviderProxy) Date(java.util.Date)

Aggregations

CloudProvider (com.sequenceiq.it.cloudbreak.cloud.v4.CloudProvider)3 TestContext (com.sequenceiq.it.cloudbreak.context.TestContext)2 InstanceStatus (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.InstanceStatus)1 DistroXTestClient (com.sequenceiq.it.cloudbreak.client.DistroXTestClient)1 HostGroupType (com.sequenceiq.it.cloudbreak.cloud.HostGroupType)1 CloudProviderProxy (com.sequenceiq.it.cloudbreak.cloud.v4.CloudProviderProxy)1 Description (com.sequenceiq.it.cloudbreak.context.Description)1 MeasuredTestContext (com.sequenceiq.it.cloudbreak.context.MeasuredTestContext)1 RunningParameter.key (com.sequenceiq.it.cloudbreak.context.RunningParameter.key)1 DistroXTestDto (com.sequenceiq.it.cloudbreak.dto.distrox.DistroXTestDto)1 DistroXImageTestDto (com.sequenceiq.it.cloudbreak.dto.distrox.image.DistroXImageTestDto)1 ImageCatalogTestDto (com.sequenceiq.it.cloudbreak.dto.imagecatalog.ImageCatalogTestDto)1 TestFailException (com.sequenceiq.it.cloudbreak.exception.TestFailException)1 Log (com.sequenceiq.it.cloudbreak.log.Log)1 KibanaSearchUrl (com.sequenceiq.it.cloudbreak.search.KibanaSearchUrl)1 SearchUrl (com.sequenceiq.it.cloudbreak.search.SearchUrl)1 Searchable (com.sequenceiq.it.cloudbreak.search.Searchable)1 AbstractE2ETest (com.sequenceiq.it.cloudbreak.testcase.e2e.AbstractE2ETest)1 UseSpotInstances (com.sequenceiq.it.cloudbreak.util.spot.UseSpotInstances)1 String.format (java.lang.String.format)1