From f2178af317262700a76e2b5b5532c46703b0a7af Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Wed, 27 May 2015 11:39:35 +0530 Subject: [PATCH] CLOUDSTACK-8515: Skip snapshot test cases for HyperV and LXC Signed-off-by: Gaurav Aradhye This closes #311 --- .../maint/testpath_disable_enable_zone.py | 114 ++++++++---------- 1 file changed, 53 insertions(+), 61 deletions(-) diff --git a/test/integration/component/maint/testpath_disable_enable_zone.py b/test/integration/component/maint/testpath_disable_enable_zone.py index ba3a014deae..95e7c30af71 100644 --- a/test/integration/component/maint/testpath_disable_enable_zone.py +++ b/test/integration/component/maint/testpath_disable_enable_zone.py @@ -53,6 +53,9 @@ class TestDisableEnableZone(cloudstackTestCase): cls.apiclient = testClient.getApiClient() cls.testdata = testClient.getParsedTestDataConfig() cls.hypervisor = cls.testClient.getHypervisorInfo() + cls.snapshotSupported = True + if cls.hypervisor.lower() in ["hyperv", "lxc"]: + cls.snapshotSupported = False # Get Zone, Domain and templates cls.domain = get_domain(cls.apiclient) @@ -208,30 +211,31 @@ class TestDisableEnableZone(cloudstackTestCase): listall=True ) - snap = Snapshot.create( - self.apiclient, - root_volume[0].id) + if self.snapshotSupported: + snap = Snapshot.create( + self.apiclient, + root_volume[0].id) - self.assertNotEqual(snap, + self.assertNotEqual(snap, None, "Verify that admin should be \ able to create snapshot") - snapshots = list_snapshots( - self.apiclient, - volumeid=root_volume[0].id, - listall=True) + snapshots = list_snapshots( + self.apiclient, + volumeid=root_volume[0].id, + listall=True) - template_from_snapshot = Template.create_from_snapshot( - self.apiclient, - snapshots[0], - self.testdata["privatetemplate"]) + template_from_snapshot = Template.create_from_snapshot( + self.apiclient, + snapshots[0], + self.testdata["privatetemplate"]) - self.assertNotEqual( - template_from_snapshot, - None, - "Verify that admin should be able to create template" - ) + self.assertNotEqual( + template_from_snapshot, + None, + "Verify that admin should be able to create template" + ) builtin_info = get_builtin_template_info(self.apiclient, self.zone.id) self.testdata["privatetemplate"]["url"] = builtin_info[0] @@ -248,11 +252,6 @@ class TestDisableEnableZone(cloudstackTestCase): None, "Check if template gets created" ) - self.assertNotEqual( - template_from_snapshot, - None, - "Check if template gets created" - ) data_volume = Volume.create( self.apiclient, @@ -299,10 +298,11 @@ class TestDisableEnableZone(cloudstackTestCase): listall=True ) - with self.assertRaises(Exception): - snap = Snapshot.create( - self.userapiclient, - root_volume[0].id) + if self.snapshotSupported: + with self.assertRaises(Exception): + snap = Snapshot.create( + self.userapiclient, + root_volume[0].id) with self.assertRaises(Exception): Template.register( @@ -350,29 +350,30 @@ class TestDisableEnableZone(cloudstackTestCase): None, "Verify that admin should create new VM") - snap = Snapshot.create( - self.apiclient, - root_volume[0].id) + if self.snapshotSupported: + snap = Snapshot.create( + self.apiclient, + root_volume[0].id) - self.assertNotEqual(snap, + self.assertNotEqual(snap, None, "Verify that admin should snashot") - snapshots = list_snapshots( - self.apiclient, - volumeid=root_volume[0].id, - listall=True) + snapshots = list_snapshots( + self.apiclient, + volumeid=root_volume[0].id, + listall=True) - template_from_snapshot = Template.create_from_snapshot( - self.apiclient, - snapshots[0], - self.testdata["privatetemplate"]) + template_from_snapshot = Template.create_from_snapshot( + self.apiclient, + snapshots[0], + self.testdata["privatetemplate"]) - self.assertNotEqual( - template_from_snapshot, - None, - "Check if template gets created" - ) + self.assertNotEqual( + template_from_snapshot, + None, + "Check if template gets created" + ) template_regis = Template.register( self.apiclient, @@ -384,11 +385,6 @@ class TestDisableEnableZone(cloudstackTestCase): None, "Check if template gets created" ) - self.assertNotEqual( - template_from_snapshot, - None, - "Check if template gets created" - ) data_volume = Volume.create( self.apiclient, @@ -433,18 +429,19 @@ class TestDisableEnableZone(cloudstackTestCase): None, "Verify that admin should create new VM") - snap = Snapshot.create( - self.userapiclient, - root_volume[0].id) + if self.snapshotSupported: + snap = Snapshot.create( + self.userapiclient, + root_volume[0].id) - self.assertNotEqual(snap, + self.assertNotEqual(snap, None, "Verify that admin should snashot") - snapshots = list_snapshots( - self.userapiclient, - volumeid=root_volume[0].id, - listall=True) + snapshots = list_snapshots( + self.userapiclient, + volumeid=root_volume[0].id, + listall=True) template_regis = Template.register( self.userapiclient, @@ -456,11 +453,6 @@ class TestDisableEnableZone(cloudstackTestCase): None, "Check if template gets created" ) - self.assertNotEqual( - template_from_snapshot, - None, - "Check if template gets created" - ) data_volume = Volume.create( self.userapiclient,