Nir Soffer has uploaded a new change for review. Change subject: tests: Fix loop device leak in mount tests ......................................................................
tests: Fix loop device leak in mount tests We used to unmount loop devices without using force=True and freeloop=True. This may lead to loop device leak, failing the later tests trying to mount loop devices. We also did not wait for udev events when unmounting a loop device, which is asynchronous operation. Both issues were fixed long time ago in the mkimageTests. Apply the same fix for mount tests: Change-Id: Iada8f3d962778c53ada4a6f0a7f3e75b80c07239 Signed-off-by: Nir Soffer <[email protected]> --- M tests/mountTests.py 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/14/51614/1 diff --git a/tests/mountTests.py b/tests/mountTests.py index c0e05a2..f481ae2 100644 --- a/tests/mountTests.py +++ b/tests/mountTests.py @@ -25,6 +25,9 @@ import shutil import stat +from vdsm import udevadm +from vdsm.utils import stopwatch + from nose.plugins.skip import SkipTest from testlib import VdsmTestCase as TestCaseBase @@ -129,7 +132,10 @@ try: self.assertTrue(m.isMounted()) finally: - m.umount() + m.umount(force=True, freeloop=True) + # TODO: Use libudev to wait for specific event + with stopwatch("Wait for udev events"): + udevadm.settle(5) def testSymlinkMount(self): checkSudo(["mount", "-o", "loop", "somefile", "target"]) @@ -151,7 +157,10 @@ try: self.assertTrue(m.isMounted()) finally: - m.umount() + m.umount(force=True, freeloop=True) + # TODO: Use libudev to wait for specific event + with stopwatch("Wait for udev events"): + udevadm.settle(5) class IterMountsPerfTests(TestCaseBase): -- To view, visit https://gerrit.ovirt.org/51614 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iada8f3d962778c53ada4a6f0a7f3e75b80c07239 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
