Denis Vlasenko | 5d62462 | 2008-07-08 02:57:40 +0000 | [diff] [blame] | 1 | #!/bin/sh |
Denis Vlasenko | 5d62462 | 2008-07-08 02:57:40 +0000 | [diff] [blame] | 2 | # Copyright 2007 by Denys Vlasenko <vda.linux@googlemail.com> |
| 3 | # Licensed under GPL v2, see file LICENSE for details. |
| 4 | |
Mike Frysinger | caa7940 | 2009-11-04 18:41:22 -0500 | [diff] [blame] | 5 | . ./testing.sh |
Denis Vlasenko | 5d62462 | 2008-07-08 02:57:40 +0000 | [diff] [blame] | 6 | |
| 7 | test "`id -u`" = 0 || { |
| 8 | echo "SKIPPED: must be root to test this" |
| 9 | exit 0 |
| 10 | } |
| 11 | |
Denys Vlasenko | c1fc3d3 | 2009-07-18 17:22:03 +0200 | [diff] [blame] | 12 | testdir=$PWD/testdir |
| 13 | |
Denys Vlasenko | 6ae6426 | 2009-07-18 16:22:26 +0200 | [diff] [blame] | 14 | dd if=/dev/zero of=mount.image1m count=1 bs=1M 2>/dev/null || { echo "dd error"; exit 1; } |
| 15 | mkfs.minix -v mount.image1m >/dev/null 2>&1 || { echo "mkfs.minix error"; exit 1; } |
Denys Vlasenko | c1fc3d3 | 2009-07-18 17:22:03 +0200 | [diff] [blame] | 16 | modprobe minix 2>/dev/null |
| 17 | mkdir "$testdir" 2>/dev/null |
| 18 | umount -d "$testdir" 2>/dev/null |
Denis Vlasenko | 5d62462 | 2008-07-08 02:57:40 +0000 | [diff] [blame] | 19 | |
| 20 | # testing "test name" "command" "expected result" "file input" "stdin" |
| 21 | # file input will be file called "input" |
| 22 | # test can create a file "actual" instead of writing to stdout |
| 23 | |
| 24 | testing "mount -o remount,mand" \ |
Denis Vlasenko | abe49fa | 2008-07-11 21:41:14 +0000 | [diff] [blame] | 25 | "mount -o loop mount.image1m $testdir "\ |
Denis Vlasenko | 5d62462 | 2008-07-08 02:57:40 +0000 | [diff] [blame] | 26 | "&& grep -Fc $testdir </proc/mounts "\ |
| 27 | "&& mount -o remount,mand $testdir "\ |
| 28 | "&& grep -F $testdir </proc/mounts | grep -c '[, ]mand[, ]'" \ |
| 29 | "1\n""1\n" \ |
| 30 | "" "" |
| 31 | |
Denys Vlasenko | c1fc3d3 | 2009-07-18 17:22:03 +0200 | [diff] [blame] | 32 | umount -d "$testdir" |
| 33 | rmdir "$testdir" |
Denis Vlasenko | abe49fa | 2008-07-11 21:41:14 +0000 | [diff] [blame] | 34 | rm mount.image1m |
Denis Vlasenko | 5d62462 | 2008-07-08 02:57:40 +0000 | [diff] [blame] | 35 | |
| 36 | exit $FAILCOUNT |