Search in sources :

Example 1 with EnvironmentNetworkMockParams

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

the class NetworkRequestToDtoConverterTest method createMockParams.

private EnvironmentNetworkMockParams createMockParams() {
    EnvironmentNetworkMockParams mockParams = new EnvironmentNetworkMockParams();
    mockParams.setInternetGatewayId("internet-gateway-id");
    mockParams.setVpcId(NETWORK_ID);
    return mockParams;
}
Also used : EnvironmentNetworkMockParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams)

Example 2 with EnvironmentNetworkMockParams

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

the class RedbeamsDatabaseServerTest method createRedbeamsDatabaseServerTest.

@Test(dataProvider = TEST_CONTEXT_WITH_MOCK)
@Description(given = "there is a prepared database", when = "when a database create request is sent with the same database name", then = "the create should return a BadRequestException")
public void createRedbeamsDatabaseServerTest(MockedTestContext testContext) {
    String databaseName = resourcePropertyProvider().getName();
    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.FALSE).withName(resourcePropertyProvider().getEnvironmentName()).when(getEnvironmentTestClient().create()).await(EnvironmentStatus.AVAILABLE).given(RedbeamsDatabaseServerTestDto.class).withName(databaseName).withClusterCrn(clusterCrn).when(redbeamsDatabaseServerTest.createV4()).await(Status.AVAILABLE).when(redbeamsDatabaseServerTest.deleteV4()).await(Status.DELETE_COMPLETED).validate();
}
Also used : EnvironmentNetworkTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentNetworkTestDto) EnvironmentTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto) EnvironmentNetworkMockParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams) RedbeamsDatabaseServerTestDto(com.sequenceiq.it.cloudbreak.dto.database.RedbeamsDatabaseServerTestDto) Description(com.sequenceiq.it.cloudbreak.context.Description) Test(org.testng.annotations.Test)

Example 3 with EnvironmentNetworkMockParams

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

the class MockSdxTests method testDefaultSDXCanBeCreatedThenDeletedSuccessfully.

@Test(dataProvider = TEST_CONTEXT_WITH_MOCK)
@Description(given = "there is a running Cloudbreak", when = "a valid SDX Internal Create request is sent", then = "SDX should be available AND deletable")
public void testDefaultSDXCanBeCreatedThenDeletedSuccessfully(MockedTestContext testContext) {
    String sdxInternal = 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(sdxInternal, SdxInternalTestDto.class).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 : EnvironmentNetworkTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentNetworkTestDto) EnvironmentTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto) SdxInternalTestDto(com.sequenceiq.it.cloudbreak.dto.sdx.SdxInternalTestDto) EnvironmentNetworkMockParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams) Description(com.sequenceiq.it.cloudbreak.context.Description) Test(org.testng.annotations.Test)

Example 4 with EnvironmentNetworkMockParams

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

the class MockSdxUpgradeTests method testSdxUpgradeAfterResize.

@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 testSdxUpgradeAfterResize(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()).withBackup("location/of/the/backup").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).when(sdxTestClient.resize(), key(sdxInternal)).await(SdxClusterStatusResponse.STOP_IN_PROGRESS, key(sdxInternal).withWaitForFlow(Boolean.FALSE)).await(SdxClusterStatusResponse.STACK_CREATION_IN_PROGRESS, key(sdxInternal).withWaitForFlow(Boolean.FALSE)).await(SdxClusterStatusResponse.RUNNING, key(sdxInternal).withWaitForFlow(Boolean.FALSE)).withClusterShape(SdxClusterShape.MEDIUM_DUTY_HA).then(SdxUpgradeTestAssertion.validateSuccessfulUpgrade()).validate();
}
Also used : EnvironmentNetworkTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentNetworkTestDto) EnvironmentTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto) EnvironmentNetworkMockParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams) ClusterTestDto(com.sequenceiq.it.cloudbreak.dto.ClusterTestDto) InstanceTemplateV4TestDto(com.sequenceiq.it.cloudbreak.dto.InstanceTemplateV4TestDto) InstanceGroupTestDto(com.sequenceiq.it.cloudbreak.dto.InstanceGroupTestDto) Description(com.sequenceiq.it.cloudbreak.context.Description) Test(org.testng.annotations.Test)

Example 5 with EnvironmentNetworkMockParams

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

the class NetworkV1ToNetworkV4ConverterTest method createEnvironmentNetworkMockParams.

private EnvironmentNetworkMockParams createEnvironmentNetworkMockParams() {
    EnvironmentNetworkMockParams mockParams = new EnvironmentNetworkMockParams();
    mockParams.setVpcId("someVpcId");
    mockParams.setInternetGatewayId("someInternetGatewayId");
    return mockParams;
}
Also used : EnvironmentNetworkMockParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams)

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