You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ta...@apache.org on 2014/05/21 13:56:39 UTC

git commit: updated refs/heads/4.4-forward to 751f0ac

Repository: cloudstack
Updated Branches:
  refs/heads/4.4-forward e5de1cb7c -> 751f0ac51


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 <ta...@apache.org>


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

Branch: refs/heads/4.4-forward
Commit: 751f0ac5185c832b30e65d271af8d08469202329
Parents: e5de1cb
Author: Doug Clark <do...@citrix.com>
Authored: Wed May 21 11:36:11 2014 +0000
Committer: SrikanteswaraRao Talluri <ta...@apache.org>
Committed: Wed May 21 17:25:56 2014 +0530

----------------------------------------------------------------------
 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/751f0ac5/test/integration/smoke/test_volumes.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py
index c8fc26b..cc76e49 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/751f0ac5/tools/marvin/marvin/lib/utils.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/lib/utils.py b/tools/marvin/marvin/lib/utils.py
index 4194e32..60a15ea 100644
--- a/tools/marvin/marvin/lib/utils.py
+++ b/tools/marvin/marvin/lib/utils.py
@@ -502,10 +502,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"]