Skip to content

Commit 8f1e051

Browse files
sanjeevneelarapusanjeev
authored andcommitted
Skipping all unsupported tests on LXC
This closes apache#379
1 parent 6140db5 commit 8f1e051

4 files changed

Lines changed: 25 additions & 7 deletions

File tree

test/integration/component/test_blocker_bugs.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,10 @@ def setUpClass(cls):
742742
cls.zone.id,
743743
cls.services["ostype"]
744744
)
745+
cls.templateSupported = True
745746
if cls.hypervisor.lower() in ['lxc']:
746-
raise unittest.SkipTest("Template creation from root volume is not supported in LXC")
747+
cls.templateSupported = False
748+
return
747749
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
748750
cls._cleanup = []
749751
try:
@@ -802,6 +804,8 @@ def setUp(self):
802804
self.apiclient = self.testClient.getApiClient()
803805
self.dbclient = self.testClient.getDbConnection()
804806
self.cleanup = []
807+
if not self.templateSupported:
808+
self.skipTest("Template creation from root volume is not supported in LXC")
805809
return
806810

807811
def tearDown(self):
@@ -1019,14 +1023,16 @@ def setUpClass(cls):
10191023
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
10201024
cls.domain = get_domain(cls.api_client)
10211025
cls.services['mode'] = cls.zone.networktype
1026+
cls.templateSupported = True
10221027
template = get_template(
10231028
cls.api_client,
10241029
cls.zone.id,
10251030
cls.services["ostype"]
10261031
)
10271032
cls.hypervisor = cls.testClient.getHypervisorInfo()
10281033
if cls.hypervisor.lower() in ['lxc']:
1029-
raise unittest.SkipTest("Template creation from root volume is not supported in LXC")
1034+
cls.templateSupported = False
1035+
return
10301036
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
10311037

10321038
#Create an account, network, VM and IP addresses
@@ -1071,6 +1077,8 @@ def tearDownClass(cls):
10711077

10721078
def setUp(self):
10731079
self.apiclient = self.testClient.getApiClient()
1080+
if not self.templateSupported:
1081+
self.skipTest("Template creation from root volume is not supported in LXC")
10741082
return
10751083

10761084
def tearDown(self):

test/integration/component/test_project_usage.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,9 +511,12 @@ def setUpClass(cls):
511511
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
512512
cls.services['mode'] = cls.zone.networktype
513513
cls.hypervisor = cls.testClient.getHypervisorInfo()
514+
cls.rbdStorageFound = True
514515
if cls.hypervisor.lower() == 'lxc':
515516
if not find_storage_pool_type(cls.api_client, storagetype='rbd'):
516-
raise unittest.SkipTest("RBD storage type is required for data volumes for LXC")
517+
cls.rbdStorageFound = False
518+
return
519+
#raise unittest.SkipTest("RBD storage type is required for data volumes for LXC")
517520
cls.disk_offering = DiskOffering.create(
518521
cls.api_client,
519522
cls.services["disk_offering"]
@@ -575,6 +578,8 @@ def setUp(self):
575578
self.apiclient = self.testClient.getApiClient()
576579
self.dbclient = self.testClient.getDbConnection()
577580
self.cleanup = []
581+
if not self.rbdStorageFound:
582+
self.skipTest("")
578583
return
579584

580585
def tearDown(self):
@@ -1258,16 +1263,17 @@ class TestSnapshotUsage(cloudstackTestCase):
12581263
def setUpClass(cls):
12591264
cls.testClient = super(TestSnapshotUsage, cls).getClsTestClient()
12601265
cls.api_client = cls.testClient.getApiClient()
1261-
1266+
cls.hypervisor = cls.testClient.getHypervisorInfo()
1267+
cls.snapshotSupported = True
1268+
if cls.hypervisor.lower() in ['hyperv', 'lxc']:
1269+
cls.snapshotSupported = False
1270+
return
12621271
cls.services = Services().services
12631272
# Get Zone, Domain and templates
12641273
cls.domain = get_domain(cls.api_client)
12651274
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
12661275
cls.services['mode'] = cls.zone.networktype
12671276
cls.hypervisor = cls.testClient.getHypervisorInfo()
1268-
if cls.hypervisor.lower() in ['lxc']:
1269-
raise unittest.SkipTest("snapshots are not supported on %s" % cls.hypervisor.lower())
1270-
12711277
template = get_template(
12721278
cls.api_client,
12731279
cls.zone.id,
@@ -1324,6 +1330,8 @@ def setUp(self):
13241330
self.apiclient = self.testClient.getApiClient()
13251331
self.dbclient = self.testClient.getDbConnection()
13261332
self.cleanup = []
1333+
if not self.snapshotSupported:
1334+
self.skipTest("Snapshots are not supported on %s" % self.hypervisor)
13271335
return
13281336

13291337
def tearDown(self):

test/integration/component/test_tags.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,6 +2317,8 @@ def test_23_list_untagged_host_for_vm_migration(self):
23172317
4.list hosts for migration for the above deployed vm
23182318
5.All untagged hosts in the cluster must be listed as available hosts for vm migration
23192319
"""
2320+
if self.hypervisor.lower() in ['lxc']:
2321+
self.skipTest("Unsupported Hypervisor Type for User VM migration")
23202322
tag = "tag1"
23212323
clusters = list_clusters(self.apiclient, zoneid=self.zone.id)
23222324
self.assertEqual(

test/integration/smoke/test_vm_life_cycle.py

100644100755
File mode changed.

0 commit comments

Comments
 (0)