cd9c77
From a4d1feed2803a5c0596877b64487734bcdb781ef Mon Sep 17 00:00:00 2001
cd9c77
From: Karel Zak <kzak@redhat.com>
cd9c77
Date: Mon, 23 Aug 2021 16:28:52 +0200
cd9c77
Subject: tests: make mount/fstab-all more robust
cd9c77
cd9c77
Upstream: http://github.com/karelzak/util-linux/commit/85ae61dd6d956e7c9fe2b22b8c46bb1d0bfd13da
cd9c77
Signed-off-by: Karel Zak <kzak@redhat.com>
cd9c77
---
cd9c77
 tests/ts/mount/fstab-all | 6 ++++++
cd9c77
 1 file changed, 6 insertions(+)
cd9c77
cd9c77
diff --git a/tests/ts/mount/fstab-all b/tests/ts/mount/fstab-all
cd9c77
index acc64e462..6b7018823 100755
cd9c77
--- a/tests/ts/mount/fstab-all
cd9c77
+++ b/tests/ts/mount/fstab-all
cd9c77
@@ -79,6 +79,7 @@ echo  "${TS_DEVICE}4 ${MOUNTPOINT}D ext4 rw,defaults 0 0" >> $MY_FSTAB
cd9c77
 ts_init_subtest "basic"
cd9c77
 $TS_CMD_MOUNT --all --fstab $MY_FSTAB >> $TS_OUTPUT 2>> $TS_ERRLOG
cd9c77
 [ $? == 0 ] || ts_log "mount failed"
cd9c77
+udevadm settle
cd9c77
 $TS_CMD_UMOUNT ${MOUNTPOINT}{A,B,C,D}
cd9c77
 [ $? == 0 ] || ts_log "umount failed"
cd9c77
 ts_finalize_subtest
cd9c77
@@ -87,6 +88,7 @@ ts_finalize_subtest
cd9c77
 ts_init_subtest "filter-type"
cd9c77
 $TS_CMD_MOUNT --all --fstab $MY_FSTAB -t ext4 >> $TS_OUTPUT 2>> $TS_ERRLOG
cd9c77
 [ $? == 0 ] || ts_log "mount failed"
cd9c77
+udevadm settle
cd9c77
 $TS_CMD_UMOUNT ${MOUNTPOINT}D
cd9c77
 [ $? == 0 ] || ts_log "umount failed"
cd9c77
 ts_finalize_subtest
cd9c77
@@ -95,6 +97,7 @@ ts_finalize_subtest
cd9c77
 ts_init_subtest "filter-notype"
cd9c77
 $TS_CMD_MOUNT --all --fstab $MY_FSTAB -t noext4 >> $TS_OUTPUT 2>> $TS_ERRLOG
cd9c77
 [ $? == 0 ] || ts_log "mount failed"
cd9c77
+udevadm settle
cd9c77
 $TS_CMD_UMOUNT ${MOUNTPOINT}{A,B,C}
cd9c77
 [ $? == 0 ] || ts_log "umount failed"
cd9c77
 ts_finalize_subtest
cd9c77
@@ -103,6 +106,7 @@ ts_finalize_subtest
cd9c77
 ts_init_subtest "filter-option"
cd9c77
 $TS_CMD_MOUNT --all --fstab $MY_FSTAB -O ro >> $TS_OUTPUT 2>> $TS_ERRLOG
cd9c77
 [ $? == 0 ] || ts_log "mount failed"
cd9c77
+udevadm settle
cd9c77
 $TS_CMD_UMOUNT ${MOUNTPOINT}C
cd9c77
 [ $? == 0 ] || ts_log "umount failed"
cd9c77
 ts_finalize_subtest
cd9c77
@@ -111,6 +115,7 @@ ts_finalize_subtest
cd9c77
 ts_init_subtest "override-option"
cd9c77
 $TS_CMD_MOUNT --all --fstab $MY_FSTAB -o ro >> $TS_OUTPUT 2>> $TS_ERRLOG
cd9c77
 [ $? == 0 ] || ts_log "mount failed"
cd9c77
+udevadm settle
cd9c77
 $TS_CMD_UMOUNT ${MOUNTPOINT}{A,B,C,D}
cd9c77
 [ $? == 0 ] || ts_log "umount failed"
cd9c77
 ts_finalize_subtest
cd9c77
@@ -132,6 +137,7 @@ $TS_CMD_MOUNT	--all \
cd9c77
 		--target-prefix $MY_ROOT \
cd9c77
 		-o X-mount.mkdir >> $TS_OUTPUT 2>> $TS_ERRLOG
cd9c77
 [ $? == 0 ] || ts_log "mount failed"
cd9c77
+udevadm settle
cd9c77
 $TS_CMD_UMOUNT $MY_ROOT/foo/{A,B,C,D}
cd9c77
 [ $? == 0 ] || ts_log "umount failed"
cd9c77
 ts_finalize_subtest
cd9c77
-- 
cd9c77
2.34.1
cd9c77