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 2/3] generic/513: limit to filesystems that support capabilities
Date: Thu, 24 Aug 2023 12:44:18 -0400 [thread overview]
Message-ID: <20230824-fixes-v2-2-d60c2faf1057@kernel.org> (raw)
In-Reply-To: <20230824-fixes-v2-0-d60c2faf1057@kernel.org>
This test requires being able to set file capabilities which some
filesystems (namely NFS) do not support. Add a _require_setcap test
and only run it on filesystems that pass it.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
common/rc | 13 +++++++++++++
tests/generic/513 | 1 +
2 files changed, 14 insertions(+)
diff --git a/common/rc b/common/rc
index 5c4429ed0425..33e74d20c28b 100644
--- a/common/rc
+++ b/common/rc
@@ -5048,6 +5048,19 @@ _require_mknod()
rm -f $TEST_DIR/$seq.null
}
+_require_setcap()
+{
+ local testfile=$TEST_DIR/setcaptest.$$
+
+ touch $testfile
+ $SETCAP_PROG "cap_sys_module=p" $testfile > $testfile.out 2>&1
+ if grep -q 'Operation not supported' $testfile.out; then
+ _notrun "File capabilities are not supported on this filesystem"
+ fi
+
+ rm -f $testfile $testfile.out
+}
+
_getcap()
{
$GETCAP_PROG "$@" | _filter_getcap
diff --git a/tests/generic/513 b/tests/generic/513
index dc082787ae4e..52f9eb916b4a 100755
--- a/tests/generic/513
+++ b/tests/generic/513
@@ -18,6 +18,7 @@ _supported_fs generic
_require_scratch_reflink
_require_command "$GETCAP_PROG" getcap
_require_command "$SETCAP_PROG" setcap
+_require_setcap
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
--
2.41.0
next prev parent 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 ` [PATCH fstests v2 1/3] common/attr: fix the _require_acl test Jeff Layton
2023-08-24 16:44 ` Jeff Layton [this message]
2023-08-25 14:11 ` [PATCH fstests v2 2/3] generic/513: limit to filesystems that support capabilities 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-2-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).