aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-03-14 06:28:28 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-03-14 06:28:28 +0100
commitc2fda8642dc917e3a95f1a556b0876249a1bb321 (patch)
tree85701c2264676b8e606f076a4285885cc004d13c /testsuite
parentcf8b55c40b65a30a6b397f66658d83f0f31f4ed1 (diff)
downloadbusybox-c2fda8642dc917e3a95f1a556b0876249a1bb321.tar.gz
mount: add a test for bind+rshared
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/mount.tests39
1 files changed, 38 insertions, 1 deletions
diff --git a/testsuite/mount.tests b/testsuite/mount.tests
index d3d2400e8..58eeb2ec5 100755
--- a/testsuite/mount.tests
+++ b/testsuite/mount.tests
@@ -20,7 +20,7 @@ if test x"$CONFIG_MKFS_MINIX" != x"y" \
exit 0
fi
-testdir=$PWD/mount.testdir
+testdir="$PWD/mount.testdir"
dd if=/dev/zero of=mount.image1m count=1 bs=1M 2>/dev/null || { echo "dd error"; exit 1; }
mkfs.minix -v mount.image1m >/dev/null 2>&1 || { echo "mkfs.minix error"; exit 1; }
@@ -44,4 +44,41 @@ umount -d "$testdir"
rmdir "$testdir"
rm mount.image1m
+
+# Bug: mount.shared1 directory shows no files (has to show files a and b)
+testing "mount bind+rshared" "\
+mkdir -p mount.dir mount.shared1 mount.shared2
+touch mount.dir/a mount.dir/b
+
+mount --bind mount.shared1 mount.shared1 2>&1
+mount --make-rshared mount.shared1 2>&1
+mount --bind mount.shared2 mount.shared2 2>&1
+mount --make-rshared mount.shared2 2>&1
+
+mount --bind mount.shared2 mount.shared1 2>&1
+mount --bind mount.dir mount.shared2 2>&1
+
+ls -R mount.dir mount.shared1 mount.shared2 2>&1
+
+umount mount.dir mount.shared1 mount.shared2 2>/dev/null
+umount mount.dir mount.shared1 mount.shared2 2>/dev/null
+umount mount.dir mount.shared1 mount.shared2 2>/dev/null
+rm -f mount.dir/a mount.dir/b mount.dir/c
+rmdir mount.dir mount.shared1 mount.shared2
+" \
+"\
+mount.dir:
+a
+b
+
+mount.shared1:
+a
+b
+
+mount.shared2:
+a
+b
+" \
+ "" ""
+
exit $FAILCOUNT