You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2014/07/28 23:14:01 UTC

[33/50] [abbrv] git commit: updated refs/heads/4.4 to 2025f35

CLOUDSTACK-6906: Fixing volume resize BVT

(cherry picked from commit ba270efd4b842480482953ec2c4f7641e8ad04ca)


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

Branch: refs/heads/4.4
Commit: aca8ae06bec5f35814905030d34bd9975fc2368c
Parents: dc75e46
Author: Girish Shilamkar <gi...@clogeny.com>
Authored: Fri Jun 20 07:12:18 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 23:12:51 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_volumes.py | 37 +++++++++++++++--------------
 1 file changed, 19 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aca8ae06/test/integration/smoke/test_volumes.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py
index 3a30768..79cc5b2 100644
--- a/test/integration/smoke/test_volumes.py
+++ b/test/integration/smoke/test_volumes.py
@@ -621,9 +621,16 @@ class TestVolumes(cloudstackTestCase):
         # resize the data disk
         self.debug("Resize Volume ID: %s" % self.volume.id)
 
+        self.services["disk_offering"]["disksize"] = 20
+        disk_offering_20_GB = DiskOffering.create(
+                                    self.apiclient,
+                                    self.services["disk_offering"]
+                                    )
+        self.cleanup.append(disk_offering_20_GB)
+
         cmd                = resizeVolume.resizeVolumeCmd()
         cmd.id             = self.volume.id
-        cmd.diskofferingid = self.services['customresizeddiskofferingid']
+        cmd.diskofferingid = disk_offering_20_GB.id
 
         self.apiClient.resizeVolume(cmd)
 
@@ -636,7 +643,7 @@ class TestVolumes(cloudstackTestCase):
                                                 type='DATADISK'
                                                 )
             for vol in list_volume_response:
-                if vol.id == self.volume.id and vol.size == 3221225472L and vol.state == 'Ready':
+                if vol.id == self.volume.id and int(vol.size) == (int(disk_offering_20_GB.disksize) * (1024** 3)) and vol.state == 'Ready':
                     success = True
             if success:
                 break
@@ -650,22 +657,16 @@ class TestVolumes(cloudstackTestCase):
                          "Check if the data volume resized appropriately"
                          )
 
-        # resize the root disk
-        self.debug("Resize Root for : %s" % self.virtual_machine.id)
-
-        # get root vol from created vm
-        list_volume_response = Volume.list(
-                                            self.apiClient,
-                                            virtualmachineid=self.virtual_machine.id,
-                                            type='ROOT',
-                                            listall=True
-                                            )
-
-        rootvolume = list_volume_response[0]
+        self.services["disk_offering"]["disksize"] = 10
+        disk_offering_10_GB = DiskOffering.create(
+                                    self.apiclient,
+                                    self.services["disk_offering"]
+                                    )
+        self.cleanup.append(disk_offering_10_GB)
 
         cmd                = resizeVolume.resizeVolumeCmd()
-        cmd.id             = rootvolume.id
-        cmd.size           = 10
+        cmd.id             = self.volume.id
+        cmd.diskofferingid = disk_offering_10_GB.id
         cmd.shrinkok       = "true"
 
         self.apiClient.resizeVolume(cmd)
@@ -675,10 +676,10 @@ class TestVolumes(cloudstackTestCase):
         while count < 3:
             list_volume_response = Volume.list(
                                                 self.apiClient,
-                                                id=rootvolume.id
+                                                id=self.volume.id
                                                 )
             for vol in list_volume_response:
-                if vol.id == rootvolume.id and vol.size == 10737418240L and vol.state == 'Ready':
+                if vol.id == self.volume.id and int(vol.size) == (int(disk_offering_10_GB.disksize) * (1024 ** 3)) and vol.state == 'Ready':
                     success = True
             if success:
                 break