summaryrefslogtreecommitdiffstats
path: root/tests/ts/mount/fstab-none
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 02:42:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 02:42:50 +0000
commit8cb83eee5a58b1fad74c34094ce3afb9e430b5a4 (patch)
treea9b2e7baeca1be40eb734371e3c8b11b02294497 /tests/ts/mount/fstab-none
parentInitial commit. (diff)
downloadutil-linux-8cb83eee5a58b1fad74c34094ce3afb9e430b5a4.tar.xz
util-linux-8cb83eee5a58b1fad74c34094ce3afb9e430b5a4.zip
Adding upstream version 2.33.1.upstream/2.33.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ts/mount/fstab-none')
-rwxr-xr-xtests/ts/mount/fstab-none37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/ts/mount/fstab-none b/tests/ts/mount/fstab-none
new file mode 100755
index 0000000..65b3b7a
--- /dev/null
+++ b/tests/ts/mount/fstab-none
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="none"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_CMD_MOUNT"
+ts_check_test_command "$TS_CMD_UMOUNT"
+ts_check_test_command "$TS_CMD_FINDMNT"
+
+ts_skip_nonroot
+
+ts_fstab_add "none" "$TS_MOUNTPOINT" "tmpfs" "rw,nosuid,nodev,relatime"
+
+mkdir -p $TS_MOUNTPOINT
+
+$TS_CMD_MOUNT $TS_MOUNTPOINT >> $TS_OUTPUT 2>&1
+[ "$?" = "0" ] || ts_log "error: mount $TS_MOUNTPOINT"
+
+$TS_CMD_FINDMNT --mountpoint "$TS_MOUNTPOINT" &> /dev/null
+[ $? -eq 0 ] || ts_die "Not found target (mount failed?)"
+
+$TS_CMD_FINDMNT --source "none" --mountpoint "$TS_MOUNTPOINT" &> /dev/null
+[ $? -eq 0 ] || ts_die "Not found source and target"
+
+$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"
+ts_finalize
+