summaryrefslogtreecommitdiffstats
path: root/tests/ts/mount/fstab-bind
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:10:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:10:49 +0000
commitcfe5e3905201349e9cf3f95d52ff4bd100bde37d (patch)
treed0baf160cbee3195249d095f85e52d20c21acf02 /tests/ts/mount/fstab-bind
parentInitial commit. (diff)
downloadutil-linux-cfe5e3905201349e9cf3f95d52ff4bd100bde37d.tar.xz
util-linux-cfe5e3905201349e9cf3f95d52ff4bd100bde37d.zip
Adding upstream version 2.39.3.upstream/2.39.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ts/mount/fstab-bind')
-rwxr-xr-xtests/ts/mount/fstab-bind35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/ts/mount/fstab-bind b/tests/ts/mount/fstab-bind
new file mode 100755
index 0000000..2c799df
--- /dev/null
+++ b/tests/ts/mount/fstab-bind
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="fstab-bind"
+
+. "$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_skip_docker
+
+MY_SOURCE="${TS_MOUNTPOINT}-src"
+
+ts_fstab_add $MY_SOURCE "$TS_MOUNTPOINT" "none" "bind,default,noauto"
+
+mkdir -p $MY_SOURCE
+mkdir -p $TS_MOUNTPOINT
+
+$TS_CMD_MOUNT $TS_MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG
+[ "$?" = "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_UMOUNT $TS_MOUNTPOINT || ts_die "Cannot umount $TS_MOUNTPOINT"
+
+ts_fstab_clean
+
+ts_log "Success"
+ts_finalize
+