]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Add test for brick.local_dev.lvm
authorAlexander Gorodnev <agorodnev@mirantis.com>
Tue, 6 Aug 2013 12:31:51 +0000 (08:31 -0400)
committerAlexander Gorodnev <agorodnev@mirantis.com>
Wed, 7 Aug 2013 07:04:06 +0000 (03:04 -0400)
Add positive and negative tests for LVM.lv_has_snapshot() method

Change-Id: Ibb261365eae97d8e3843ff48f7389f759226d2af

cinder/tests/brick/test_brick_lvm.py

index 96775cad8b484d3c0deb2102610128be28caada0..1751ece7d875d2acb98df1ff8197cda738b60b7a 100644 (file)
@@ -83,6 +83,11 @@ class BrickLvmTestCase(test.TestCase):
                 in cmd_string:
             data = "  fake-volumes fake-1 1.00g\n"
             data += "  fake-volumes fake-2 1.00g\n"
+        elif 'lvdisplay, --noheading, -C, -o, Attr' in cmd_string:
+            if 'test-volumes' in cmd_string:
+                data = '  wi-a-'
+            else:
+                data = '  owi-a-'
         elif 'pvs, --noheadings' and 'fake-volumes' in cmd_string:
             data = "  fake-volumes:/dev/sda:10.00g:8.99g\n"
         elif 'pvs, --noheadings' in cmd_string:
@@ -136,3 +141,7 @@ class BrickLvmTestCase(test.TestCase):
 
         self.stubs.Set(processutils, 'execute', self.fake_old_lvm_version)
         self.assertFalse(self.vg.supports_thin_provisioning())
+
+    def test_lv_has_snapshot(self):
+        self.assertTrue(self.vg.lv_has_snapshot('fake-volumes'))
+        self.assertFalse(self.vg.lv_has_snapshot('test-volumes'))