diff --git a/test/integration/component/maint/test_high_availability.py b/test/integration/component/maint/test_high_availability.py index 849ba34aa5d..6fe939276f3 100644 --- a/test/integration/component/maint/test_high_availability.py +++ b/test/integration/component/maint/test_high_availability.py @@ -139,6 +139,9 @@ class TestHighAvailability(cloudstackTestCase): cls.zone.id, cls.services["ostype"] ) + cls.hypervisor = cls.testClient.getHypervisorInfo() + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("Template creation from root volume is not supported in LXC") cls.services["virtual_machine"]["zoneid"] = cls.zone.id cls.services["virtual_machine"]["template"] = cls.template.id diff --git a/test/integration/component/maint/test_host_high_availability.py b/test/integration/component/maint/test_host_high_availability.py index 1824e75ad3a..a4c43f023ee 100644 --- a/test/integration/component/maint/test_host_high_availability.py +++ b/test/integration/component/maint/test_host_high_availability.py @@ -102,6 +102,9 @@ class TestHostHighAvailability(cloudstackTestCase): cls.zone.id, cls.services["ostype"] ) + cls.hypervisor = cls.testClient.getHypervisorInfo() + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("Template creation from root volume is not supported in LXC") clusterWithSufficientHosts = None diff --git a/test/integration/component/maint/test_vpc_host_maintenance.py b/test/integration/component/maint/test_vpc_host_maintenance.py index 74d59e736b9..c5900eb1018 100644 --- a/test/integration/component/maint/test_vpc_host_maintenance.py +++ b/test/integration/component/maint/test_vpc_host_maintenance.py @@ -212,6 +212,9 @@ class TestVMLifeCycleHostmaintenance(cloudstackTestCase): cls.zone.id, cls.services["ostype"] ) + cls.hypervisor = cls.testClient.getHypervisorInfo() + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("Template creation from root volume is not supported in LXC") cls.services["virtual_machine"]["zoneid"] = cls.zone.id cls.services["virtual_machine"]["template"] = cls.template.id diff --git a/test/integration/component/test_acl_listsnapshot.py b/test/integration/component/test_acl_listsnapshot.py index 394072d9c64..36ec59ecb40 100644 --- a/test/integration/component/test_acl_listsnapshot.py +++ b/test/integration/component/test_acl_listsnapshot.py @@ -47,6 +47,9 @@ class TestSnapshotList(cloudstackTestCase): cls.testclient = super(TestSnapshotList, cls).getClsTestClient() cls.apiclient = cls.testclient.getApiClient() cls.testdata = cls.testClient.getParsedTestDataConfig() + cls.hypervisor = cls.testclient.getHypervisorInfo() + if cls.hypervisor.lower() == 'lxc': + raise unittest.SkipTest("snapshots are not supported on %s" % cls.hypervisor.lower()) cls.acldata = cls.testdata["acl"] cls.domain_1 = None diff --git a/test/integration/component/test_advancedsg_networks.py b/test/integration/component/test_advancedsg_networks.py index fddca9bb74c..14cd5522211 100644 --- a/test/integration/component/test_advancedsg_networks.py +++ b/test/integration/component/test_advancedsg_networks.py @@ -2083,6 +2083,9 @@ class TestNetworksInAdvancedSG_VmOperations(cloudstackTestCase): #Create admin account + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("Template creation from root volume is not supported in LXC") + hosts = Host.list(self.api_client, zoneid=self.zone.id) self.assertEqual(validateList(hosts)[0], PASS, "hosts list validation failed, list is %s" % hosts) if len(hosts) < 2: @@ -2159,7 +2162,7 @@ class TestNetworksInAdvancedSG_VmOperations(cloudstackTestCase): name=self.services["test_34_DeployVM_in_SecondSGNetwork"]["zone"] ) status = validateList(zone_list) - self.assertEquals(status[0],PASS,"Failed to list the zones") + self.assertEquals(status[0], PASS, "Failed to list the zones") count = 0 """ In simulator environment default guest os template should be in ready state immediately after the ssvm is up. diff --git a/test/integration/component/test_base_image_updation.py b/test/integration/component/test_base_image_updation.py index 2f92bd2e22a..c3ab5959c33 100644 --- a/test/integration/component/test_base_image_updation.py +++ b/test/integration/component/test_base_image_updation.py @@ -528,6 +528,9 @@ class TestBaseImageUpdate(cloudstackTestCase): 1) New root disk should be formed 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") vms = VirtualMachine.list( self.apiclient, id=self.vm_with_reset.id, diff --git a/test/integration/component/test_blocker_bugs.py b/test/integration/component/test_blocker_bugs.py index 3ea7545ebc1..559b363f310 100644 --- a/test/integration/component/test_blocker_bugs.py +++ b/test/integration/component/test_blocker_bugs.py @@ -742,6 +742,8 @@ class TestTemplates(cloudstackTestCase): cls.zone.id, cls.services["ostype"] ) + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("Template creation from root volume is not supported in LXC") cls.services["virtual_machine"]["zoneid"] = cls.zone.id cls._cleanup = [] try: @@ -1022,6 +1024,9 @@ class TestDataPersistency(cloudstackTestCase): cls.zone.id, cls.services["ostype"] ) + cls.hypervisor = cls.testClient.getHypervisorInfo() + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("Template creation from root volume is not supported in LXC") cls.services["virtual_machine"]["zoneid"] = cls.zone.id #Create an account, network, VM and IP addresses diff --git a/test/integration/component/test_cpu_project_limits.py b/test/integration/component/test_cpu_project_limits.py index 2173050390a..4bb0cff06f2 100644 --- a/test/integration/component/test_cpu_project_limits.py +++ b/test/integration/component/test_cpu_project_limits.py @@ -281,6 +281,9 @@ class TestProjectsCPULimits(cloudstackTestCase): # 2. Deploy VM with the accounts added to the project # 3. Migrate VM of an accounts added to the project to a new host # 4. Resource count should list properly. + self.hypervisor = self.testClient.getHypervisorInfo() + if self.hypervisor.lower() in ['lxc']: + self.skipTest("vm migrate feature is not supported on %s" % self.hypervisor.lower()) project_list = Project.list(self.apiclient, id=self.project.id, listall=True) self.assertIsInstance(project_list, diff --git a/test/integration/component/test_escalations_snapshots.py b/test/integration/component/test_escalations_snapshots.py index 4b6b7f574ab..0645909c522 100644 --- a/test/integration/component/test_escalations_snapshots.py +++ b/test/integration/component/test_escalations_snapshots.py @@ -41,6 +41,8 @@ class TestSnapshots(cloudstackTestCase): cls.api_client = cls.testClient.getApiClient() cls.services = cls.testClient.getParsedTestDataConfig() cls.hypervisor = cls.testClient.getHypervisorInfo() + if cls.hypervisor.lower() == 'lxc': + raise unittest.SkipTest("snapshots are not supported on %s" % cls.hypervisor.lower()) # Get Domain, Zone, Template cls.domain = get_domain(cls.api_client) cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) diff --git a/test/integration/component/test_escalations_volumes.py b/test/integration/component/test_escalations_volumes.py index 1a1772132bf..4912e741f4a 100644 --- a/test/integration/component/test_escalations_volumes.py +++ b/test/integration/component/test_escalations_volumes.py @@ -45,6 +45,9 @@ class TestVolumes(cloudstackTestCase): cls.api_client = cls.testClient.getApiClient() cls.services = cls.testClient.getParsedTestDataConfig() cls.hypervisor = cls.testClient.getHypervisorInfo() + if cls.hypervisor.lower() == 'lxc': + if not find_storage_pool_type(cls.apiclient, storagetype='rbd'): + raise unittest.SkipTest("RBD storage type is required for data volumes for LXC") # Get Domain, Zone, Template cls.domain = get_domain(cls.api_client) cls.zone = get_zone( diff --git a/test/integration/component/test_memory_limits.py b/test/integration/component/test_memory_limits.py index 33236a72e10..4e7e5cc4323 100644 --- a/test/integration/component/test_memory_limits.py +++ b/test/integration/component/test_memory_limits.py @@ -237,6 +237,9 @@ class TestMemoryLimits(cloudstackTestCase): # 1. Create compute offering with specified RAM & Deploy VM as root admin # 2. List Resource count for the root admin Memory usage # 3. Migrate vm, resource count should list properly. + self.hypervisor = self.testClient.getHypervisorInfo() + if self.hypervisor.lower() in ['lxc']: + self.skipTest("vm migrate feature is not supported on %s" % self.hypervisor.lower()) account_list = Account.list(self.apiclient, id=self.account.id) self.assertIsInstance(account_list, @@ -562,6 +565,9 @@ class TestDomainMemoryLimitsConfiguration(cloudstackTestCase): # 2. List Resource count # 3. Migrate instance to another host # 4. Resource count should list properly. + self.hypervisor = self.testClient.getHypervisorInfo() + if self.hypervisor.lower() in ['lxc']: + self.skipTest("vm migrate feature is not supported on %s" % self.hypervisor.lower()) self.debug("Setting up account and domain hierarchy") self.setupAccounts() diff --git a/test/integration/component/test_mm_project_limits.py b/test/integration/component/test_mm_project_limits.py index 9f0ecfe0b96..0d5b282f5b4 100644 --- a/test/integration/component/test_mm_project_limits.py +++ b/test/integration/component/test_mm_project_limits.py @@ -98,6 +98,7 @@ class TestProjectsMemoryLimits(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client) cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.hypervisor = cls.testClient.getHypervisorInfo() cls.services["mode"] = cls.zone.networktype cls.template = get_template( @@ -283,6 +284,10 @@ class TestProjectsMemoryLimits(cloudstackTestCase): # 3. Migrate VM of an accounts added to the project to a new host # 4. Resource count should list properly. + if self.hypervisor.lower() in ['lxc']: + self.skipTest("vm migrate feature is not supported on %s" % self.hypervisor.lower()) + + self.debug("Checking memory resource count for project: %s" % self.project.name) project_list = Project.list(self.apiclient, id=self.project.id, listall=True) self.debug(project_list) diff --git a/test/integration/component/test_project_limits.py b/test/integration/component/test_project_limits.py index adae0474399..e3aacd37cbd 100644 --- a/test/integration/component/test_project_limits.py +++ b/test/integration/component/test_project_limits.py @@ -43,8 +43,8 @@ from marvin.lib.common import (get_domain, list_configurations, list_resource_limits, update_resource_limit, - get_builtin_template_info - ) + get_builtin_template_info, + find_storage_pool_type) from marvin.codes import PASS import time @@ -758,8 +758,8 @@ class TestResourceLimitsProject(cloudstackTestCase): # 5. Try to create another snapshot in this project. It should give # user an appropriate error and an alert should be generated. - if self.hypervisor.lower() in ['hyperv']: - raise self.skipTest("Snapshots feature is not supported on Hyper-V") + if self.hypervisor.lower() in ['hyperv', 'lxc']: + raise self.skipTest("Snapshots feature is not supported on %s" % self.hypervisor.lower()) self.debug( "Updating snapshot resource limits for project: %s" % self.project.id) @@ -835,6 +835,9 @@ class TestResourceLimitsProject(cloudstackTestCase): # an appropriate error that Volume limit is exhausted and an alert # should be generated. + 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.project_1 = Project.create( self.api_client, self.services["project"], diff --git a/test/integration/component/test_project_resources.py b/test/integration/component/test_project_resources.py index cf4e1343d19..6da36ae3f96 100644 --- a/test/integration/component/test_project_resources.py +++ b/test/integration/component/test_project_resources.py @@ -548,6 +548,9 @@ class TestTemplates(cloudstackTestCase): cls.services = Services().services cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.services['mode'] = cls.zone.networktype + cls.hypervisor = cls.testClient.getHypervisorInfo() + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("create template from volume is not supported on %s" % cls.hypervisor.lower()) cls.template = get_template( cls.api_client, @@ -783,6 +786,9 @@ class TestSnapshots(cloudstackTestCase): cls.services = Services().services cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.services['mode'] = cls.zone.networktype + cls.hypervisor = cls.testClient.getHypervisorInfo() + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("snapshots are not supported on %s" % cls.hypervisor.lower()) cls.template = get_template( cls.api_client, diff --git a/test/integration/component/test_project_usage.py b/test/integration/component/test_project_usage.py index 29d381ab187..f74b6aaaf24 100644 --- a/test/integration/component/test_project_usage.py +++ b/test/integration/component/test_project_usage.py @@ -509,6 +509,10 @@ class TestVolumeUsage(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() + if cls.hypervisor.lower() == 'lxc': + if not find_storage_pool_type(cls.apiclient, storagetype='rbd'): + raise unittest.SkipTest("RBD storage type is required for data volumes for LXC") cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -1259,6 +1263,9 @@ class TestSnapshotUsage(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() + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("snapshots are not supported on %s" % cls.hypervisor.lower()) template = get_template( cls.api_client, diff --git a/test/integration/component/test_ps_domain_limits.py b/test/integration/component/test_ps_domain_limits.py index f9aa023b000..42b115edd1a 100644 --- a/test/integration/component/test_ps_domain_limits.py +++ b/test/integration/component/test_ps_domain_limits.py @@ -447,6 +447,10 @@ class TestMultipleChildDomain(cloudstackTestCase): """ # Setting up account and domain hierarchy + + 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") result = self.setupAccounts() if result[0] == FAIL: self.fail( @@ -563,8 +567,8 @@ class TestMultipleChildDomain(cloudstackTestCase): # 5. Delete volume which was created from snapshot and verify primary storage resource count""" - if self.hypervisor.lower() in ['hyperv']: - self.skipTest("Snapshots feature is not supported on Hyper-V") + if self.hypervisor.lower() in ['hyperv', 'lxc']: + self.skipTest("Snapshots feature is not supported on %s" % self.hypervisor.lower()) result = self.setupAccounts() if result[0] == FAIL: diff --git a/test/integration/component/test_ps_project_limits.py b/test/integration/component/test_ps_project_limits.py index bab37f6cab8..c79e3b881fe 100644 --- a/test/integration/component/test_ps_project_limits.py +++ b/test/integration/component/test_ps_project_limits.py @@ -182,7 +182,9 @@ class TestProjectsVolumeLimits(cloudstackTestCase): # initial primary storage count # 2. List the hosts suitable for migrating the VM # 3. Migrate the VM and verify that primary storage count of project remains same""" - + self.hypervisor = self.testClient.getHypervisorInfo() + if self.hypervisor.lower() in ['lxc']: + self.skipTest("vm migrate feature is not supported on %s" % self.hypervisor.lower()) try: hosts = Host.list(self.apiclient,virtualmachineid=self.vm.id, listall=True) diff --git a/test/integration/component/test_ps_resize_volume.py b/test/integration/component/test_ps_resize_volume.py index bff16725f5b..d70f4256cb1 100644 --- a/test/integration/component/test_ps_resize_volume.py +++ b/test/integration/component/test_ps_resize_volume.py @@ -64,6 +64,8 @@ class TestResizeVolume(cloudstackTestCase): cls.resourcetypemapping = {RESOURCE_PRIMARY_STORAGE: 10, RESOURCE_SECONDARY_STORAGE: 11} + + cls.template = get_template( cls.api_client, cls.zone.id, diff --git a/test/integration/component/test_snapshot_gc.py b/test/integration/component/test_snapshot_gc.py index 064850ea1f7..21a23e5ca1e 100644 --- a/test/integration/component/test_snapshot_gc.py +++ b/test/integration/component/test_snapshot_gc.py @@ -139,6 +139,9 @@ class TestAccountSnapshotClean(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() + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("snapshots are not supported on %s" % cls.hypervisor.lower()) template = get_template( cls.api_client, diff --git a/test/integration/component/test_snapshot_limits.py b/test/integration/component/test_snapshot_limits.py index 40849ee4622..6d8c980ffe4 100644 --- a/test/integration/component/test_snapshot_limits.py +++ b/test/integration/component/test_snapshot_limits.py @@ -139,6 +139,9 @@ class TestSnapshotLimit(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() + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("snapshots are not supported on %s" % cls.hypervisor.lower()) cls._cleanup = [] try: diff --git a/test/integration/component/test_snapshots.py b/test/integration/component/test_snapshots.py index bb93d8ddbed..b4eea0d6bbe 100644 --- a/test/integration/component/test_snapshots.py +++ b/test/integration/component/test_snapshots.py @@ -167,6 +167,9 @@ class TestSnapshots(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() + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("snapshots are not supported on %s" % cls.hypervisor.lower()) cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -969,6 +972,9 @@ class TestCreateVMSnapshotTemplate(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() + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("snapshots are not supported on %s" % cls.hypervisor.lower()) cls.template = get_template( cls.api_client, @@ -1183,6 +1189,9 @@ class TestSnapshotEvents(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() + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("snapshots are not supported on %s" % cls.hypervisor.lower()) template = get_template( cls.api_client, diff --git a/test/integration/component/test_snapshots_improvement.py b/test/integration/component/test_snapshots_improvement.py index 1fd42392db3..39b96b4f751 100644 --- a/test/integration/component/test_snapshots_improvement.py +++ b/test/integration/component/test_snapshots_improvement.py @@ -133,6 +133,9 @@ class TestSnapshotOnRootVolume(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client) cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.hypervisor = cls.testClient.getHypervisorInfo() + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("snapshots are not supported on %s" % cls.hypervisor.lower()) cls.template = get_template( cls.api_client, cls.zone.id, @@ -304,8 +307,8 @@ class TestCreateSnapshot(cloudstackTestCase): cls.testClient = super(TestCreateSnapshot, cls).getClsTestClient() cls.api_client = cls.testClient.getApiClient() cls.hypervisor = cls.testClient.getHypervisorInfo() - if cls.hypervisor.lower() in ['hyperv']: - raise unittest.SkipTest("Snapshots feature is not supported on Hyper-V") + if cls.hypervisor.lower() in ['hyperv', 'lxc']: + raise unittest.SkipTest("Snapshots feature is not supported on %s" % cls.hypervisor.lower()) cls.services = Services().services # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client) diff --git a/test/integration/component/test_ss_limits.py b/test/integration/component/test_ss_limits.py index 32201d8d21e..8662cd5ff86 100644 --- a/test/integration/component/test_ss_limits.py +++ b/test/integration/component/test_ss_limits.py @@ -206,8 +206,8 @@ class TestSecondaryStorageLimits(cloudstackTestCase): 5. Verify that the secondary storage count of the account equals the size of the template""" - if self.hypervisor.lower() in ['hyperv']: - self.skipTest("Snapshots feature is not supported on Hyper-V") + if self.hypervisor.lower() in ['hyperv', 'lxc']: + self.skipTest("Snapshots feature is not supported on %s" % self.hypervisor.lower()) response = self.setupAccount(value) self.assertEqual(response[0], PASS, response[1]) diff --git a/test/integration/component/test_storage_motion.py b/test/integration/component/test_storage_motion.py index 163b4472470..6450d060649 100644 --- a/test/integration/component/test_storage_motion.py +++ b/test/integration/component/test_storage_motion.py @@ -242,7 +242,7 @@ class TestStorageMotion(cloudstackTestCase): # 3. Migrate volume of the vm to another pool. # 4. Check volume is present in the new pool and is in Ready state. - # TODO: add test case for data volume migrate + # TODO: add test case for data volume migrate and handle it for LXC list_volumes_response = list_volumes( self.apiclient, diff --git a/test/integration/component/test_tags.py b/test/integration/component/test_tags.py index e3235782757..faffe2a761e 100644 --- a/test/integration/component/test_tags.py +++ b/test/integration/component/test_tags.py @@ -39,7 +39,8 @@ from marvin.lib.base import (Tag, Project) from marvin.lib.common import (get_zone, get_domain, - get_template) + get_template, + find_storage_pool_type) from marvin.codes import FAILED import time @@ -949,6 +950,9 @@ class TestResourceTags(cloudstackTestCase): # 1. Create a tag on template/ISO using createTags API # 2. Delete above created tag using deleteTags API + if self.hypervisor.lower() in ['lxc']: + self.skipTest("template creation from volume feature is not supported on %s" % self.hypervisor.lower()) + try: self.debug("Stopping the virtual machine: %s" % self.vm_1.name) # Stop virtual machine @@ -1151,6 +1155,10 @@ class TestResourceTags(cloudstackTestCase): # 1. Create a tag on volume using createTags API # 2. Delete above created tag using deleteTags API + 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.debug("Creating volume for account: %s " % self.account.name) volume = Volume.create( @@ -1240,8 +1248,8 @@ class TestResourceTags(cloudstackTestCase): # 1. Create a tag on snapshot using createTags API # 2. Delete above created tag using deleteTags API - if self.hypervisor.lower() in ['hyperv']: - self.skipTest("Snapshots feature is not supported on Hyper-V") + if self.hypervisor.lower() in ['hyperv', 'lxc']: + self.skipTest("Snapshots feature is not supported on %s" % self.hypervisor.lower()) self.debug("Creating snapshot on ROOT volume for VM: %s " % self.vm_1.name) @@ -1441,6 +1449,9 @@ class TestResourceTags(cloudstackTestCase): # 1. Create a tag on VM using createTags API # 2. Delete above created tag using deleteTags API + if self.hypervisor.lower() in ['lxc']: + self.skipTest("vm migrate feature is not supported on %s" % self.hypervisor.lower()) + vms = VirtualMachine.list( self.apiclient, id=self.vm_1.id, diff --git a/test/integration/component/test_templates.py b/test/integration/component/test_templates.py index 06b8c5f58d6..eafc1bbb05d 100644 --- a/test/integration/component/test_templates.py +++ b/test/integration/component/test_templates.py @@ -109,7 +109,6 @@ class TestCreateTemplate(cloudstackTestCase): def setUp(self): self.apiclient = self.testClient.getApiClient() - self.hypervisor = self.testClient.getHypervisorInfo() self.dbclient = self.testClient.getDbConnection() self.cleanup = [] return @@ -133,6 +132,9 @@ class TestCreateTemplate(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() + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("Template creation from root volume is not supported in LXC") cls.services["virtual_machine"]["zoneid"] = cls.zone.id cls.service_offering = ServiceOffering.create( @@ -290,6 +292,9 @@ class TestTemplates(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() + if cls.hypervisor.lower() in ['lxc']: + raise unittest.SkipTest("Template creation from root volume is not supported in LXC") #populate second zone id for iso copy cmd = listZones.listZonesCmd() zones = cls.api_client.listZones(cmd) @@ -495,8 +500,8 @@ class TestTemplates(cloudstackTestCase): # 4. Deploy Virtual machine using this template # 5. VM should be in running state - if self.hypervisor.lower() in ['hyperv']: - self.skipTest("Snapshots feature is not supported on Hyper-V") + if self.hypervisor.lower() in ['hyperv', 'lxc']: + self.skipTest("Snapshots feature is not supported on %s" % self.hypervisor.lower()) userapiclient = self.testClient.getUserApiClient( UserName=self.account.name, diff --git a/test/integration/component/test_usage.py b/test/integration/component/test_usage.py index 262a3714524..480ff53bf93 100644 --- a/test/integration/component/test_usage.py +++ b/test/integration/component/test_usage.py @@ -492,6 +492,10 @@ class TestVolumeUsage(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() + if cls.hypervisor.lower() == 'lxc': + if not find_storage_pool_type(cls.apiclient, storagetype='rbd'): + raise unittest.SkipTest("RBD storage type is required for data volumes for LXC") cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -1174,6 +1178,8 @@ class TestSnapshotUsage(cloudstackTestCase): cls.domain = get_domain(cls.api_client) cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.services['mode'] = cls.zone.networktype + if cls.hypervisor.lower() == 'lxc': + raise unittest.SkipTest("snapshots are not supported on LXC") template = get_template( cls.api_client, diff --git a/test/integration/component/test_volumes.py b/test/integration/component/test_volumes.py index 77cad54fd0f..80338decf88 100644 --- a/test/integration/component/test_volumes.py +++ b/test/integration/component/test_volumes.py @@ -36,7 +36,8 @@ from marvin.lib.base import (Account, from marvin.lib.common import (get_domain, get_zone, get_template, - get_pod) + get_pod, + find_storage_pool_type) from marvin.codes import PASS # Import System modules import time @@ -113,6 +114,10 @@ class TestAttachVolume(cloudstackTestCase): cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.pod = get_pod(cls.api_client, cls.zone.id) 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'): + raise unittest.SkipTest("RBD storage type is required for data volumes for LXC") cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -374,6 +379,10 @@ class TestAttachDetachVolume(cloudstackTestCase): cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.pod = get_pod(cls.api_client, cls.zone.id) 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'): + raise unittest.SkipTest("RBD storage type is required for data volumes for LXC") cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -603,6 +612,10 @@ class TestAttachVolumeISO(cloudstackTestCase): cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) cls.pod = get_pod(cls.api_client, cls.zone.id) 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'): + raise unittest.SkipTest("RBD storage type is required for data volumes for LXC") cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -691,6 +704,8 @@ class TestAttachVolumeISO(cloudstackTestCase): # 3. Verify that attach ISO is successful # Create 5 volumes and attach to VM + if self.hypervisor.lower() in ["lxc"]: + self.skipTest("attach ISO is not supported on LXC") for i in range(self.max_data_volumes): volume = Volume.create( self.apiclient, @@ -815,6 +830,10 @@ class TestVolumes(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() + if cls.hypervisor.lower() == 'lxc': + if not find_storage_pool_type(cls.apiclient, storagetype='rbd'): + raise unittest.SkipTest("RBD storage type is required for data volumes for LXC") cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -1128,6 +1147,10 @@ class TestDeployVmWithCustomDisk(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() + if cls.hypervisor.lower() == 'lxc': + if not find_storage_pool_type(cls.apiclient, storagetype='rbd'): + raise unittest.SkipTest("RBD storage type is required for data volumes for LXC") cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"], @@ -1262,6 +1285,10 @@ class TestMigrateVolume(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() + if cls.hypervisor.lower() == 'lxc': + if not find_storage_pool_type(cls.apiclient, storagetype='rbd'): + raise unittest.SkipTest("RBD storage type is required for data volumes for LXC") cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] diff --git a/test/integration/testpaths/testpath_volumelifecycle.py b/test/integration/testpaths/testpath_volumelifecycle.py index 526d20ce511..c5a537ff0f4 100644 --- a/test/integration/testpaths/testpath_volumelifecycle.py +++ b/test/integration/testpaths/testpath_volumelifecycle.py @@ -126,6 +126,12 @@ class TestPathVolume(cloudstackTestCase): cls.domain = get_domain(cls.apiclient) cls.zone = get_zone(cls.apiclient) cls.testdata["mode"] = cls.zone.networktype + cls.hypervisor = testClient.getHypervisorInfo() + #for LXC if the storage pool of type 'rbd' ex: ceph is not available, skip the test + if cls.hypervisor.lower() == 'lxc': + if not find_storage_pool_type(cls.apiclient, storagetype='rbd'): + raise unittest.SkipTest("RBD storage type is required for data volumes for %s" % cls.hypervisor.lower()) + cls.template = get_template( cls.apiclient, cls.zone.id,