Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 27 additions & 9 deletions 36 test/integration/smoke/test_vm_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from marvin.codes import FAILED, KVM, PASS
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.lib.utils import random_gen, cleanup_resources, validateList
from marvin.lib.utils import random_gen, cleanup_resources, validateList, is_snapshot_on_nfs
from marvin.lib.base import (Account,
ServiceOffering,
VirtualMachine,
Expand All @@ -28,7 +28,8 @@
Snapshot)
from marvin.lib.common import (get_zone,
get_domain,
get_template)
get_template,
list_snapshots)
import time


Expand Down Expand Up @@ -337,6 +338,7 @@ def setUpClass(cls):
def setUp(self):

self.apiclient = self.testClient.getApiClient()
self.dbclient = self.testClient.getDbConnection()
self.cleanup = []

if self.unsupportedHypervisor:
Expand All @@ -360,12 +362,12 @@ def tearDownClass(cls):
@attr(tags=["advanced", "basic", "smoke"], required_hardware="true")
def test_01_test_vm_volume_snapshot(self):
"""
@Desc: Test that Volume snapshot for root volume not allowed
@Desc: Test that Volume snapshot for root volume is allowed
when VM snapshot is present for the VM
@Steps:
1: Deploy a VM and create a VM snapshot for VM
2: Try to create snapshot for the root volume of the VM,
It should fail
It should not fail
"""

# Creating Virtual Machine
Expand All @@ -390,9 +392,25 @@ def test_01_test_vm_volume_snapshot(self):
self.assertEqual(validateList(volumes)[0], PASS,
"Failed to get root volume of the VM")

volume = volumes[0]

with self.assertRaises(Exception):
Snapshot.create(self.apiclient,
volume_id=volume.id)
snapshot = Snapshot.create(
self.apiclient,
volumes[0].id,
account=self.account.name,
domainid=self.account.domainid
)
self.debug("Snapshot created: ID - %s" % snapshot.id)
snapshots = list_snapshots(
self.apiclient,
id=snapshot.id
)
self.assertEqual(
validateList(snapshots)[0],
PASS,
"Invalid snapshot list"
)
self.assertEqual(
snapshots[0].id,
snapshot.id,
"Check resource id in list resources call"
)
return
Morty Proxy This is a proxified and sanitized view of the page, visit original site.