summaryrefslogtreecommitdiffstats
path: root/tests/bsd
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-10-22 16:41:41 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-10-22 17:51:36 -0400
commita2af2746c4686201e2e0796fbdfa115d08727b86 (patch)
tree4127a4c813de4f4c91c92b0596b468cceac43a7b /tests/bsd
parentdd8ac68070176343a8781e67de4bbd6a071bb89d (diff)
downloadbfs-a2af2746c4686201e2e0796fbdfa115d08727b86.tar.xz
tests: Use test-specific scratch directories
Diffstat (limited to 'tests/bsd')
-rw-r--r--tests/bsd/L_acl.out4
-rw-r--r--tests/bsd/L_acl.sh12
-rw-r--r--tests/bsd/L_xattr.out6
-rw-r--r--tests/bsd/L_xattr.sh4
-rw-r--r--tests/bsd/L_xattrname.out4
-rw-r--r--tests/bsd/L_xattrname.sh6
-rw-r--r--tests/bsd/acl.out2
-rw-r--r--tests/bsd/acl.sh12
-rw-r--r--tests/bsd/flags.out2
-rw-r--r--tests/bsd/flags.sh10
-rw-r--r--tests/bsd/rm.out2
-rw-r--r--tests/bsd/rm.sh10
-rw-r--r--tests/bsd/type_w.out72
-rw-r--r--tests/bsd/type_w.sh36
-rw-r--r--tests/bsd/xattr.out6
-rw-r--r--tests/bsd/xattr.sh4
-rw-r--r--tests/bsd/xattrname.out4
-rw-r--r--tests/bsd/xattrname.sh6
18 files changed, 98 insertions, 104 deletions
diff --git a/tests/bsd/L_acl.out b/tests/bsd/L_acl.out
index 1dae00a..dd89800 100644
--- a/tests/bsd/L_acl.out
+++ b/tests/bsd/L_acl.out
@@ -1,2 +1,2 @@
-scratch/acl
-scratch/link
+./acl
+./link
diff --git a/tests/bsd/L_acl.sh b/tests/bsd/L_acl.sh
index db97013..a3fcbc8 100644
--- a/tests/bsd/L_acl.sh
+++ b/tests/bsd/L_acl.sh
@@ -1,9 +1,9 @@
-clean_scratch
+cd "$TEST"
-invoke_bfs scratch -quit -acl || skip
+invoke_bfs . -quit -acl || skip
-"$XTOUCH" scratch/{normal,acl}
-set_acl scratch/acl || skip
-ln -s acl scratch/link
+"$XTOUCH" normal acl
+set_acl acl || skip
+ln -s acl link
-bfs_diff -L scratch -acl
+bfs_diff -L . -acl
diff --git a/tests/bsd/L_xattr.out b/tests/bsd/L_xattr.out
index 12fac95..21eb50f 100644
--- a/tests/bsd/L_xattr.out
+++ b/tests/bsd/L_xattr.out
@@ -1,3 +1,3 @@
-scratch/link
-scratch/xattr
-scratch/xattr_2
+./link
+./xattr
+./xattr_2
diff --git a/tests/bsd/L_xattr.sh b/tests/bsd/L_xattr.sh
index 1f61c78..f8b56d8 100644
--- a/tests/bsd/L_xattr.sh
+++ b/tests/bsd/L_xattr.sh
@@ -1,3 +1,3 @@
-invoke_bfs scratch -quit -xattr || skip
+invoke_bfs . -quit -xattr || skip
make_xattrs || skip
-bfs_diff -L scratch -xattr
+bfs_diff -L . -xattr
diff --git a/tests/bsd/L_xattrname.out b/tests/bsd/L_xattrname.out
index 4dc4836..9e4c172 100644
--- a/tests/bsd/L_xattrname.out
+++ b/tests/bsd/L_xattrname.out
@@ -1,2 +1,2 @@
-scratch/link
-scratch/xattr
+./link
+./xattr
diff --git a/tests/bsd/L_xattrname.sh b/tests/bsd/L_xattrname.sh
index 3b2006b..8108d57 100644
--- a/tests/bsd/L_xattrname.sh
+++ b/tests/bsd/L_xattrname.sh
@@ -1,11 +1,11 @@
-invoke_bfs scratch -quit -xattr || skip
+invoke_bfs . -quit -xattr || skip
make_xattrs || skip
case "$UNAME" in
Darwin|FreeBSD)
- bfs_diff -L scratch -xattrname bfs_test
+ bfs_diff -L . -xattrname bfs_test
;;
*)
- bfs_diff -L scratch -xattrname security.bfs_test
+ bfs_diff -L . -xattrname security.bfs_test
;;
esac
diff --git a/tests/bsd/acl.out b/tests/bsd/acl.out
index ddf8446..92e2f67 100644
--- a/tests/bsd/acl.out
+++ b/tests/bsd/acl.out
@@ -1 +1 @@
-scratch/acl
+./acl
diff --git a/tests/bsd/acl.sh b/tests/bsd/acl.sh
index c044398..a13c75f 100644
--- a/tests/bsd/acl.sh
+++ b/tests/bsd/acl.sh
@@ -1,9 +1,9 @@
-clean_scratch
+cd "$TEST"
-invoke_bfs scratch -quit -acl || skip
+invoke_bfs . -quit -acl || skip
-"$XTOUCH" scratch/{normal,acl}
-set_acl scratch/acl || skip
-ln -s acl scratch/link
+"$XTOUCH" normal acl
+set_acl acl || skip
+ln -s acl link
-bfs_diff scratch -acl
+bfs_diff . -acl
diff --git a/tests/bsd/flags.out b/tests/bsd/flags.out
index 11998ed..3216ff5 100644
--- a/tests/bsd/flags.out
+++ b/tests/bsd/flags.out
@@ -1 +1 @@
-scratch/bar
+./bar
diff --git a/tests/bsd/flags.sh b/tests/bsd/flags.sh
index 949a7d3..eb9bc22 100644
--- a/tests/bsd/flags.sh
+++ b/tests/bsd/flags.sh
@@ -1,8 +1,8 @@
-invoke_bfs scratch -quit -flags offline || skip
+invoke_bfs . -quit -flags offline || skip
-clean_scratch
+cd "$TEST"
-"$XTOUCH" scratch/{foo,bar}
-chflags offline scratch/bar || skip
+"$XTOUCH" foo bar
+chflags offline bar || skip
-bfs_diff scratch -flags -offline,nohidden
+bfs_diff . -flags -offline,nohidden
diff --git a/tests/bsd/rm.out b/tests/bsd/rm.out
index fb188b9..9c558e3 100644
--- a/tests/bsd/rm.out
+++ b/tests/bsd/rm.out
@@ -1 +1 @@
-scratch
+.
diff --git a/tests/bsd/rm.sh b/tests/bsd/rm.sh
index 9ee2b0a..595d514 100644
--- a/tests/bsd/rm.sh
+++ b/tests/bsd/rm.sh
@@ -1,6 +1,4 @@
-clean_scratch
-"$XTOUCH" -p scratch/foo/bar/baz
-
-(cd scratch && invoke_bfs . -rm)
-
-bfs_diff scratch
+cd "$TEST"
+"$XTOUCH" -p foo/bar/baz
+invoke_bfs . -rm
+bfs_diff .
diff --git a/tests/bsd/type_w.out b/tests/bsd/type_w.out
index d383f69..a20a4f3 100644
--- a/tests/bsd/type_w.out
+++ b/tests/bsd/type_w.out
@@ -1,38 +1,34 @@
-1: -rw-r--r-- scratch/mnt/lower/bar
-1: -rw-r--r-- scratch/mnt/lower/baz
-1: -rw-r--r-- scratch/mnt/lower/foo
-1: -rw-r--r-- scratch/mnt/upper/baz/qux
-1: -rw-r--r-- scratch/mnt/upper/foo
-1: drwxr-xr-x scratch/mnt
-1: drwxr-xr-x scratch/mnt/lower
-1: drwxr-xr-x scratch/mnt/upper
-1: drwxr-xr-x scratch/mnt/upper/baz
-2: w--------- scratch/mnt/upper/bar
-3: -rw-r--r-- scratch/mnt/lower/bar
-3: -rw-r--r-- scratch/mnt/lower/baz
-3: -rw-r--r-- scratch/mnt/lower/foo
-3: -rw-r--r-- scratch/mnt/upper/baz/qux
-3: -rw-r--r-- scratch/mnt/upper/foo
-3: drwxr-xr-x scratch/mnt
-3: drwxr-xr-x scratch/mnt/lower
-3: drwxr-xr-x scratch/mnt/upper
-3: drwxr-xr-x scratch/mnt/upper/baz
-3: w--------- scratch/mnt/upper/bar
-4: -rw-r--r-- scratch/mnt/lower/bar
-4: -rw-r--r-- scratch/mnt/lower/baz
-4: -rw-r--r-- scratch/mnt/lower/foo
-4: -rw-r--r-- scratch/mnt/upper/baz/qux
-4: drwxr-xr-x scratch/mnt
-4: drwxr-xr-x scratch/mnt/lower
-4: drwxr-xr-x scratch/mnt/upper
-4: drwxr-xr-x scratch/mnt/upper/baz
-5: w--------- scratch/mnt/upper/bar
-6: -rw-r--r-- scratch/mnt/lower/bar
-6: -rw-r--r-- scratch/mnt/lower/baz
-6: -rw-r--r-- scratch/mnt/lower/foo
-6: -rw-r--r-- scratch/mnt/upper/baz/qux
-6: drwxr-xr-x scratch/mnt
-6: drwxr-xr-x scratch/mnt/lower
-6: drwxr-xr-x scratch/mnt/upper
-6: drwxr-xr-x scratch/mnt/upper/baz
-6: w--------- scratch/mnt/upper/bar
+1: -rw-r--r-- mnt/lower/bar
+1: -rw-r--r-- mnt/lower/baz
+1: -rw-r--r-- mnt/lower/foo
+1: -rw-r--r-- mnt/upper/baz/qux
+1: -rw-r--r-- mnt/upper/foo
+1: drwxr-xr-x mnt/lower
+1: drwxr-xr-x mnt/upper
+1: drwxr-xr-x mnt/upper/baz
+2: w--------- mnt/upper/bar
+3: -rw-r--r-- mnt/lower/bar
+3: -rw-r--r-- mnt/lower/baz
+3: -rw-r--r-- mnt/lower/foo
+3: -rw-r--r-- mnt/upper/baz/qux
+3: -rw-r--r-- mnt/upper/foo
+3: drwxr-xr-x mnt/lower
+3: drwxr-xr-x mnt/upper
+3: drwxr-xr-x mnt/upper/baz
+3: w--------- mnt/upper/bar
+4: -rw-r--r-- mnt/lower/bar
+4: -rw-r--r-- mnt/lower/baz
+4: -rw-r--r-- mnt/lower/foo
+4: -rw-r--r-- mnt/upper/baz/qux
+4: drwxr-xr-x mnt/lower
+4: drwxr-xr-x mnt/upper
+4: drwxr-xr-x mnt/upper/baz
+5: w--------- mnt/upper/bar
+6: -rw-r--r-- mnt/lower/bar
+6: -rw-r--r-- mnt/lower/baz
+6: -rw-r--r-- mnt/lower/foo
+6: -rw-r--r-- mnt/upper/baz/qux
+6: drwxr-xr-x mnt/lower
+6: drwxr-xr-x mnt/upper
+6: drwxr-xr-x mnt/upper/baz
+6: w--------- mnt/upper/bar
diff --git a/tests/bsd/type_w.sh b/tests/bsd/type_w.sh
index 15b4e68..aec9cb1 100644
--- a/tests/bsd/type_w.sh
+++ b/tests/bsd/type_w.sh
@@ -2,51 +2,51 @@
command -v mdconfig &>/dev/null || skip
command -v newfs &>/dev/null || skip
-clean_scratch
+cd "$TEST"
# Create a ramdisk
-truncate -s1M scratch/img
-md=$(bfs_sudo mdconfig scratch/img) || skip
+truncate -s1M img
+md=$(bfs_sudo mdconfig img) || skip
defer bfs_sudo mdconfig -du "$md"
# Make an ffs filesystem
bfs_sudo newfs -n "/dev/$md" >&2 || skip
-mkdir scratch/mnt
+mkdir mnt
# Mount it
-bfs_sudo mount "/dev/$md" scratch/mnt || skip
-defer bfs_sudo umount scratch/mnt
+bfs_sudo mount "/dev/$md" mnt || skip
+defer bfs_sudo umount mnt
# Make it owned by us
-bfs_sudo chown "$(id -u):$(id -g)" scratch/mnt
-"$XTOUCH" -p scratch/mnt/{lower/{foo,bar,baz},upper/{bar,baz/qux}}
+bfs_sudo chown "$(id -u):$(id -g)" mnt
+"$XTOUCH" -p mnt/{lower/{foo,bar,baz},upper/{bar,baz/qux}}
# Mount a union filesystem within it
-bfs_sudo mount -t unionfs -o below scratch/mnt/{lower,upper}
-defer bfs_sudo umount scratch/mnt/upper
+bfs_sudo mount -t unionfs -o below mnt/{lower,upper}
+defer bfs_sudo umount mnt/upper
# Create a whiteout
-rm scratch/mnt/upper/bar
+rm mnt/upper/bar
# FreeBSD find doesn't have -printf, so munge -ls output
munge_ls() {
- sed -En 's|.*([-drwx]{10}).*(scratch/.*)|'"$1"': \1 \2|p'
+ sed -En 's|.*([-drwx]{10}).*(mnt/.*)|'"$1"': \1 \2|p'
}
# Do a few tests in one
{
# Normally, we shouldn't see the whiteouts
- invoke_bfs scratch/mnt -ls | munge_ls 1
+ invoke_bfs mnt -ls | munge_ls 1
# -type w adds whiteouts to the output
- invoke_bfs scratch/mnt -type w -ls | munge_ls 2
+ invoke_bfs mnt -type w -ls | munge_ls 2
# So this is not the same as test 1
- invoke_bfs scratch/mnt \( -type w -or -not -type w \) -ls | munge_ls 3
+ invoke_bfs mnt \( -type w -or -not -type w \) -ls | munge_ls 3
# Unmount the unionfs
pop_defer
# Now repeat the same tests
- invoke_bfs scratch/mnt -ls | munge_ls 4
- invoke_bfs scratch/mnt -type w -ls | munge_ls 5
- invoke_bfs scratch/mnt \( -type w -or -not -type w \) -ls | munge_ls 6
+ invoke_bfs mnt -ls | munge_ls 4
+ invoke_bfs mnt -type w -ls | munge_ls 5
+ invoke_bfs mnt \( -type w -or -not -type w \) -ls | munge_ls 6
} >"$OUT"
sort_output
diff_output
diff --git a/tests/bsd/xattr.out b/tests/bsd/xattr.out
index 109e7c9..0afed35 100644
--- a/tests/bsd/xattr.out
+++ b/tests/bsd/xattr.out
@@ -1,3 +1,3 @@
-scratch/xattr
-scratch/xattr_2
-scratch/xattr_link
+./xattr
+./xattr_2
+./xattr_link
diff --git a/tests/bsd/xattr.sh b/tests/bsd/xattr.sh
index 4a4658c..68f729a 100644
--- a/tests/bsd/xattr.sh
+++ b/tests/bsd/xattr.sh
@@ -1,3 +1,3 @@
-invoke_bfs scratch -quit -xattr || skip
+invoke_bfs . -quit -xattr || skip
make_xattrs || skip
-bfs_diff scratch -xattr
+bfs_diff . -xattr
diff --git a/tests/bsd/xattrname.out b/tests/bsd/xattrname.out
index 0285ac1..ef732bd 100644
--- a/tests/bsd/xattrname.out
+++ b/tests/bsd/xattrname.out
@@ -1,2 +1,2 @@
-scratch/xattr
-scratch/xattr_link
+./xattr
+./xattr_link
diff --git a/tests/bsd/xattrname.sh b/tests/bsd/xattrname.sh
index 655bd74..38b111a 100644
--- a/tests/bsd/xattrname.sh
+++ b/tests/bsd/xattrname.sh
@@ -1,11 +1,11 @@
-invoke_bfs scratch -quit -xattr || skip
+invoke_bfs . -quit -xattr || skip
make_xattrs || skip
case "$UNAME" in
Darwin|FreeBSD)
- bfs_diff scratch -xattrname bfs_test
+ bfs_diff . -xattrname bfs_test
;;
*)
- bfs_diff scratch -xattrname security.bfs_test
+ bfs_diff . -xattrname security.bfs_test
;;
esac