Change in vdsm[ovirt-3.6]: tests: Wait for udev events after unmounting
fromani at redhat.com
fromani at redhat.com
Thu Oct 15 06:29:08 UTC 2015
Hello Piotr Kliczewski, Dan Kenigsberg,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/47343
to review the following change.
Change subject: tests: Wait for udev events after unmounting
......................................................................
tests: Wait for udev events after unmounting
Even after fixing unmounting of loop mounts using the freeLoop
parameter, we still have random mount failures like:
File "/home/.../vdsm/storage/mount.py", line 241, in _runcmd
raise MountError(rc, ";".join((out, err)))
MountError: (32, ';mount:
/tmp/vdsm-mkimage-tests.03sjxb/images/vmId_floppy...img:
failed to setup loop device: No such file or directory\n')
It seems that loop device detach is asynchronous, thanks to good old
udev. Waiting until things settle down can avoid this issue.
Change-Id: I4bd2737dae37f944cb314077a77b29c27db44677
X-Bug-Url: https://bugzilla.redhat.com/1268229
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
Signed-off-by: pkliczewski <piotr.kliczewski at gmail.com>
Reviewed-on: https://gerrit.ovirt.org/46702
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani <fromani at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M tests/mkimageTests.py
1 file changed, 8 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/43/47343/1
diff --git a/tests/mkimageTests.py b/tests/mkimageTests.py
index 601cad6..91dd9ac 100644
--- a/tests/mkimageTests.py
+++ b/tests/mkimageTests.py
@@ -35,7 +35,8 @@
from testlib import VdsmTestCase, permutations, expandPermutations
from testValidation import checkSudo, ValidateRunningAsRoot
-from vdsm.utils import execCmd
+from vdsm import udevadm
+from vdsm.utils import execCmd, stopwatch
import storage
import mkimage
@@ -176,6 +177,9 @@
self._check_label(floppy, label)
finally:
m.umount(force=True, freeloop=True)
+ # TODO: Use libudev to wait for specific event
+ with stopwatch("Wait for udev events"):
+ udevadm.settle(5)
@permutations([[None], ['fslabel']])
def test_mkIsoFs(self, label):
@@ -205,6 +209,9 @@
(stat.S_IXOTH, False)))
finally:
m.umount(force=True, freeloop=True)
+ # TODO: Use libudev to wait for specific event
+ with stopwatch("Wait for udev events"):
+ udevadm.settle(5)
def test_removeFs(self):
"""
--
To view, visit https://gerrit.ovirt.org/47343
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4bd2737dae37f944cb314077a77b29c27db44677
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
More information about the vdsm-patches
mailing list