cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [36/50] [abbrv] git commit: updated refs/heads/master to b61733d
Date Mon, 08 Dec 2014 10:09:24 GMT
CLOUDSTACK-7998: test_escalations_instances.py - Correcting code related to detach volume

Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1f7699f4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1f7699f4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1f7699f4

Branch: refs/heads/master
Commit: 1f7699f45816b3150972bf4947e12ecc36de15a6
Parents: c2c7ee2
Author: Ashutosh K <ashutosh@clogeny.com>
Authored: Wed Dec 3 15:40:53 2014 +0530
Committer: SrikanteswaraRao Talluri <talluri@apache.org>
Committed: Thu Dec 4 16:37:35 2014 +0530

----------------------------------------------------------------------
 .../component/test_escalations_instances.py     | 38 ++++++++++++++------
 1 file changed, 27 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1f7699f4/test/integration/component/test_escalations_instances.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_escalations_instances.py b/test/integration/component/test_escalations_instances.py
index 51b2096..9f053a1 100644
--- a/test/integration/component/test_escalations_instances.py
+++ b/test/integration/component/test_escalations_instances.py
@@ -2850,17 +2850,33 @@ class TestInstances(cloudstackTestCase):
             len(list_volumes_page1),
             "VM's volume count is not matching in page 1"
         )
-        # stopping VM before detaching volumes
-        vm_created.stop(self.userapiclient)
-
-        # Detaching root volume is allowed on XenServer only
-        if self.hypervisor.lower() == 'xenserver':
-            # Detaching all the volumes attached from VM
-            for i in range(0, len(list_volumes_page1)):
-                vm_created.detach_volume(
-                    self.userapiclient,
-                    list_volumes_page1[i]
-                )
+
+        list_data_disks = Volume.list(
+            self.userapiclient,
+            listall=self.services["listall"],
+            virtualmachineid=vm_created.id,
+            page=1,
+            pagesize=self.services["pagesize"],
+            type="DATADISK"
+        )
+
+        for volume in list_data_disks:
+            vm_created.detach_volume(self.userapiclient, volume)
+
+        volumes = Volume.list(
+            self.userapiclient,
+            listall=self.services["listall"],
+            virtualmachineid=vm_created.id,
+            page=1,
+            pagesize=self.services["pagesize"]
+        )
+
+        self.assertEqual(
+                len(volumes),
+                len(list_volumes_page1) - len(list_data_disks),
+                "The volumes number should match with (volumes initially\
+                        present minus volumes detached")
+
         return
 
     @attr(tags=["advanced", "basic"], required_hardware="true")


Mime
View raw message