Adam Litke has uploaded a new change for review. Change subject: tests: FakeLVM: Always create lv file ......................................................................
tests: FakeLVM: Always create lv file When creating Fake LVs always create a regular file at lvm.lvPath(...) of the size passed into lvm.createLV. This makes sure that storage code will be able read from and write to the fake LV. Change-Id: Ia364588a9fbe3a987b9117522db025e92c8ed296 Signed-off-by: Adam Litke <ali...@redhat.com> --- M tests/storagefakelib.py M tests/storagetestlib.py 2 files changed, 4 insertions(+), 6 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/69/56169/1 diff --git a/tests/storagefakelib.py b/tests/storagefakelib.py index b17a526..320842a 100644 --- a/tests/storagefakelib.py +++ b/tests/storagefakelib.py @@ -23,7 +23,7 @@ from contextlib import contextmanager from copy import deepcopy -from testlib import recorded +from testlib import make_file, recorded from vdsm.storage import exception as se @@ -133,6 +133,9 @@ self.lvmd[(vgName, lvName)] = lv_md self.vgmd[vgName]['lv_count'] = str(lv_count) + # Create a regular file so we have a place to write data + make_file(self.lvPath(vgName, lvName), int(size)) + def activateLVs(self, vgName, lvNames): for lv in lvNames: try: diff --git a/tests/storagetestlib.py b/tests/storagetestlib.py index 236adb4..ebe2e0d 100644 --- a/tests/storagetestlib.py +++ b/tests/storagetestlib.py @@ -90,11 +90,6 @@ blockSD.VG_METADATASIZE) fake_lvm.createLV(sduuid, sd.METADATA, blockSD.SD_METADATA_SIZE) - # Create the metadata LV for storing volume metadata - metafile_path = fake_lvm.lvPath(sduuid, sd.METADATA) - make_file(metafile_path, - blockSD.BlockStorageDomainManifest.metaSize(sduuid) * MB) - # Create the rest of the special LVs for metafile, sizemb in sd.SPECIAL_VOLUME_SIZES_MIB.iteritems(): fake_lvm.createLV(sduuid, metafile, sizemb) -- To view, visit https://gerrit.ovirt.org/56169 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia364588a9fbe3a987b9117522db025e92c8ed296 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke <ali...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches