]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Remove suffixes from LVM brick test vgs output
authorJon Bernard <jobernar@redhat.com>
Tue, 19 Nov 2013 17:06:52 +0000 (12:06 -0500)
committerJon Bernard <jobernar@redhat.com>
Thu, 21 Nov 2013 23:03:16 +0000 (18:03 -0500)
When fake_execute() is called to retrieve volume group information, the
--nosuffix flag is passed but ignored.  This patch honors the nosuffix
flag and removes the unit suffix from the volume group sizes in the
returned output.

Change-Id: I45f41bc58f4ffb4bd527336c0f760350cff7c355

cinder/tests/brick/test_brick_lvm.py

index 9d5218b732765bc242022938510f7e3c4321610c..6802e908aee6f83c2ff8fbab1c76e16b2905cf2e 100644 (file)
@@ -75,15 +75,16 @@ class BrickLvmTestCase(test.TestCase):
             data = "  LVM version:     2.02.95(2) (2012-03-06)\n"
         elif 'vgs, --noheadings, -o uuid, fake-volumes' in cmd_string:
             data = "  kVxztV-dKpG-Rz7E-xtKY-jeju-QsYU-SLG6Z1\n"
-        elif 'vgs, --noheadings, --unit=g, -o, name,size,free,lv_count,uuid'\
-                in cmd_string:
-            data = "  fake-volumes:10.00g:10.00g:0:"\
+        elif 'vgs, --noheadings, --unit=g, ' \
+             '-o, name,size,free,lv_count,uuid, ' \
+             '--separator, :, --nosuffix' in cmd_string:
+            data = "  fake-volumes:10.00:10.00:0:"\
                    "kVxztV-dKpG-Rz7E-xtKY-jeju-QsYU-SLG6Z1\n"
             if 'fake-volumes' in cmd_string:
                 return (data, "")
-            data += "  fake-volumes-2:10.00g:10.00g:0:"\
+            data += "  fake-volumes-2:10.00:10.00:0:"\
                     "lWyauW-dKpG-Rz7E-xtKY-jeju-QsYU-SLG7Z2\n"
-            data += "  fake-volumes-3:10.00g:10.00g:0:"\
+            data += "  fake-volumes-3:10.00:10.00:0:"\
                     "mXzbuX-dKpG-Rz7E-xtKY-jeju-QsYU-SLG8Z3\n"
         elif 'lvs, --noheadings, --unit=g, -o, vg_name,name,size'\
                 in cmd_string: