linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: fstests@vger.kernel.org
Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Jeff Layton <jlayton@kernel.org>
Subject: [PATCH fstests v2 1/3] common/attr: fix the _require_acl test
Date: Thu, 24 Aug 2023 12:44:17 -0400	[thread overview]
Message-ID: <20230824-fixes-v2-1-d60c2faf1057@kernel.org> (raw)
In-Reply-To: <20230824-fixes-v2-0-d60c2faf1057@kernel.org>

_require_acl tests whether you're able to fetch the ACL from a file
using chacl, and then tests for an -EOPNOTSUPP error return.
Unfortunately, filesystems that don't support them (like NFSv4) just
return -ENODATA when someone calls getxattr for the POSIX ACL, so the
test doesn't work.

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

-- 
2.41.0


  reply	other threads:[~2023-08-24 16:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24 16:44 [PATCH fstests v2 0/3] fstests: add appropriate checks for fs features for some tests Jeff Layton
2023-08-24 16:44 ` Jeff Layton [this message]
2023-08-24 16:44 ` [PATCH fstests v2 2/3] generic/513: limit to filesystems that support capabilities Jeff Layton
2023-08-25 14:11   ` Zorro Lang
2023-08-25 15:02     ` Jeff Layton
2023-08-27 12:45       ` Zorro Lang
2023-08-27 13:43         ` Jeff Layton
2023-08-28 14:35           ` Zorro Lang
2023-08-24 16:44 ` [PATCH fstests v2 3/3] generic/578: only run on filesystems that support FIEMAP Jeff Layton
2023-08-24 17:09   ` Darrick J. Wong
2023-08-24 17:28     ` Jeff Layton
2023-08-25 14:16       ` Zorro Lang
2023-08-25 14:57         ` Jeff Layton
2023-08-25 15:18           ` Darrick J. Wong
2023-08-25 17:34             ` Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230824-fixes-v2-1-d60c2faf1057@kernel.org \
    --to=jlayton@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).