cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tall...@apache.org
Subject git commit: updated refs/heads/master to 608b0c5
Date Thu, 04 Dec 2014 11:09:15 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 0a757b0f1 -> 608b0c5a2


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/608b0c5a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/608b0c5a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/608b0c5a

Branch: refs/heads/master
Commit: 608b0c5a2490261f1fa0e870210f130cc5528a23
Parents: 0a757b0
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:38:35 2014 +0530

----------------------------------------------------------------------
 .../component/test_escalations_instances.py     | 36 ++++++++++++++------
 1 file changed, 26 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/608b0c5a/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 cc1f78b..45eef94 100644
--- a/test/integration/component/test_escalations_instances.py
+++ b/test/integration/component/test_escalations_instances.py
@@ -2854,17 +2854,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