aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2016-10-20 18:24:24 +0200
committerKarel Zak <kzak@redhat.com>2016-10-20 18:27:24 +0200
commitd22f7f7c1ee428c6f3d427b1c8b569af45527d01 (patch)
treef1db9773351bf96ec64f9347723adb0712b97539
parent9d328f82d78cbfd03f8d967a15446309e23b1e64 (diff)
downloadutil-linux-d22f7f7c1ee428c6f3d427b1c8b569af45527d01.tar.gz
tests: call umount --fake for tmpfs tests
On old systems (e.g. RHEL6) with /sbin/mount.tmpfs the mtab file is modified although our in-tree mount does not support mtab file. We need to call umount --fake to be sure that we remove unwanted lines from the test. Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
-rwxr-xr-xtests/ts/mount/fstab-broken14
-rwxr-xr-xtests/ts/mount/fstab-none3
2 files changed, 15 insertions, 2 deletions
diff --git a/tests/ts/mount/fstab-broken b/tests/ts/mount/fstab-broken
index f67d35cb14..67dfa6e812 100755
--- a/tests/ts/mount/fstab-broken
+++ b/tests/ts/mount/fstab-broken
@@ -45,7 +45,12 @@ else
ts_log "OK"
fi
$TS_CMD_UMOUNT $MNT &> /dev/null
-[ "$?" = "0" ] || ts_log "error: umount $MNT"
+if [ "$?" = "0" ]; then
+ # for old systems with mtab and /sbin/mount.tmpfs
+ /bin/umount --fake "$MNT" &> /dev/null
+else
+ ts_log "error: umount $MNT"
+fi
ts_finalize_subtest
@@ -59,7 +64,12 @@ else
ts_log "OK"
fi
$TS_CMD_UMOUNT $MNT &> /dev/null
-[ "$?" = "0" ] || ts_log "error: umount $MNT"
+if [ "$?" = "0" ]; then
+ # for old systems with mtab and /sbin/mount.tmpfs
+ /bin/umount --fake $MNT &> /dev/null
+else
+ ts_log "error: umount $MNT"
+fi
ts_finalize_subtest
ts_fstab_clean
diff --git a/tests/ts/mount/fstab-none b/tests/ts/mount/fstab-none
index ff610a6072..65b3b7a5a7 100755
--- a/tests/ts/mount/fstab-none
+++ b/tests/ts/mount/fstab-none
@@ -27,6 +27,9 @@ $TS_CMD_FINDMNT --source "none" --mountpoint "$TS_MOUNTPOINT" &> /dev/null
$TS_CMD_UMOUNT $TS_MOUNTPOINT || ts_die "Cannot umount $TS_MOUNTPOINT"
+# for old systems with mtab and /sbin/mount.tmpfs
+/bin/umount --fake "$TS_MOUNTPOINT" &> /dev/null
+
ts_fstab_clean
ts_log "Success"