diff --git a/test/integration/component/test_base_image_updation.py b/test/integration/component/test_base_image_updation.py index c3ab5959c33..7c52e428585 100644 --- a/test/integration/component/test_base_image_updation.py +++ b/test/integration/component/test_base_image_updation.py @@ -28,7 +28,7 @@ from marvin.codes import (PASS, RECURRING) from nose.plugins.attrib import attr -from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.cloudstackTestCase import cloudstackTestCase, unittest from marvin.lib.base import (ServiceOffering, Account, @@ -529,8 +529,8 @@ class TestBaseImageUpdate(cloudstackTestCase): 2) The recurring snapshot rule should be deleted """ cls.hypervisor = cls.testClient.getHypervisorInfo() - if self.hypervisor.lower() in ['lxc']: - raise self.SkipTest("Template creation from root volume is not supported in LXC") + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("Template creation from root volume is not supported in LXC") vms = VirtualMachine.list( self.apiclient, id=self.vm_with_reset.id, diff --git a/test/integration/component/test_dynamic_compute_offering.py b/test/integration/component/test_dynamic_compute_offering.py index ce6c4cd5868..9d7fd9ba428 100644 --- a/test/integration/component/test_dynamic_compute_offering.py +++ b/test/integration/component/test_dynamic_compute_offering.py @@ -62,9 +62,9 @@ class TestDynamicServiceOffering(cloudstackTestCase): cls.domain = get_domain(cls.apiclient) cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests()) cls.services['mode'] = cls.zone.networktype - self.hypervisor = self.testClient.getHypervisorInfo() - if self.hypervisor.lower() in ['lxc']: - self.skipTest("dynamic scaling feature is not supported on %s" % self.hypervisor.lower()) + cls.hypervisor = self.testClient.getHypervisorInfo() + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("dynamic scaling feature is not supported on %s" % cls.hypervisor.lower()) cls.template = get_template( cls.apiclient, @@ -484,7 +484,7 @@ class TestScaleVmDynamicServiceOffering(cloudstackTestCase): TestScaleVmDynamicServiceOffering, cls).getClsTestClient() cls.api_client = cloudstackTestClient.getApiClient() - self.hypervisor = self.testClient.getHypervisorInfo() + cls.hypervisor = cls.testClient.getHypervisorInfo() # Fill services from the external config file cls.services = cloudstackTestClient.getParsedTestDataConfig() @@ -1162,7 +1162,7 @@ class TestScaleVmDynamicServiceOffering(cloudstackTestCase): # 3. Scale operation in step 6 should fail hypervisor = get_hypervisor_type(self.apiclient) - if hypervisor.lower() in ["kvm", "hyperv"]: + if hypervisor.lower() in ["kvm", "hyperv", "lxc"]: self.skipTest( "Scaling VM in running state is not supported on %s" % hypervisor) @@ -1262,9 +1262,9 @@ class TestAccountLimits(cloudstackTestCase): # Fill services from the external config file cls.services = cloudstackTestClient.getParsedTestDataConfig() - self.hypervisor = self.testClient.getHypervisorInfo() - if self.hypervisor.lower() in ['lxc']: - self.skipTest("dynamic scaling feature is not supported on %s" % self.hypervisor.lower()) + cls.hypervisor = self.testClient.getHypervisorInfo() + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("dynamic scaling feature is not supported on %s" % cls.hypervisor.lower()) # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client) @@ -1602,9 +1602,9 @@ class TestAffinityGroup(cloudstackTestCase): # Fill services from the external config file cls.services = cloudstackTestClient.getParsedTestDataConfig() - self.hypervisor = self.testClient.getHypervisorInfo() - if self.hypervisor.lower() in ['lxc']: - self.skipTest("migrate VM feature is not supported on %s" % self.hypervisor.lower()) + cls.hypervisor = self.testClient.getHypervisorInfo() + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("dynamic scaling feature is not supported on %s" % cls.hypervisor.lower()) # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client) diff --git a/test/integration/component/test_escalations_instances.py b/test/integration/component/test_escalations_instances.py index ddae15412b6..5dfc7c6eb87 100644 --- a/test/integration/component/test_escalations_instances.py +++ b/test/integration/component/test_escalations_instances.py @@ -34,7 +34,8 @@ from marvin.lib.base import (Account, Zone) from marvin.lib.common import (get_zone, get_template, - get_domain) + get_domain, + find_storage_pool_type) from marvin.codes import PASS from nose.plugins.attrib import attr @@ -1777,7 +1778,7 @@ class TestListInstances(cloudstackTestCase): Step16: Verifying that VM deployed in step1 has only 1 nic """ if self.hypervisor.lower() in ['hyperv']: - raise unittest.SkipTest( + self.skipTest( "This feature is not supported on existing hypervisor.\ Hence, skipping the test") @@ -2208,8 +2209,8 @@ class TestInstances(cloudstackTestCase): Step10: Detaching the ISO attached in step8 Step11: Verifying that detached ISO details are not associated with VM """ - if self.hypervisor.lower() in ['kvm', 'hyperv']: - raise unittest.SkipTest( + if self.hypervisor.lower() in ['kvm', 'hyperv', 'lxc']: + self.skipTest( "This feature is not supported on existing hypervisor. Hence,\ skipping the test") # Listing all the VM's for a User @@ -2352,8 +2353,8 @@ class TestInstances(cloudstackTestCase): Step12: Listing all the VM snapshots in Page 2 with page size Step13: Verifying that size of the list is 0 """ - if self.hypervisor.lower() in ['kvm', 'hyperv']: - raise unittest.SkipTest( + if self.hypervisor.lower() in ['kvm', 'hyperv', 'lxc']: + self.skipTest( "This feature is not supported on existing hypervisor. Hence,\ skipping the test") # Listing all the VM's for a User @@ -2514,8 +2515,8 @@ class TestInstances(cloudstackTestCase): Step11: Verifying that the VM Snapshot with current flag set to true is the reverted snapshot in Step 8 """ - if self.hypervisor.lower() in ['kvm', 'hyperv']: - raise unittest.SkipTest( + if self.hypervisor.lower() in ['kvm', 'hyperv', 'lxc']: + self.skipTest( "This feature is not supported on existing hypervisor.\ Hence, skipping the test") # Listing all the VM's for a User @@ -2684,6 +2685,10 @@ class TestInstances(cloudstackTestCase): Step13: Listing all the Volumes in Page 2 Step14: Verifying that list size is 0 """ + self.hypervisor = self.testClient.getHypervisorInfo() + if self.hypervisor.lower() == 'lxc': + if not find_storage_pool_type(cls.api_client, storagetype='rbd'): + self.skipTest("RBD storage type is required for data volumes for LXC") # Listing all the VM's for a User list_vms_before = VirtualMachine.list( self.userapiclient, @@ -2904,7 +2909,7 @@ class TestInstances(cloudstackTestCase): Step6: Verifying that VM's service offerings is changed """ if self.hypervisor.lower() == 'kvm': - raise unittest.SkipTest( + self.skipTest( "ScaleVM is not supported on KVM. Hence, skipping the test") # Checking if Dynamic scaling of VM is supported or not list_config = Configurations.list( diff --git a/test/integration/component/test_escalations_ipaddresses.py b/test/integration/component/test_escalations_ipaddresses.py index 41e5b2f80c0..c60c5b6f85c 100644 --- a/test/integration/component/test_escalations_ipaddresses.py +++ b/test/integration/component/test_escalations_ipaddresses.py @@ -522,7 +522,7 @@ class TestIpAddresses(cloudstackTestCase): Step9: Verifying the details of the Listed IP Address """ if self.hypervisor.lower() in ['hyperv']: - raise unittest.SkipTest("This feature is not supported on existing hypervisor. Hence, skipping the test") + self.skipTest("This feature is not supported on existing hypervisor. Hence, skipping the test") # Listing all the vpc's for a user list_vpc_before = VPC.list(self.userapiclient) # Verifying No VPCs are listed @@ -857,7 +857,7 @@ class TestIpAddresses(cloudstackTestCase): Step11: Verifying that no Load Balancer Rules are listed """ if self.hypervisor.lower() in ['hyperv']: - raise unittest.SkipTest("This feature is not supported on existing hypervisor. Hence, skipping the test") + self.skipTest("This feature is not supported on existing hypervisor. Hence, skipping the test") # Listing all the vpc's for a user list_vpc_before = VPC.list(self.userapiclient) # Verifying No VPCs are listed @@ -3035,7 +3035,7 @@ class TestIpAddresses(cloudstackTestCase): Step8: Verifying that StaticNat is disabled """ if self.hypervisor.lower() in ['hyperv']: - raise unittest.SkipTest("This feature is not supported on existing hypervisor. Hence, skipping the test") + self.skipTest("This feature is not supported on existing hypervisor. Hence, skipping the test") # Listing all the vpc's for a user list_vpc_before = VPC.list(self.userapiclient) # Verifying No VPCs are listed @@ -3454,7 +3454,7 @@ class TestIpAddresses(cloudstackTestCase): Step18: Verifying Autoscale policy is updated with condition2 """ if self.hypervisor.lower() == 'kvm': - raise unittest.SkipTest( + self.skipTest( "ScaleVM is not supported on KVM. Hence, skipping the test") list_physical_networks = PhysicalNetwork.list( @@ -3733,7 +3733,7 @@ class TestIpAddresses(cloudstackTestCase): Step16: Verifying that Autoscale VM is updated """ if self.hypervisor.lower() == 'kvm': - raise unittest.SkipTest( + self.skipTest( "ScaleVM is not supported on KVM. Hence, skipping the test") list_physical_networks = PhysicalNetwork.list( @@ -4060,7 +4060,7 @@ class TestIpAddresses(cloudstackTestCase): Step14: Enabling Autoscale VM group and verifying it was enabled """ if self.hypervisor.lower() == 'kvm': - raise unittest.SkipTest( + self.skipTest( "ScaleVM is not supported on KVM. Hence, skipping the test") list_physical_networks = PhysicalNetwork.list( diff --git a/test/integration/component/test_escalations_volumes.py b/test/integration/component/test_escalations_volumes.py index 4912e741f4a..fe9d5e1da8d 100644 --- a/test/integration/component/test_escalations_volumes.py +++ b/test/integration/component/test_escalations_volumes.py @@ -30,7 +30,8 @@ from marvin.lib.base import (Account, SnapshotPolicy) from marvin.lib.common import (get_domain, get_zone, - get_template) + get_template, + find_storage_pool_type) from nose.plugins.attrib import attr from marvin.codes import PASS diff --git a/test/integration/component/test_project_limits.py b/test/integration/component/test_project_limits.py index e3aacd37cbd..6edcf200509 100644 --- a/test/integration/component/test_project_limits.py +++ b/test/integration/component/test_project_limits.py @@ -18,7 +18,7 @@ """ #Import Local Modules from nose.plugins.attrib import attr -from marvin.cloudstackTestCase import cloudstackTestCase,unittest +from marvin.cloudstackTestCase import cloudstackTestCase, unittest #from marvin.cloudstackAPI import * from marvin.lib.utils import (cleanup_resources, validateList) @@ -837,7 +837,7 @@ class TestResourceLimitsProject(cloudstackTestCase): if self.hypervisor.lower() == 'lxc': if not find_storage_pool_type(self.apiclient, storagetype='rbd'): - self.SkipTest("RBD storage type is required for data volumes for LXC") + self.skipTest("RBD storage type is required for data volumes for LXC") self.project_1 = Project.create( self.api_client, self.services["project"], diff --git a/test/integration/component/test_project_usage.py b/test/integration/component/test_project_usage.py index f74b6aaaf24..f4688a2b74f 100644 --- a/test/integration/component/test_project_usage.py +++ b/test/integration/component/test_project_usage.py @@ -40,7 +40,8 @@ from marvin.lib.common import (get_domain, get_zone, get_template, list_volumes, - get_builtin_template_info) + get_builtin_template_info, + find_storage_pool_type) import time class Services: diff --git a/test/integration/component/test_ps_domain_limits.py b/test/integration/component/test_ps_domain_limits.py index 42b115edd1a..587940025ad 100644 --- a/test/integration/component/test_ps_domain_limits.py +++ b/test/integration/component/test_ps_domain_limits.py @@ -450,7 +450,7 @@ class TestMultipleChildDomain(cloudstackTestCase): if self.hypervisor.lower() == 'lxc': if not find_storage_pool_type(self.apiclient, storagetype='rbd'): - self.SkipTest("RBD storage type is required for data volumes for LXC") + self.skipTest("RBD storage type is required for data volumes for LXC") result = self.setupAccounts() if result[0] == FAIL: self.fail( diff --git a/test/integration/component/test_snapshots.py b/test/integration/component/test_snapshots.py index b4eea0d6bbe..748f271229b 100644 --- a/test/integration/component/test_snapshots.py +++ b/test/integration/component/test_snapshots.py @@ -18,7 +18,7 @@ """ # Import Local Modules from nose.plugins.attrib import attr -from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.cloudstackTestCase import cloudstackTestCase, unittest from marvin.lib.base import (Snapshot, Template, diff --git a/test/integration/component/test_tags.py b/test/integration/component/test_tags.py index faffe2a761e..19ddd560e26 100644 --- a/test/integration/component/test_tags.py +++ b/test/integration/component/test_tags.py @@ -1157,7 +1157,7 @@ class TestResourceTags(cloudstackTestCase): if self.hypervisor.lower() == 'lxc': if not find_storage_pool_type(self.apiclient, storagetype='rbd'): - self.SkipTest("RBD storage type is required for data volumes for LXC") + self.skipTest("RBD storage type is required for data volumes for LXC") self.debug("Creating volume for account: %s " % self.account.name) diff --git a/test/integration/component/test_usage.py b/test/integration/component/test_usage.py index 480ff53bf93..ac197bb6070 100644 --- a/test/integration/component/test_usage.py +++ b/test/integration/component/test_usage.py @@ -37,7 +37,8 @@ from marvin.lib.base import (Account, Volume) from marvin.lib.common import (get_zone, get_domain, - get_template) + get_template, + find_storage_pool_type) class Services: @@ -682,6 +683,7 @@ class TestTemplateUsage(cloudstackTestCase): cls.domain = get_domain(cls.api_client) cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.services['mode'] = cls.zone.networktype + cls.hypervisor = cls.testClient.getHypervisorInfo() cls.services["server"]["zoneid"] = cls.zone.id template = get_template( cls.api_client, @@ -779,6 +781,9 @@ class TestTemplateUsage(cloudstackTestCase): # 4. Destroy the account # Create template from Virtual machine and Volume ID + if self.hypervisor.lower() == 'lxc': + self.skipTest( + "template create from volume is not supported on %s . Hence, skipping the test" % self.hypervisor) self.template = Template.create( self.userapiclient, self.services["templates"], diff --git a/test/integration/component/test_volumes.py b/test/integration/component/test_volumes.py index 80338decf88..309d80b3c4f 100644 --- a/test/integration/component/test_volumes.py +++ b/test/integration/component/test_volumes.py @@ -116,7 +116,7 @@ class TestAttachVolume(cloudstackTestCase): cls.services['mode'] = cls.zone.networktype cls.hypervisor = cls.testClient.getHypervisorInfo() if cls.hypervisor.lower() == 'lxc': - if not find_storage_pool_type(cls.apiclient, storagetype='rbd'): + if not find_storage_pool_type(cls.api_client, storagetype='rbd'): raise unittest.SkipTest("RBD storage type is required for data volumes for LXC") cls.disk_offering = DiskOffering.create( cls.api_client, @@ -381,7 +381,7 @@ class TestAttachDetachVolume(cloudstackTestCase): cls.services['mode'] = cls.zone.networktype cls.hypervisor = cls.testClient.getHypervisorInfo() if cls.hypervisor.lower() == 'lxc': - if not find_storage_pool_type(cls.apiclient, storagetype='rbd'): + if not find_storage_pool_type(cls.api_client, storagetype='rbd'): raise unittest.SkipTest("RBD storage type is required for data volumes for LXC") cls.disk_offering = DiskOffering.create( cls.api_client, @@ -614,7 +614,7 @@ class TestAttachVolumeISO(cloudstackTestCase): cls.services['mode'] = cls.zone.networktype cls.hypervisor = cls.testClient.getHypervisorInfo() if cls.hypervisor.lower() == 'lxc': - if not find_storage_pool_type(cls.apiclient, storagetype='rbd'): + if not find_storage_pool_type(cls.api_client, storagetype='rbd'): raise unittest.SkipTest("RBD storage type is required for data volumes for LXC") cls.disk_offering = DiskOffering.create( cls.api_client, @@ -832,7 +832,7 @@ class TestVolumes(cloudstackTestCase): cls.services['mode'] = cls.zone.networktype cls.hypervisor = cls.testClient.getHypervisorInfo() if cls.hypervisor.lower() == 'lxc': - if not find_storage_pool_type(cls.apiclient, storagetype='rbd'): + if not find_storage_pool_type(cls.api_client, storagetype='rbd'): raise unittest.SkipTest("RBD storage type is required for data volumes for LXC") cls.disk_offering = DiskOffering.create( cls.api_client, @@ -1149,7 +1149,7 @@ class TestDeployVmWithCustomDisk(cloudstackTestCase): cls.services['mode'] = cls.zone.networktype cls.hypervisor = cls.testClient.getHypervisorInfo() if cls.hypervisor.lower() == 'lxc': - if not find_storage_pool_type(cls.apiclient, storagetype='rbd'): + if not find_storage_pool_type(cls.api_client, storagetype='rbd'): raise unittest.SkipTest("RBD storage type is required for data volumes for LXC") cls.disk_offering = DiskOffering.create( cls.api_client, @@ -1287,7 +1287,7 @@ class TestMigrateVolume(cloudstackTestCase): cls.services['mode'] = cls.zone.networktype cls.hypervisor = cls.testClient.getHypervisorInfo() if cls.hypervisor.lower() == 'lxc': - if not find_storage_pool_type(cls.apiclient, storagetype='rbd'): + if not find_storage_pool_type(cls.api_client, storagetype='rbd'): raise unittest.SkipTest("RBD storage type is required for data volumes for LXC") cls.disk_offering = DiskOffering.create( cls.api_client,