Change in vdsm[master]: FakeLVM: support single LV and array in activateLVs

alitke at redhat.com alitke at redhat.com
Wed Dec 2 02:51:12 UTC 2015


Adam Litke has uploaded a new change for review.

Change subject: FakeLVM: support single LV and array in activateLVs
......................................................................

FakeLVM: support single LV and array in activateLVs

Change-Id: I091aab3c9ccab16e8d4d9693957a061afac1366d
Signed-off-by: Adam Litke <alitke at redhat.com>
---
M tests/storagefakelib.py
M tests/storagefakelibTests.py
2 files changed, 14 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/47/49547/1

diff --git a/tests/storagefakelib.py b/tests/storagefakelib.py
index 7d6092c..234cd57 100644
--- a/tests/storagefakelib.py
+++ b/tests/storagefakelib.py
@@ -126,6 +126,7 @@
         self.vgmd[vgName]['lv_count'] = str(lv_count)
 
     def activateLVs(self, vgName, lvNames):
+        lvNames = real_lvm._normalizeargs(lvNames)
         for lv in lvNames:
             try:
                 lv_md = self.lvmd[(vgName, lv)]
diff --git a/tests/storagefakelibTests.py b/tests/storagefakelibTests.py
index dcdfd19..f7bbfb2 100644
--- a/tests/storagefakelibTests.py
+++ b/tests/storagefakelibTests.py
@@ -29,6 +29,7 @@
 from storage import lvm as real_lvm
 
 
+ at expandPermutations
 class FakeLVMSimpleVGTests(VdsmTestCase):
     VG_NAME = '1ffead52-7363-4968-a8c7-3bc34504d452'
     DEVICES = ['360014054d75cb132d474c0eae9825766']
@@ -257,9 +258,14 @@
                               lvm.changeLVTags, self.VG_NAME, self.LV_NAME,
                               delTags=("FOO",), addTags=("FOO",))
 
-    def test_activatelv(self):
+    @permutations([
+        [LV_NAME],
+        [[LV_NAME]],
+    ])
+    def test_activatelv(self, lv_arg):
         """
-        Create an inactive LV and then activate it.
+        Create an inactive LV and then activate it.  Test that scalar and
+        array based values are handled properly.
 
         lvm.createLV('1ffead52-7363-4968-a8c7-3bc34504d452',
                      '54e3378a-b2f6-46ff-b2da-a9c82522a55e',
@@ -282,10 +288,11 @@
         with self.base_config() as lvm:
             lvm.createLV(self.VG_NAME, self.LV_NAME, str(self.LV_SIZE_MB),
                          activate=False)
-            lvm.activateLVs(self.VG_NAME, [self.LV_NAME])
-            lv = lvm.getLV(self.VG_NAME, self.LV_NAME)
-            self.assertTrue(lv.active)
-            self.assertEqual('a', lv.attr.state)
+            lvm.activateLVs(self.VG_NAME, lv_arg)
+            for lv_name in real_lvm._normalizeargs(lv_arg):
+                lv = lvm.getLV(self.VG_NAME, lv_name)
+                self.assertTrue(lv.active)
+                self.assertEqual('a', lv.attr.state)
 
 
 @expandPermutations


-- 
To view, visit https://gerrit.ovirt.org/49547
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I091aab3c9ccab16e8d4d9693957a061afac1366d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke at redhat.com>


More information about the vdsm-patches mailing list