summaryrefslogtreecommitdiffstats
path: root/tests/ts/mount/special
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:30 +0000
commitc61e14d3a8412cd50d98aab604e607692c844c8a (patch)
tree4925aca0e6b64c8664ea2f3fdfa99a52dc93d5da /tests/ts/mount/special
parentAdding upstream version 2.39.3. (diff)
downloadutil-linux-c61e14d3a8412cd50d98aab604e607692c844c8a.tar.xz
util-linux-c61e14d3a8412cd50d98aab604e607692c844c8a.zip
Adding upstream version 2.40.upstream/2.40
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ts/mount/special')
-rwxr-xr-xtests/ts/mount/special43
1 files changed, 41 insertions, 2 deletions
diff --git a/tests/ts/mount/special b/tests/ts/mount/special
index 359d8aa..1771f5a 100755
--- a/tests/ts/mount/special
+++ b/tests/ts/mount/special
@@ -23,6 +23,7 @@ MOUNTER="/sbin/mount.mytest"
ts_init "$*"
ts_check_test_command "$TS_CMD_MOUNT"
+ts_check_test_command "$TS_CMD_UMOUNT"
ts_skip_nonroot
@@ -55,7 +56,45 @@ ts_init_subtest "username"
$TS_CMD_MOUNT -t mytest -ouser=name,abc /foo /bar &> $TS_OUTPUT
ts_finalize_subtest
-rm -f $MOUNTER
-ts_finalize
+ts_init_subtest "missing-options"
+grep -q 'nodev[[:space:]]*tmpfs' /proc/filesystems
+if [ "$?" == "0" ]; then
+cat > $MOUNTER <<EOF
+#!/bin/bash
+# This util-linux regression test component
+# It's safe to remove me...
+#
+exec $TS_CMD_MOUNT -t tmpfs -i "\$1" "\$2" -o x-foo=123
+EOF
+ chmod +x $MOUNTER
+
+ mountpoint="$TS_OUTDIR/mnt"
+ mkdir -p "$mountpoint"
+ export LIBMOUNT_UTAB=$TS_OUTDIR/utab
+ rm -f $LIBMOUNT_UTAB
+ echo -n "" > $LIBMOUNT_UTAB
+
+ $TS_CMD_MOUNT -t mytest -o x-bar=BAR /foo "$mountpoint" &> $TS_OUTPUT
+ udevadm settle
+
+ grep -q "$mountpoint" /proc/mounts
+ if [ "$?" == "0" ]; then
+ cat "$LIBMOUNT_UTAB" \
+ | grep "$mountpoint" \
+ | sed -e "s|$mountpoint|/mountpoint|g" \
+ -e 's/ID=[[:digit:]]* //g' \
+ &> $TS_OUTPUT
+ $TS_CMD_UMOUNT "$mountpoint"
+ unset LIBMOUNT_UTAB
+ rm -f $MOUNTER
+ ts_finalize_subtest
+ else
+ ts_skip_subtest "tmpfs not mounted"
+ fi
+else
+ ts_skip_subtest "tmpfs unsupported"
+fi
+
+ts_finalize