Change in vdsm[master]: tests: FakeLVM add lvPath test

nsoffer at redhat.com nsoffer at redhat.com
Mon Nov 9 16:37:41 UTC 2015


Nir Soffer has posted comments on this change.

Change subject: tests: FakeLVM add lvPath test
......................................................................


Patch Set 6: Code-Review-1

(1 comment)

https://gerrit.ovirt.org/#/c/47863/6/tests/storagefakelib.py
File tests/storagefakelib.py:

Line 35:     def __init__(self, root=None):
Line 36:         if root:
Line 37:             os.mkdir(os.path.join(root, 'dev'))
Line 38:         else:
Line 39:             root = '/'
This may cause tests running as root to dirty the real host. I don't think we need a default, using None will just cause lvm.root related operations to fail.

If we must have a root directory, we should create the directory in __enter__ and delete it in __exit__, so you can do this:

    with FakeLVM() as lvm:
        ...

Test code that need access to lvm tempoary diretory can access lvm.root.
Line 40:         self.root = root
Line 41: 
Line 42:         self.pvmd = {}
Line 43:         self.vgmd = {}


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I46be518e68069412199dfb7ee44c7b7a8a207236
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list