From ce11301210c9dadfb86cdbfd04a4aec07c5c10a2 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 22 Mar 2007 01:28:44 +0100 Subject: [PATCH] tests: add test for /sbin/mount. call Signed-off-by: Karel Zak --- tests/Makefile.am | 3 ++- tests/expected/ts-mount-special | 13 ++++++++++++ tests/ts-mount-special | 37 +++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 tests/expected/ts-mount-special create mode 100755 tests/ts-mount-special diff --git a/tests/Makefile.am b/tests/Makefile.am index d2e93625..6f3b2e5e 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 00000000..fb472079 --- /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 00000000..b2ea77d6 --- /dev/null +++ b/tests/ts-mount-special @@ -0,0 +1,37 @@ +#!/bin/bash + +# +# test for /sbin/mount. 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 + -- 2.39.5