diff options
author | Karel Zak | 2007-03-22 01:28:44 +0100 |
---|---|---|
committer | Karel Zak | 2007-03-22 01:28:44 +0100 |
commit | ce11301210c9dadfb86cdbfd04a4aec07c5c10a2 (patch) | |
tree | 47be69fb8bc52a1c485da8c0d3041fde9e3100e5 /tests | |
parent | newgrp: add support for /etc/gshadow (diff) | |
download | kernel-qcow2-util-linux-ce11301210c9dadfb86cdbfd04a4aec07c5c10a2.tar.gz kernel-qcow2-util-linux-ce11301210c9dadfb86cdbfd04a4aec07c5c10a2.tar.xz kernel-qcow2-util-linux-ce11301210c9dadfb86cdbfd04a4aec07c5c10a2.zip |
tests: add test for /sbin/mount.<type> call
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 3 | ||||
-rw-r--r-- | tests/expected/ts-mount-special | 13 | ||||
-rwxr-xr-x | tests/ts-mount-special | 37 |
3 files changed, 52 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index d2e93625b..6f3b2e5e9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 index 000000000..fb472079d --- /dev/null +++ b/tests/expected/ts-mount-special @@ -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 index 000000000..b2ea77d67 --- /dev/null +++ b/tests/ts-mount-special @@ -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 + |