]> err.no Git - util-linux/commitdiff
tests: add test for /sbin/mount.<type> call
authorKarel Zak <kzak@redhat.com>
Thu, 22 Mar 2007 00:28:44 +0000 (01:28 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 22 Mar 2007 00:28:44 +0000 (01:28 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/Makefile.am
tests/expected/ts-mount-special [new file with mode: 0644]
tests/ts-mount-special [new file with mode: 0755]

index d2e93625b220f0b54f78046703b60ed1e571a061..6f3b2e5e9c531c737fce6140ffb425204ae1a9c4 100644 (file)
@@ -18,7 +18,8 @@ EXTRA_DIST =  expected/* \
                ts-cramfs-mkfs \
                ts-look-separator \
                ts-login-checktty \
-               ts-hwclock-systohc
+               ts-hwclock-systohc \
+               ts-mount-special
 
 distclean-local:
        rm -rf output diff
diff --git a/tests/expected/ts-mount-special b/tests/expected/ts-mount-special
new file mode 100644 (file)
index 0000000..fb47207
--- /dev/null
@@ -0,0 +1,13 @@
+DEBUG: fstab path: "/etc/fstab"
+DEBUG: lock path:  "/etc/mtab~"
+DEBUG: temp path:  "/etc/mtab.tmp"
+DEBUG: spec:  "/foo"
+DEBUG: node:  "/bar"
+DEBUG: types: "mytest"
+DEBUG: opts:  "(null)"
+DEBUG: external mount: argv[0] = "/sbin/mount.mytest"
+DEBUG: external mount: argv[1] = "/foo"
+DEBUG: external mount: argv[2] = "/bar"
+DEBUG: external mount: argv[3] = "-o"
+DEBUG: external mount: argv[4] = "rw"
+/sbin/mount.mytest called with "/foo /bar -o rw"
diff --git a/tests/ts-mount-special b/tests/ts-mount-special
new file mode 100755 (executable)
index 0000000..b2ea77d
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+#
+# test for /sbin/mount.<type> suuport
+#
+
+. commands.sh
+. functions.sh
+
+TS_COMPONENT="mount"
+TS_DESC="special program"
+
+MOUNTER="/sbin/mount.mytest"
+
+ts_init
+
+touch $TS_OUTPUT
+
+if [ $UID != 0 ]; then
+       ts_skip "not root permissions"
+fi
+
+cat > $MOUNTER << EOF
+#!/bin/bash 
+# This util-linux-ng regression test component
+# It's safe to remove me...
+#
+echo "\$0 called with \"\$*\""
+EOF
+chmod +x $MOUNTER
+
+$TS_CMD_MOUNT --debug=2 -t mytest  /foo /bar &> $TS_OUTPUT
+
+rm -f $MOUNTER
+
+ts_finalize
+