diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-10-20 13:21:41 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2022-10-20 13:21:41 -0400 |
commit | 55a1ad42bd172aa235015b88c092a225ec7f4862 (patch) | |
tree | ffe5cc53024ee1a8c9a7c7029671bae7852025c9 /tests/posix | |
parent | 4ec966263444dfae8837cd73b980cfdb9aabd93f (diff) |
tests: Add a helper for cleaning scratch
And try to unmount things if the a test left them mounted.
Diffstat (limited to 'tests/posix')
-rw-r--r-- | tests/posix/L_xdev.sh | 2 | ||||
-rw-r--r-- | tests/posix/depth_error.sh | 4 | ||||
-rw-r--r-- | tests/posix/type_bind_mount.sh | 2 | ||||
-rw-r--r-- | tests/posix/xdev.sh | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/tests/posix/L_xdev.sh b/tests/posix/L_xdev.sh index f0ba120..c18a39e 100644 --- a/tests/posix/L_xdev.sh +++ b/tests/posix/L_xdev.sh @@ -1,7 +1,7 @@ skip_unless test "$SUDO" skip_if test "$UNAME" = "Darwin" -rm -rf scratch/* +clean_scratch mkdir scratch/{foo,mnt} sudo mount -t tmpfs tmpfs scratch/mnt ln -s ../mnt scratch/foo/bar diff --git a/tests/posix/depth_error.sh b/tests/posix/depth_error.sh index 9acf976..e1267f4 100644 --- a/tests/posix/depth_error.sh +++ b/tests/posix/depth_error.sh @@ -1,4 +1,4 @@ -rm -rf scratch/* +clean_scratch touchp scratch/foo/bar chmod a-r scratch/foo @@ -6,6 +6,6 @@ bfs_diff scratch -depth ret=$? chmod +r scratch/foo -rm -rf scratch/* +clean_scratch [ $ret -eq $EX_BFS ] diff --git a/tests/posix/type_bind_mount.sh b/tests/posix/type_bind_mount.sh index 87b1549..e05baa3 100644 --- a/tests/posix/type_bind_mount.sh +++ b/tests/posix/type_bind_mount.sh @@ -1,7 +1,7 @@ skip_unless test "$SUDO" skip_unless test "$UNAME" = "Linux" -rm -rf scratch/* +clean_scratch $TOUCH scratch/{file,null} sudo mount --bind /dev/null scratch/null diff --git a/tests/posix/xdev.sh b/tests/posix/xdev.sh index cbb3347..7c26c3f 100644 --- a/tests/posix/xdev.sh +++ b/tests/posix/xdev.sh @@ -1,7 +1,7 @@ skip_unless test "$SUDO" skip_if test "$UNAME" = "Darwin" -rm -rf scratch/* +clean_scratch mkdir scratch/{foo,mnt} sudo mount -t tmpfs tmpfs scratch/mnt $TOUCH scratch/foo/bar scratch/mnt/baz |