summaryrefslogtreecommitdiffstats
path: root/tests/ts/mount/special
diff options
context:
space:
mode:
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