From aa00f7441d370d45996eec8d83bd00eff43721b5 Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Wed, 24 Jan 2018 00:20:15 +0100 Subject: [PATCH] tests: add wierd sleep for libmount/context I still don't understand why this helps to fix these tests on my system. udevadm settle had no positive effect. Adding the sleeps before "is_mounted" also didn't fixed that, that's amazing!? Below the test log, very often seen on my system since a long time: -------------------- util-linux regression tests -------------------- For development purpose only. Don't execute on production system! kernel: 4.4.104-39-default libmount: context: [01] mount-by-devname ... OK libmount: context: [02] umount-by-devname ... OK libmount: context: [03] mount-by-label ... OK libmount: context: [04] umount-by-mountpoint ... OK libmount: context: [05] mount-by-uuid ... FAILED (libmount/context-mount-by-uuid) libmount: context: [06] mount-flags ... FAILED (libmount/context-mount-flags) libmount: context: [07] mount-loopdev ... OK libmount: context: [08] x-mount.mkdir ... OK libmount: context: [09] X-mount.mkdir ... OK libmount: context ... FAILED (2 from 9 sub-tests) --------------------------------------------------------------------- 1 tests of 17 FAILED --------------------------------------------------------------------- rudi@zappa:~/devel/util-linux/build> cat tests/diff/libmount/context-mount-by-uuid --- /home/rudi/devel/util-linux/tests/expected/libmount/context-mount-by-uuid 2017-07-03 12:20:24.144845538 +0200 +++ /home/rudi/devel/util-linux/build/tests/output/libmount/context-mount-by-uuid 2018-01-24 00:42:18.549444408 +0100 @@ -1,2 +1,3 @@ successfully mounted -successfully umounted +failed to umount +FAILED [rc=16]/dev/sdb1 still mounted rudi@zappa:~/devel/util-linux/build> cat tests/diff/libmount/context-mount-flags --- /home/rudi/devel/util-linux/tests/expected/libmount/context-mount-flags 2017-07-03 12:20:24.148845497 +0200 +++ /home/rudi/devel/util-linux/build/tests/output/libmount/context-mount-flags 2018-01-24 00:42:18.725442931 +0100 @@ -1,5 +1,5 @@ +test_mount_context: failed to mount: Device or resource busy +FAILED [rc=16]rw,relatime successfully mounted -ro,nosuid,noexec -successfully mounted -rw,nosuid,noexec +rw,relatime successfully umounted Signed-off-by: Ruediger Meier --- tests/ts/libmount/context | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/ts/libmount/context b/tests/ts/libmount/context index 3b49801d49..5a4f36afa4 100755 --- a/tests/ts/libmount/context +++ b/tests/ts/libmount/context @@ -111,7 +111,9 @@ ts_init_subtest "mount-by-uuid" mkdir -p $MOUNTPOINT &> /dev/null ts_run $TESTPROG --mount UUID="$UUID" $MOUNTPOINT >> $TS_OUTPUT 2>&1 is_mounted $DEVICE || echo "$DEVICE not mounted" >> $TS_OUTPUT 2>&1 +sleep 1 ts_run $TESTPROG --umount $MOUNTPOINT >> $TS_OUTPUT 2>&1 +sleep 1 is_mounted $DEVICE && echo "$DEVICE still mounted" >> $TS_OUTPUT 2>&1 ts_finalize_subtest -- 2.47.3