Search in sources :

Example 11 with EnvironmentNetworkMockParams

use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams in project cloudbreak by hortonworks.

the class MockSdxTests method testSDXFromTemplateCanBeCreatedThenDeletedSuccessfully.

@Test(dataProvider = TEST_CONTEXT_WITH_MOCK)
@Description(given = "there is a running Cloudbreak", when = "a valid SDX Internal Create request is sent with Cluster Template", then = "SDX should be available AND deletable")
public void testSDXFromTemplateCanBeCreatedThenDeletedSuccessfully(MockedTestContext testContext) throws IOException {
    String sdxInternal = resourcePropertyProvider().getName();
    String networkKey = "someOtherNetwork";
    JSONObject jsonObject = ResourceUtil.readResourceAsJson(applicationContext, TEMPLATE_JSON);
    testContext.given(networkKey, EnvironmentNetworkTestDto.class).withMock(new EnvironmentNetworkMockParams()).given(EnvironmentTestDto.class).withNetwork(networkKey).withCreateFreeIpa(Boolean.FALSE).withName(resourcePropertyProvider().getEnvironmentName()).when(getEnvironmentTestClient().create()).await(EnvironmentStatus.AVAILABLE).given(sdxInternal, SdxInternalTestDto.class).withTemplate(jsonObject).when(sdxTestClient.createInternal(), key(sdxInternal)).await(SdxClusterStatusResponse.RUNNING, key(sdxInternal)).then((tc, testDto, client) -> sdxTestClient.deleteInternal().action(tc, testDto, client)).await(SdxClusterStatusResponse.DELETED, key(sdxInternal)).validate();
}
Also used : JSONObject(org.json.JSONObject) EnvironmentNetworkMockParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams) Description(com.sequenceiq.it.cloudbreak.context.Description) Test(org.testng.annotations.Test)

Example 12 with EnvironmentNetworkMockParams

use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams in project cloudbreak by hortonworks.

the class MockSdxTests method testSDXCreateWithInvalidCustomInstanceTypesShouldFail.

@Test(dataProvider = TEST_CONTEXT_WITH_MOCK)
@Description(given = "there is a running Cloudbreak", when = "an invalid SDX Create request is sent with wrong custom instance type", then = "SDX create should be failed")
public void testSDXCreateWithInvalidCustomInstanceTypesShouldFail(MockedTestContext testContext) {
    String sdx = resourcePropertyProvider().getName();
    String networkKey = "someNetwork";
    testContext.given(networkKey, EnvironmentNetworkTestDto.class).withMock(new EnvironmentNetworkMockParams()).given(EnvironmentTestDto.class).withNetwork(networkKey).withCreateFreeIpa(Boolean.FALSE).withName(resourcePropertyProvider().getEnvironmentName()).when(getEnvironmentTestClient().create()).await(EnvironmentStatus.AVAILABLE).given(sdx, SdxTestDto.class).withCustomInstanceGroup("master", "small").when(sdxTestClient.create(), key(sdx)).await(SdxClusterStatusResponse.PROVISIONING_FAILED, key(sdx).withWaitForFlowFail()).then(this::validateSdxStatusReason).validate();
}
Also used : EnvironmentNetworkTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentNetworkTestDto) EnvironmentTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto) SdxTestDto(com.sequenceiq.it.cloudbreak.dto.sdx.SdxTestDto) EnvironmentNetworkMockParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams) Description(com.sequenceiq.it.cloudbreak.context.Description) Test(org.testng.annotations.Test)

Example 13 with EnvironmentNetworkMockParams

use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams in project cloudbreak by hortonworks.

the class MockSdxUpgradeTests method testSdxUpgradeWhenNoAttachedDisksButEmbeddedDBShouldHaveBeenOnSelfConfiguredAttachedDisk.

@Test(dataProvider = TEST_CONTEXT_WITH_MOCK)
@Description(given = "there is a running Cloudbreak", when = "start an sdx cluster without attached disk on gateway, but disk attachment is supported on cloud provider side", then = "Upgrade option should be presented")
public void testSdxUpgradeWhenNoAttachedDisksButEmbeddedDBShouldHaveBeenOnSelfConfiguredAttachedDisk(MockedTestContext testContext) {
    String upgradeImageCatalogName = resourcePropertyProvider().getName();
    createImageCatalogForOsUpgrade(testContext, upgradeImageCatalogName);
    String sdxInternal = resourcePropertyProvider().getName();
    String stack = resourcePropertyProvider().getName();
    String cluster = "cmcluster";
    String imageSettings = "imageSettingsUpgrade";
    String networkKey = "someOtherNetwork";
    testContext.given(networkKey, EnvironmentNetworkTestDto.class).withMock(new EnvironmentNetworkMockParams()).given(EnvironmentTestDto.class).withNetwork(networkKey).withCreateFreeIpa(Boolean.TRUE).withName(resourcePropertyProvider().getEnvironmentName()).when(getEnvironmentTestClient().create()).await(EnvironmentStatus.AVAILABLE).given(FreeIpaTestDto.class).when(freeIpaTestClient.create()).await(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.Status.AVAILABLE).given(cluster, ClusterTestDto.class).given(imageSettings, ImageSettingsTestDto.class).withImageId("aaa778fc-7f17-4535-9021-515351df3691").withImageCatalog(upgradeImageCatalogName).given("NoAttachedDisksTemplate", InstanceTemplateV4TestDto.class).withAttachedVolume(testContext.init(VolumeV4TestDto.class).withCount(0)).given("InstanceGroupWithoutAttachedDisk", InstanceGroupTestDto.class).withHostGroup(HostGroupType.MASTER).withTemplate("NoAttachedDisksTemplate").given(stack, StackTestDto.class).withCluster(cluster).withImageSettings(imageSettings).replaceInstanceGroups("InstanceGroupWithoutAttachedDisk").given(sdxInternal, SdxInternalTestDto.class).withStackRequest(key(cluster), key(stack)).when(sdxTestClient.createInternal(), key(sdxInternal)).await(SdxClusterStatusResponse.RUNNING).then(SdxUpgradeTestAssertion.validateSuccessfulUpgrade()).validate();
}
Also used : EnvironmentNetworkTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentNetworkTestDto) EnvironmentTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto) StackTestDto(com.sequenceiq.it.cloudbreak.dto.stack.StackTestDto) ImageSettingsTestDto(com.sequenceiq.it.cloudbreak.dto.ImageSettingsTestDto) SdxInternalTestDto(com.sequenceiq.it.cloudbreak.dto.sdx.SdxInternalTestDto) EnvironmentNetworkMockParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams) FreeIpaTestDto(com.sequenceiq.it.cloudbreak.dto.freeipa.FreeIpaTestDto) VolumeV4TestDto(com.sequenceiq.it.cloudbreak.dto.VolumeV4TestDto) Description(com.sequenceiq.it.cloudbreak.context.Description) Test(org.testng.annotations.Test)

Example 14 with EnvironmentNetworkMockParams

use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams 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();
}
Also used : EnvironmentNetworkTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentNetworkTestDto) EnvironmentTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto) DistroXTestDto(com.sequenceiq.it.cloudbreak.dto.distrox.DistroXTestDto) SdxInternalTestDto(com.sequenceiq.it.cloudbreak.dto.sdx.SdxInternalTestDto) EnvironmentNetworkMockParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams) DistroXNetworkTestDto(com.sequenceiq.it.cloudbreak.dto.distrox.instancegroup.DistroXNetworkTestDto) DistroXClouderaManagerTestDto(com.sequenceiq.it.cloudbreak.dto.distrox.cluster.clouderamanager.DistroXClouderaManagerTestDto) FreeIpaTestDto(com.sequenceiq.it.cloudbreak.dto.freeipa.FreeIpaTestDto) Description(com.sequenceiq.it.cloudbreak.context.Description) AbstractClouderaManagerTest(com.sequenceiq.it.cloudbreak.testcase.mock.clouderamanager.AbstractClouderaManagerTest) Test(org.testng.annotations.Test)

Example 15 with EnvironmentNetworkMockParams

use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams in project cloudbreak by hortonworks.

the class MockSdxUpgradeTests method testSdxUpgradeSuccessfulWhenExternalDatabaseIsUsed.

@Test(dataProvider = TEST_CONTEXT_WITH_MOCK)
@Description(given = "there is a running CloudSdxInternalTestDtobreak", when = "start an sdx cluster with external database", then = "Upgrade option should be presented")
public void testSdxUpgradeSuccessfulWhenExternalDatabaseIsUsed(MockedTestContext testContext) {
    String upgradeImageCatalogName = resourcePropertyProvider().getName();
    createImageCatalogForOsUpgrade(testContext, upgradeImageCatalogName);
    String sdxInternal = resourcePropertyProvider().getName();
    String stack = resourcePropertyProvider().getName();
    String clouderaManager = "cm";
    String cluster = "cmcluster";
    String imageSettings = "imageSettingsUpgrade";
    String networkKey = "someOtherNetwork";
    String clusterCrn = TestCrnGenerator.getDatalakeCrn(UUID.randomUUID().toString(), "cloudera");
    testContext.given(networkKey, EnvironmentNetworkTestDto.class).withMock(new EnvironmentNetworkMockParams()).given(EnvironmentTestDto.class).withNetwork(networkKey).withCreateFreeIpa(Boolean.TRUE).withName(resourcePropertyProvider().getEnvironmentName()).when(getEnvironmentTestClient().create()).await(EnvironmentStatus.AVAILABLE).given(FreeIpaTestDto.class).when(freeIpaTestClient.create()).await(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.Status.AVAILABLE).given(RedbeamsDatabaseServerTestDto.class).withEnvironmentCrn(testContext.get(EnvironmentTestDto.class).getResponse().getCrn()).withClusterCrn(clusterCrn).when(redbeamsDatabaseServerTestClient.createV4()).await(Status.AVAILABLE).given(clouderaManager, ClouderaManagerTestDto.class).given(cluster, ClusterTestDto.class).withClouderaManager(clouderaManager).withExternalDatabaseCrn().given(imageSettings, ImageSettingsTestDto.class).withImageId("aaa778fc-7f17-4535-9021-515351df3691").withImageCatalog(upgradeImageCatalogName).given(stack, StackTestDto.class).withCluster(cluster).withImageSettings(imageSettings).given(sdxInternal, SdxInternalTestDto.class).withStackRequest(key(cluster), key(stack)).when(sdxTestClient.createInternal(), key(sdxInternal)).await(SdxClusterStatusResponse.RUNNING).then(SdxUpgradeTestAssertion.validateSuccessfulUpgrade()).validate();
}
Also used : EnvironmentNetworkTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentNetworkTestDto) EnvironmentTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto) ImageSettingsTestDto(com.sequenceiq.it.cloudbreak.dto.ImageSettingsTestDto) SdxInternalTestDto(com.sequenceiq.it.cloudbreak.dto.sdx.SdxInternalTestDto) EnvironmentNetworkMockParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams) ClouderaManagerTestDto(com.sequenceiq.it.cloudbreak.dto.ClouderaManagerTestDto) FreeIpaTestDto(com.sequenceiq.it.cloudbreak.dto.freeipa.FreeIpaTestDto) Description(com.sequenceiq.it.cloudbreak.context.Description) Test(org.testng.annotations.Test)

Aggregations

EnvironmentNetworkMockParams (com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams)15 Description (com.sequenceiq.it.cloudbreak.context.Description)10 Test (org.testng.annotations.Test)10 EnvironmentNetworkTestDto (com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentNetworkTestDto)9 EnvironmentTestDto (com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto)9 SdxInternalTestDto (com.sequenceiq.it.cloudbreak.dto.sdx.SdxInternalTestDto)6 FreeIpaTestDto (com.sequenceiq.it.cloudbreak.dto.freeipa.FreeIpaTestDto)4 CustomDomainSettingsV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.customdomain.CustomDomainSettingsV4Request)2 HostGroupType (com.sequenceiq.it.cloudbreak.cloud.HostGroupType)2 ImageSettingsTestDto (com.sequenceiq.it.cloudbreak.dto.ImageSettingsTestDto)2 SdxDatabaseRequest (com.sequenceiq.sdx.api.model.SdxDatabaseRequest)2 ArrayList (java.util.ArrayList)2 EnvironmentStatus (com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentStatus)1 FreeIpaTestClient (com.sequenceiq.it.cloudbreak.client.FreeIpaTestClient)1 SdxTestClient (com.sequenceiq.it.cloudbreak.client.SdxTestClient)1 IDBROKER (com.sequenceiq.it.cloudbreak.cloud.HostGroupType.IDBROKER)1 MASTER (com.sequenceiq.it.cloudbreak.cloud.HostGroupType.MASTER)1 MockedTestContext (com.sequenceiq.it.cloudbreak.context.MockedTestContext)1 RunningParameter.key (com.sequenceiq.it.cloudbreak.context.RunningParameter.key)1 RunningParameter.pollingInterval (com.sequenceiq.it.cloudbreak.context.RunningParameter.pollingInterval)1