mirror of https://github.com/apache/cloudstack.git
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:
parent
3a7ad46725
commit
f2178af317
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue