From b0d527688f2bd781d99511ac72c638aeca12f95b Mon Sep 17 00:00:00 2001 From: Boris Date: Mon, 3 Oct 2016 17:53:51 +0300 Subject: [PATCH] CLOUDSTACK-9527: test_01_test_vm_volume_snapshot making test negative again - test_01_test_vm_volume_snapshot not supported for Xen, tests keep failing Signed-off-by: Rohit Yadav --- test/integration/smoke/test_vm_snapshots.py | 31 ++++++--------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/test/integration/smoke/test_vm_snapshots.py b/test/integration/smoke/test_vm_snapshots.py index d173aa4d329..5fcb80a8aed 100644 --- a/test/integration/smoke/test_vm_snapshots.py +++ b/test/integration/smoke/test_vm_snapshots.py @@ -362,12 +362,12 @@ class TestSnapshots(cloudstackTestCase): @attr(tags=["advanced", "basic", "smoke"], required_hardware="true") def test_01_test_vm_volume_snapshot(self): """ - @Desc: Test that Volume snapshot for root volume is allowed + @Desc: Test that Volume snapshot for root volume is not 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 not fail + It should expect Exception """ # Creating Virtual Machine @@ -392,25 +392,10 @@ class TestSnapshots(cloudstackTestCase): self.assertEqual(validateList(volumes)[0], PASS, "Failed to get root volume of the VM") - 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" - ) + volume = volumes[0] + + with self.assertRaises(Exception): + Snapshot.create(self.apiclient, + volume_id=volume.id) + return