Search in sources :

Example 1 with VmType

use of com.sequenceiq.it.cloudbreak.newway.VmType in project cloudbreak by hortonworks.

the class VmTypeTests method testCountAzureVMTypesForCredentialInDefaultRegion.

@Test(priority = 1, groups = "vmtypes")
public void testCountAzureVMTypesForCredentialInDefaultRegion() throws Exception {
    AzureCloudProvider provider = new AzureCloudProvider(getTestParameter());
    given(CloudbreakClient.isCreated());
    given(provider.aValidCredential().withName(AZURE_CRED_NAME), "Azure credential is created");
    given(VmType.request().withPlatform(provider.getPlatform()).withRegion(provider.region()).withAvailabilityZone(provider.availabilityZone()), "Azure vm type request");
    when(VmType.getPlatformVmTypes(), "vm types are requested to Azure credential and " + provider.region() + " region.");
    then(VmType.assertThis((vmtype, t) -> {
        int regionVirtualMachinesCount = vmtype.getResponse().getVmTypes().get(provider.region()).getVirtualMachines().size();
        LOGGER.info("Number of Azure Virtual Machines in {} region ::: {}", provider.region(), regionVirtualMachinesCount);
        Assert.assertTrue(regionVirtualMachinesCount > 0, "Number of Azure Virtual Machines should be present in response" + " for default region!");
    }), "Azure Virtual Machines should be part of the response.");
}
Also used : CloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.CloudProvider) TestParameter(com.sequenceiq.it.cloudbreak.newway.TestParameter) Logger(org.slf4j.Logger) ForbiddenException(javax.ws.rs.ForbiddenException) CloudbreakClient(com.sequenceiq.it.cloudbreak.newway.CloudbreakClient) AwsCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.AwsCloudProvider) LoggerFactory(org.slf4j.LoggerFactory) Set(java.util.Set) Test(org.testng.annotations.Test) Credential(com.sequenceiq.it.cloudbreak.newway.Credential) GcpCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.GcpCloudProvider) VmType(com.sequenceiq.it.cloudbreak.newway.VmType) AfterTest(org.testng.annotations.AfterTest) Assert(org.testng.Assert) AzureCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.AzureCloudProvider) BadRequestException(javax.ws.rs.BadRequestException) CloudbreakTest(com.sequenceiq.it.cloudbreak.newway.CloudbreakTest) OpenstackCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.OpenstackCloudProvider) VmTypeJson(com.sequenceiq.cloudbreak.api.model.VmTypeJson) AzureCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.AzureCloudProvider) Test(org.testng.annotations.Test) AfterTest(org.testng.annotations.AfterTest) CloudbreakTest(com.sequenceiq.it.cloudbreak.newway.CloudbreakTest)

Example 2 with VmType

use of com.sequenceiq.it.cloudbreak.newway.VmType in project cloudbreak by hortonworks.

the class VmTypeTests method testListAzureVMTypesForCredentialInDefaultRegion.

@Test(priority = 5, groups = "vmtypes")
public void testListAzureVMTypesForCredentialInDefaultRegion() throws Exception {
    AzureCloudProvider provider = new AzureCloudProvider(getTestParameter());
    given(CloudbreakClient.isCreated());
    given(provider.aValidCredential().withName(AZURE_CRED_NAME), "Azure credential is created");
    given(VmType.request().withPlatform(provider.getPlatform()).withRegion(provider.region()).withAvailabilityZone(provider.availabilityZone()), "Azure vm type request");
    when(VmType.getPlatformVmTypes(), "vm types are requested to Azure credential and " + provider.region() + " region.");
    then(VmType.assertThis((vmtype, t) -> {
        Set<VmTypeJson> regionVirtualMachines = vmtype.getResponse().getVmTypes().get(provider.region()).getVirtualMachines();
        Assert.assertFalse(regionVirtualMachines.isEmpty(), "Azure Virtual Machines should be present in response for default region!");
    }), "Virtual Machines should be part of the response.");
}
Also used : CloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.CloudProvider) TestParameter(com.sequenceiq.it.cloudbreak.newway.TestParameter) Logger(org.slf4j.Logger) ForbiddenException(javax.ws.rs.ForbiddenException) CloudbreakClient(com.sequenceiq.it.cloudbreak.newway.CloudbreakClient) AwsCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.AwsCloudProvider) LoggerFactory(org.slf4j.LoggerFactory) Set(java.util.Set) Test(org.testng.annotations.Test) Credential(com.sequenceiq.it.cloudbreak.newway.Credential) GcpCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.GcpCloudProvider) VmType(com.sequenceiq.it.cloudbreak.newway.VmType) AfterTest(org.testng.annotations.AfterTest) Assert(org.testng.Assert) AzureCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.AzureCloudProvider) BadRequestException(javax.ws.rs.BadRequestException) CloudbreakTest(com.sequenceiq.it.cloudbreak.newway.CloudbreakTest) OpenstackCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.OpenstackCloudProvider) VmTypeJson(com.sequenceiq.cloudbreak.api.model.VmTypeJson) Set(java.util.Set) AzureCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.AzureCloudProvider) Test(org.testng.annotations.Test) AfterTest(org.testng.annotations.AfterTest) CloudbreakTest(com.sequenceiq.it.cloudbreak.newway.CloudbreakTest)

Example 3 with VmType

use of com.sequenceiq.it.cloudbreak.newway.VmType in project cloudbreak by hortonworks.

the class VmTypeTests method testAzureDefaultVMTypeForCredentialInDefaultRegion.

@Test(priority = 9, groups = "vmtypes")
public void testAzureDefaultVMTypeForCredentialInDefaultRegion() throws Exception {
    AzureCloudProvider provider = new AzureCloudProvider(getTestParameter());
    given(CloudbreakClient.isCreated());
    given(provider.aValidCredential().withName(AZURE_CRED_NAME), "Azure credential is created");
    given(VmType.request().withPlatform(provider.getPlatform()).withRegion(provider.region()).withAvailabilityZone(provider.availabilityZone()), "Azure vm type request");
    when(VmType.getPlatformVmTypes(), "vm types are requested to Azure credential and " + provider.region() + " region.");
    then(VmType.assertThis((vmtype, t) -> {
        String regionDefVirtualMachine = vmtype.getResponse().getVmTypes().get(provider.region()).getDefaultVirtualMachine().getValue();
        LOGGER.info("Azure Default Virtual Machine in {} region is ::: {}", provider.region(), regionDefVirtualMachine);
        Assert.assertNotNull(regionDefVirtualMachine, "Azure Default Virtual Machine should be present in response for default region!");
    }), "Default Virtual Machine should be part of the response.");
}
Also used : CloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.CloudProvider) TestParameter(com.sequenceiq.it.cloudbreak.newway.TestParameter) Logger(org.slf4j.Logger) ForbiddenException(javax.ws.rs.ForbiddenException) CloudbreakClient(com.sequenceiq.it.cloudbreak.newway.CloudbreakClient) AwsCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.AwsCloudProvider) LoggerFactory(org.slf4j.LoggerFactory) Set(java.util.Set) Test(org.testng.annotations.Test) Credential(com.sequenceiq.it.cloudbreak.newway.Credential) GcpCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.GcpCloudProvider) VmType(com.sequenceiq.it.cloudbreak.newway.VmType) AfterTest(org.testng.annotations.AfterTest) Assert(org.testng.Assert) AzureCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.AzureCloudProvider) BadRequestException(javax.ws.rs.BadRequestException) CloudbreakTest(com.sequenceiq.it.cloudbreak.newway.CloudbreakTest) OpenstackCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.OpenstackCloudProvider) VmTypeJson(com.sequenceiq.cloudbreak.api.model.VmTypeJson) AzureCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.AzureCloudProvider) Test(org.testng.annotations.Test) AfterTest(org.testng.annotations.AfterTest) CloudbreakTest(com.sequenceiq.it.cloudbreak.newway.CloudbreakTest)

Example 4 with VmType

use of com.sequenceiq.it.cloudbreak.newway.VmType in project cloudbreak by hortonworks.

the class VmTypeTests method testOSDefaultVMTypeSupport.

@Test(priority = 10, groups = "vmtypes")
public void testOSDefaultVMTypeSupport() throws Exception {
    OpenstackCloudProvider provider = new OpenstackCloudProvider(getTestParameter());
    given(CloudbreakClient.isCreated());
    given(provider.aValidCredential().withName(OS_CRED_NAME), "OpenStack credential is created");
    given(VmType.request().withPlatform(provider.getPlatform()).withRegion(provider.region()).withAvailabilityZone(provider.availabilityZone()), "OpenStack vm type request");
    when(VmType.getPlatformVmTypes(), "vm types are requested to OpenStack credential and " + provider.region() + " region.");
    then(VmType.assertThis((vmtype, t) -> {
        LOGGER.info("OpenStack Default Virtual Machine is not supported for OpenStack.");
        Assert.assertNull(vmtype.getResponse().getVmTypes().get(provider.availabilityZone()).getDefaultVirtualMachine(), "OpenStack Default Virtual Machine should not be present in response!");
    }), "OpenStack Default Virtual Machine should not be part of the response.");
}
Also used : CloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.CloudProvider) TestParameter(com.sequenceiq.it.cloudbreak.newway.TestParameter) Logger(org.slf4j.Logger) ForbiddenException(javax.ws.rs.ForbiddenException) CloudbreakClient(com.sequenceiq.it.cloudbreak.newway.CloudbreakClient) AwsCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.AwsCloudProvider) LoggerFactory(org.slf4j.LoggerFactory) Set(java.util.Set) Test(org.testng.annotations.Test) Credential(com.sequenceiq.it.cloudbreak.newway.Credential) GcpCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.GcpCloudProvider) VmType(com.sequenceiq.it.cloudbreak.newway.VmType) AfterTest(org.testng.annotations.AfterTest) Assert(org.testng.Assert) AzureCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.AzureCloudProvider) BadRequestException(javax.ws.rs.BadRequestException) CloudbreakTest(com.sequenceiq.it.cloudbreak.newway.CloudbreakTest) OpenstackCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.OpenstackCloudProvider) VmTypeJson(com.sequenceiq.cloudbreak.api.model.VmTypeJson) OpenstackCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.OpenstackCloudProvider) Test(org.testng.annotations.Test) AfterTest(org.testng.annotations.AfterTest) CloudbreakTest(com.sequenceiq.it.cloudbreak.newway.CloudbreakTest)

Aggregations

VmTypeJson (com.sequenceiq.cloudbreak.api.model.VmTypeJson)4 CloudbreakClient (com.sequenceiq.it.cloudbreak.newway.CloudbreakClient)4 CloudbreakTest (com.sequenceiq.it.cloudbreak.newway.CloudbreakTest)4 Credential (com.sequenceiq.it.cloudbreak.newway.Credential)4 TestParameter (com.sequenceiq.it.cloudbreak.newway.TestParameter)4 VmType (com.sequenceiq.it.cloudbreak.newway.VmType)4 AwsCloudProvider (com.sequenceiq.it.cloudbreak.newway.cloud.AwsCloudProvider)4 AzureCloudProvider (com.sequenceiq.it.cloudbreak.newway.cloud.AzureCloudProvider)4 CloudProvider (com.sequenceiq.it.cloudbreak.newway.cloud.CloudProvider)4 GcpCloudProvider (com.sequenceiq.it.cloudbreak.newway.cloud.GcpCloudProvider)4 OpenstackCloudProvider (com.sequenceiq.it.cloudbreak.newway.cloud.OpenstackCloudProvider)4 Set (java.util.Set)4 BadRequestException (javax.ws.rs.BadRequestException)4 ForbiddenException (javax.ws.rs.ForbiddenException)4 Logger (org.slf4j.Logger)4 LoggerFactory (org.slf4j.LoggerFactory)4 Assert (org.testng.Assert)4 AfterTest (org.testng.annotations.AfterTest)4 Test (org.testng.annotations.Test)4