diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2021-04-18 12:40:22 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2021-04-18 12:41:19 -0400 |
commit | 6b0ee95e24dc0ac2bda679f78d244cebb889fb2c (patch) | |
tree | 8c56a1e053090c067998431cf6484ce663d576f1 /tests.sh | |
parent | 79438c36f541ae05a2b8055bc4b2337fca5753eb (diff) | |
download | bfs-6b0ee95e24dc0ac2bda679f78d244cebb889fb2c.tar.xz |
tests: Don't fail xattr tests if we can't set xattrs at all
Diffstat (limited to 'tests.sh')
-rwxr-xr-x | tests.sh | 46 |
1 files changed, 17 insertions, 29 deletions
@@ -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) |