CLOUDSTACK-8515: Skip snapshot test cases for HyperV and LXC

Signed-off-by: Gaurav Aradhye <gaurav.aradhye@clogeny.com>
This closes #311
This commit is contained in:
Gaurav Aradhye 2015-05-27 11:39:35 +05:30
parent 3a7ad46725
commit f2178af317
1 changed files with 53 additions and 61 deletions

View File

@ -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,