FS/XFS testing framework
 help / color / mirror / Atom feed
* [PATCH] common/attr: fix the _require_acl test
@ 2023-08-23 10:33 Jeff Layton
  0 siblings, 0 replies; only message in thread
From: Jeff Layton @ 2023-08-23 10:33 UTC (permalink / raw)
  To: fstests; +Cc: Jeff Layton

_require_acl tests whether you're able to fetch the ACL from a file
using chacl. Unfortunately, filesystems like NFSv4 that don't support
POSIX ACLs return -ENODATA when someone calls getxattr for
system.posix_acl_access. chacl treats that as if there is no ACL
attached to the file and so doesn't return an error even though the
filesystem doesn't support ACLs.

Fix the test to have chacl set an ACL on the file instead, which should
reliably fail on filesystems that don't support them.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 common/attr | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/common/attr b/common/attr
index cce4d1b201b2..3ebba682c894 100644
--- a/common/attr
+++ b/common/attr
@@ -163,13 +163,12 @@ _require_acls()
     [ -n "$CHACL_PROG" ] || _notrun "chacl command not found"
 
     #
-    # Test if chacl is able to list ACLs on the target filesystems.  On really
-    # old kernels the system calls might not be implemented at all, but the
-    # more common case is that the tested filesystem simply doesn't support
-    # ACLs.
+    # Test if chacl is able to set an ACL on a file.  On really old kernels
+    # the system calls might not be implemented at all, but the more common
+    # case is that the tested filesystem simply doesn't support ACLs.
     #
     touch $TEST_DIR/syscalltest
-    chacl -l $TEST_DIR/syscalltest > $TEST_DIR/syscalltest.out 2>&1
+    chacl 'u::rw-,g::---,o::---' $TEST_DIR/syscalltest > $TEST_DIR/syscalltest.out 2>&1
     cat $TEST_DIR/syscalltest.out >> $seqres.full
 
     if grep -q 'Function not implemented' $TEST_DIR/syscalltest.out; then

---
base-commit: 8de535c53887bb49adae74a1b2e83e77d7e8457d
change-id: 20230823-require_acl-f8cb2b777822

Best regards,
-- 
Jeff Layton <jlayton@kernel.org>


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-23 10:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-23 10:33 [PATCH] common/attr: fix the _require_acl test Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox