On Fri, 2023-08-25 at 22:11 +0800, Zorro Lang wrote: > On Thu, Aug 24, 2023 at 12:44:18PM -0400, Jeff Layton wrote: > > 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@xxxxxxxxxx> > > --- > > 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 > > Actually we talked about the capabilities checking helper last year, as below: > > https://lore.kernel.org/fstests/20220323023845.saj5en74km7aibdx@zlang-mailbox/ > > As you bring this discussion back, how about the _require_capabilities() in > above link? > I was testing a similar patch, but your version looks better. Should I drop mine and you re-post yours? Thanks, -- Jeff Layton <jlayton@xxxxxxxxxx>