Change in vdsm[master]: tests: Fix loop device leak in mount tests

nsoffer at redhat.com nsoffer at redhat.com
Mon Jan 11 17:23:51 UTC 2016


Nir Soffer has posted comments on this change.

Change subject: tests: Fix loop device leak in mount tests
......................................................................


Patch Set 1:

(2 comments)

https://gerrit.ovirt.org/#/c/51614/1/tests/mountTests.py
File tests/mountTests.py:

Line 131:                 m.mount(mntOpts="loop")
Line 132:                 try:
Line 133:                     self.assertTrue(m.isMounted())
Line 134:                 finally:
Line 135:                     m.umount(force=True, freeloop=True)
> Yep - Failing is better than silently ignoring it (which lazy would do)
In the tests, we are the owner of the loop device, and if we cannot unmount this is a major error. We really do not want to do lazy unmount.
Line 136:                     # TODO: Use libudev to wait for specific event
Line 137:                     with stopwatch("Wait for udev events"):
Line 138:                         udevadm.settle(5)
Line 139: 


Line 134:                 finally:
Line 135:                     m.umount(force=True, freeloop=True)
Line 136:                     # TODO: Use libudev to wait for specific event
Line 137:                     with stopwatch("Wait for udev events"):
Line 138:                         udevadm.settle(5)
Note that this wait is not good enough. When running this test 500 times (using permuations), we still get failures from time to time (EBUSY).

I'm checking more precise wait using pyudev monitor <https://pyudev.readthedocs.org/en/latest/api/pyudev.html#monitor-device-monitoring>.
Line 139: 
Line 140:     def testSymlinkMount(self):
Line 141:         checkSudo(["mount", "-o", "loop", "somefile", "target"])
Line 142:         checkSudo(["umount", "target"])


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iada8f3d962778c53ada4a6f0a7f3e75b80c07239
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list