From: Jon Bernard Date: Tue, 19 Nov 2013 17:06:52 +0000 (-0500) Subject: Remove suffixes from LVM brick test vgs output X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=a3ebe1fbaf90b0419a90c7b7dd6f76f59c676752;p=openstack-build%2Fcinder-build.git Remove suffixes from LVM brick test vgs output 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 --- diff --git a/cinder/tests/brick/test_brick_lvm.py b/cinder/tests/brick/test_brick_lvm.py index 9d5218b73..6802e908a 100644 --- a/cinder/tests/brick/test_brick_lvm.py +++ b/cinder/tests/brick/test_brick_lvm.py @@ -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: