]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
test: test 'none' source for mount(8)
authorKarel Zak <kzak@redhat.com>
Mon, 27 Feb 2012 23:21:48 +0000 (00:21 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 27 Feb 2012 23:21:48 +0000 (00:21 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/expected/mount/fstab-none [new file with mode: 0644]
tests/ts/mount/fstab-none [new file with mode: 0755]

diff --git a/tests/expected/mount/fstab-none b/tests/expected/mount/fstab-none
new file mode 100644 (file)
index 0000000..3582111
--- /dev/null
@@ -0,0 +1 @@
+Success
diff --git a/tests/ts/mount/fstab-none b/tests/ts/mount/fstab-none
new file mode 100755 (executable)
index 0000000..7b254f9
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="none"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+ts_skip_nonroot
+
+set -o pipefail
+
+ts_fstab_add "none" "$TS_MOUNTPOINT" "tmpfs" "rw,nosuid,nodev,relatime"
+
+mkdir -p $TS_MOUNTPOINT
+
+$TS_CMD_MOUNT $TS_MOUNTPOINT 2>&1 >> $TS_OUTPUT
+findmnt --target "$TS_MOUNTPOINT" &> /dev/null
+[ $? -eq 0 ] || ts_die "Mount $TS_MOUNTPOINT failed"
+$TS_CMD_UMOUNT $TS_MOUNTPOINT || ts_die "Cannot umount $TS_MOUNTPOINT"
+
+ts_fstab_clean
+
+ts_log "Success"
+ts_finalize
+