summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2019-09-11 22:53:21 -0400
committerTavian Barnes <tavianator@tavianator.com>2019-09-11 22:53:31 -0400
commit7b6bbf9a65226f2c37a15a05f9185b32d51355f7 (patch)
treed9f8837b867ace98c59329b99bdcec957907762f
parenta107777ebf6c86a682c3fb2ff4a013fe5126b1b9 (diff)
downloadbfs-7b6bbf9a65226f2c37a15a05f9185b32d51355f7.tar.xz
tests: Add -mount/-xdev tests with -L
-rwxr-xr-xtests.sh32
-rw-r--r--tests/test_L_mount.out2
-rw-r--r--tests/test_L_xdev.out5
3 files changed, 39 insertions, 0 deletions
diff --git a/tests.sh b/tests.sh
index 3b1a5af..dde98b9 100755
--- a/tests.sh
+++ b/tests.sh
@@ -658,7 +658,9 @@ sudo_tests=(
test_L_xattr
test_mount
+ test_L_mount
test_xdev
+ test_L_xdev
test_inum_mount
test_inum_bind_mount
@@ -2297,6 +2299,21 @@ function test_mount() {
return $ret
}
+function test_L_mount() {
+ rm -rf scratch/*
+ mkdir scratch/{foo,mnt}
+ sudo mount -t tmpfs tmpfs scratch/mnt
+ ln -s ../mnt scratch/foo/bar
+ touch scratch/mnt/baz
+ ln -s ../mnt/baz scratch/foo/qux
+
+ bfs_diff -L scratch -mount
+ local ret=$?
+
+ sudo umount scratch/mnt
+ return $ret
+}
+
function test_xdev() {
rm -rf scratch/*
mkdir scratch/{foo,mnt}
@@ -2310,6 +2327,21 @@ function test_xdev() {
return $ret
}
+function test_L_xdev() {
+ rm -rf scratch/*
+ mkdir scratch/{foo,mnt}
+ sudo mount -t tmpfs tmpfs scratch/mnt
+ ln -s ../mnt scratch/foo/bar
+ touch scratch/mnt/baz
+ ln -s ../mnt/baz scratch/foo/qux
+
+ bfs_diff -L scratch -xdev
+ local ret=$?
+
+ sudo umount scratch/mnt
+ return $ret
+}
+
function test_inum_mount() {
rm -rf scratch/*
mkdir scratch/{foo,mnt}
diff --git a/tests/test_L_mount.out b/tests/test_L_mount.out
new file mode 100644
index 0000000..ed0e9a1
--- /dev/null
+++ b/tests/test_L_mount.out
@@ -0,0 +1,2 @@
+scratch
+scratch/foo
diff --git a/tests/test_L_xdev.out b/tests/test_L_xdev.out
new file mode 100644
index 0000000..2c3c590
--- /dev/null
+++ b/tests/test_L_xdev.out
@@ -0,0 +1,5 @@
+scratch
+scratch/foo
+scratch/mnt
+scratch/foo/bar
+scratch/foo/qux