Adam Litke has uploaded a new change for review.
Change subject: tests: FakeLVM create inactive LV ......................................................................
tests: FakeLVM create inactive LV
Test that the 'activate' argument of createLV results in the appropriate values in the LV properties.
Change-Id: I304e00116c5dc4c98555eb3951fe8eb33d65da7f Signed-off-by: Adam Litke alitke@redhat.com --- M tests/storagefakelib.py M tests/storagefakelibTests.py 2 files changed, 30 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/60/47860/1
diff --git a/tests/storagefakelib.py b/tests/storagefakelib.py index 52dce33..3c20a7c 100644 --- a/tests/storagefakelib.py +++ b/tests/storagefakelib.py @@ -83,11 +83,12 @@ # works the same as for LVM). Since we don't need this value, use None devices = None
+ state = 'a' if activate else '-' lv_attr = dict(voltype='-', permission='w', allocations='i', fixedminor='-', - state='a', + state=state, devopen='-', target='-', zero='-') @@ -101,7 +102,7 @@ tags=(), writeable=True, opened=False, - active=True) + active=bool(activate))
vg_dict = self.lvmd.setdefault(vgName, {}) vg_dict[lvName] = lv_md diff --git a/tests/storagefakelibTests.py b/tests/storagefakelibTests.py index a80a9a2..7be6c10 100644 --- a/tests/storagefakelibTests.py +++ b/tests/storagefakelibTests.py @@ -195,3 +195,30 @@ with self.base_config() as lvm: lv = self.lv_config(lvm) self.assertIsNone(lv.devices) + + def test_lv_no_activate(self): + """ + Create a logical volume with activate=False. + + lvm.createLV('1ffead52-7363-4968-a8c7-3bc34504d452', + '54e3378a-b2f6-46ff-b2da-a9c82522a55e', + '1024', activate=False) + + print lvm.getLV('1ffead52-7363-4968-a8c7-3bc34504d452', + '54e3378a-b2f6-46ff-b2da-a9c82522a55e') + LV(uuid='dDbzkJ-RSAQ-0CdJ-1pTD-OdqZ-3my2-v3hSUT', + name='54e3378a-b2f6-46ff-b2da-a9c82522a55e', + vg_name='1ffead52-7363-4968-a8c7-3bc34504d452', + attr=LV_ATTR(voltype='-', permission='w', allocations='i', + fixedminor='-', state='-', devopen='-', target='-', + zero='-'), + size='1073741824', seg_start_pe='0', + devices='/dev/mapper/360014054d75cb132d474c0eae9825766(0)', tags=(), + writeable=True, opened=False, active=False) + """ + with self.base_config() as lvm: + lvm.createLV(self.VG_NAME, self.LV_NAME, str(self.LV_SIZE_MB), + activate=False) + lv = lvm.getLV(self.VG_NAME, self.LV_NAME) + self.assertFalse(lv.active) + self.assertEqual('-', lv.attr.state)
automation@ovirt.org has posted comments on this change.
Change subject: tests: FakeLVM create inactive LV ......................................................................
Patch Set 1:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: tests: FakeLVM create inactive LV ......................................................................
Patch Set 2:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: tests: FakeLVM create inactive LV ......................................................................
Patch Set 3:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: tests: FakeLVM create inactive LV ......................................................................
Patch Set 4:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Nir Soffer has posted comments on this change.
Change subject: tests: FakeLVM create inactive LV ......................................................................
Patch Set 4: Code-Review+2
automation@ovirt.org has posted comments on this change.
Change subject: tests: FakeLVM create inactive LV ......................................................................
Patch Set 5:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Adam Litke has posted comments on this change.
Change subject: tests: FakeLVM create inactive LV ......................................................................
Patch Set 5: Verified+1
Dan Kenigsberg has submitted this change and it was merged.
Change subject: tests: FakeLVM create inactive LV ......................................................................
tests: FakeLVM create inactive LV
Test that the 'activate' argument of createLV results in the appropriate values in the LV properties.
Change-Id: I304e00116c5dc4c98555eb3951fe8eb33d65da7f Signed-off-by: Adam Litke alitke@redhat.com Reviewed-on: https://gerrit.ovirt.org/47860 Reviewed-by: Nir Soffer nsoffer@redhat.com Continuous-Integration: Jenkins CI --- M tests/storagefakelib.py M tests/storagefakelibTests.py 2 files changed, 30 insertions(+), 2 deletions(-)
Approvals: Adam Litke: Verified Nir Soffer: Looks good to me, approved Jenkins CI: Passed CI tests
automation@ovirt.org has posted comments on this change.
Change subject: tests: FakeLVM create inactive LV ......................................................................
Patch Set 6:
* Update tracker: IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found.
vdsm-patches@lists.fedorahosted.org