cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: updated refs/heads/4.4 to a050074
Date Wed, 30 Jul 2014 10:28:34 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 2addc57d8 -> a05007489


Fix for Marvin utils.py:checkVolumeSize Fix for test_01_create_volume to use the correct volume
name for XenServer

Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
(cherry picked from commit 751f0ac5185c832b30e65d271af8d08469202329)


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

Branch: refs/heads/4.4
Commit: a05007489a80e6fdef6bc6333fa405b05c162fa5
Parents: 2addc57
Author: Doug Clark <doug.clark@citrix.com>
Authored: Wed May 21 11:36:11 2014 +0000
Committer: Daan Hoogland <daan@onecht.net>
Committed: Wed Jul 30 12:28:24 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_volumes.py | 13 +++++++++++--
 tools/marvin/marvin/lib/utils.py       |  5 ++---
 2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0500748/test/integration/smoke/test_volumes.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py
index 03fd37a..24c0a97 100644
--- a/test/integration/smoke/test_volumes.py
+++ b/test/integration/smoke/test_volumes.py
@@ -33,7 +33,7 @@ from marvin.lib.common import (get_domain,
                                 get_zone,
                                 get_template)
 from marvin.lib.utils import checkVolumeSize
-from marvin.codes import SUCCESS, FAILED, ERROR_CODE_530
+from marvin.codes import SUCCESS, FAILED, ERROR_CODE_530, XEN_SERVER
 from nose.plugins.attrib import attr
 #Import System modules
 import os
@@ -197,7 +197,16 @@ class TestCreateVolume(cloudstackTestCase):
             ssh = self.virtual_machine.get_ssh_client(
                                                       reconnect=True
                                                       )
-            ret = checkVolumeSize(ssh_handle=ssh,size_to_verify=vol_sz)
+            # Get the updated volume information
+            list_volume_response = Volume.list(
+                                               self.apiClient,
+                                               id=volume.id)
+            if list_volume_response[0].hypervisor.lower() == XEN_SERVER.lower():
+                volume_name = "/dev/xvd" + chr(ord('a') + int(list_volume_response[0].deviceid))
+                self.debug(" Using XenServer volume_name: %s" % (volume_name))
+                ret = checkVolumeSize(ssh_handle=ssh,volume_name=volume_name,size_to_verify=vol_sz)
+            else:
+                ret = checkVolumeSize(ssh_handle=ssh,size_to_verify=vol_sz)
             self.debug(" Volume Size Expected %s  Actual :%s" %(vol_sz,ret[1]))
             self.virtual_machine.detach_volume(self.apiClient, volume)
             self.assertEqual(ret[0],SUCCESS,"Check if promised disk size actually available")

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a0500748/tools/marvin/marvin/lib/utils.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/lib/utils.py b/tools/marvin/marvin/lib/utils.py
index bdf5c09..c94afd5 100644
--- a/tools/marvin/marvin/lib/utils.py
+++ b/tools/marvin/marvin/lib/utils.py
@@ -508,10 +508,9 @@ def checkVolumeSize(ssh_handle=None,
             fdisk_output = ssh_handle.runCommand(cmd_inp)
             if fdisk_output["status"] != SUCCESS:
                 return FAILED
-            temp_out = fdisk_output["stdout"]
-            for line in temp_out.split("\n"):
+            for line in fdisk_output["stdout"]:
                 if volume_name in line:
-                    parts = line.split()
+                    parts = line.strip().split()
                     if str(parts[-2]) == str(size_to_verify):
                         return [SUCCESS, str(parts[-2])]
             return [FAILED, "Volume Not Found"]


Mime
View raw message