From 6b0ee95e24dc0ac2bda679f78d244cebb889fb2c Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 18 Apr 2021 12:40:22 -0400 Subject: tests: Don't fail xattr tests if we can't set xattrs at all --- tests.sh | 46 +++++++++++++++++----------------------------- 1 file 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) -- cgit v1.2.3