summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2021-04-18 12:40:22 -0400
committerTavian Barnes <tavianator@tavianator.com>2021-04-18 12:41:19 -0400
commit6b0ee95e24dc0ac2bda679f78d244cebb889fb2c (patch)
tree8c56a1e053090c067998431cf6484ce663d576f1
parent79438c36f541ae05a2b8055bc4b2337fca5753eb (diff)
downloadbfs-6b0ee95e24dc0ac2bda679f78d244cebb889fb2c.tar.xz
tests: Don't fail xattr tests if we can't set xattrs at all
-rwxr-xr-xtests.sh46
1 files changed, 17 insertions, 29 deletions
diff --git a/tests.sh b/tests.sh
index 0045ce5..34cb9f0 100755
--- a/tests.sh
+++ b/tests.sh
@@ -2835,49 +2835,40 @@ function make_xattrs() {
case "$UNAME" in
Darwin)
- xattr -w bfs_test true scratch/xattr
- xattr -w bfs_test_2 true scratch/xattr_2
- xattr -s -w bfs_test true scratch/xattr_link
+ xattr -w bfs_test true scratch/xattr \
+ && xattr -w bfs_test_2 true scratch/xattr_2 \
+ && xattr -s -w bfs_test true scratch/xattr_link
;;
FreeBSD)
- setextattr user bfs_test true scratch/xattr
- setextattr user bfs_test_2 true scratch/xattr_2
- setextattr -h user bfs_test true scratch/xattr_link
+ setextattr user bfs_test true scratch/xattr \
+ && setextattr user bfs_test_2 true scratch/xattr_2 \
+ && setextattr -h user bfs_test true scratch/xattr_link
;;
*)
# Linux tmpfs doesn't support the user.* namespace, so we use the security.*
# namespace, which is writable by root and readable by others
- sudo setfattr -n security.bfs_test scratch/xattr
- sudo setfattr -n security.bfs_test_2 scratch/xattr_2
- sudo setfattr -h -n security.bfs_test scratch/xattr_link
+ sudo setfattr -n security.bfs_test scratch/xattr \
+ && sudo setfattr -n security.bfs_test_2 scratch/xattr_2 \
+ && sudo setfattr -h -n security.bfs_test scratch/xattr_link
;;
esac
}
function test_xattr() {
- if ! quiet invoke_bfs scratch -quit -xattr; then
- return 0
- fi
-
- make_xattrs
+ quiet invoke_bfs scratch -quit -xattr || return 0
+ make_xattrs || return 0
bfs_diff scratch -xattr
}
function test_L_xattr() {
- if ! quiet invoke_bfs scratch -quit -xattr; then
- return 0
- fi
-
- make_xattrs
+ quiet invoke_bfs scratch -quit -xattr || return 0
+ make_xattrs || return 0
bfs_diff -L scratch -xattr
}
function test_xattrname() {
- if ! quiet invoke_bfs scratch -quit -xattr; then
- return 0
- fi
-
- make_xattrs
+ quiet invoke_bfs scratch -quit -xattr || return 0
+ make_xattrs || return 0
case "$UNAME" in
Darwin|FreeBSD)
@@ -2890,11 +2881,8 @@ function test_xattrname() {
}
function test_L_xattrname() {
- if ! quiet invoke_bfs scratch -quit -xattr; then
- return 0
- fi
-
- make_xattrs
+ quiet invoke_bfs scratch -quit -xattr || return 0
+ make_xattrs || return 0
case "$UNAME" in
Darwin|FreeBSD)