* [PATCH fstests v4 0/3] fstests: add appropriate checks for fs features for some tests
@ 2023-08-30 10:58 Jeff Layton
2023-08-30 10:58 ` [PATCH fstests v4 1/3] common/attr: fix the _require_acl test Jeff Layton
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Jeff Layton @ 2023-08-30 10:58 UTC (permalink / raw)
To: fstests; +Cc: linux-nfs, linux-fsdevel, Darrick Wong, Zorro Lang, Jeff Layton
A number of fstests fail on NFS, primarily because it lacks certain
features that are widely supported on local Linux filesystems. Fix
up the test for POSIX ACLs and add a new requirement for fiemap support
in generic/578.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
Changes in v4:
- use "_require_attrs security" instead of special setcap test
- use '_require_xfs_io_command "fiemap"' instead of special fiemap test
- Link to v3: https://lore.kernel.org/r/20230825-fixes-v3-0-6484c098f8e8@kernel.org
Changes in v2:
- add new checks for fiemap and setcap
- Link to v2: https://lore.kernel.org/r/20230824-fixes-v2-0-d60c2faf1057@kernel.org
Changes in v3:
- use _require_xfs_io_command "fiemap" in generic/578
- drop the _require_setcap patch (Zorro has similar that adds a _require_capabilities)
---
Jeff Layton (3):
common/attr: fix the _require_acl test
generic/578: add a check to ensure that fiemap is supported
generic/*: add a check for security attrs
common/attr | 9 ++++-----
tests/generic/270 | 2 ++
tests/generic/513 | 2 ++
tests/generic/578 | 1 +
tests/generic/675 | 2 ++
tests/generic/688 | 2 ++
tests/generic/727 | 2 ++
7 files changed, 15 insertions(+), 5 deletions(-)
---
base-commit: 0ca1d4fbb2e9a492968f2951df101f24477f7991
change-id: 20230824-fixes-914cc3f9ef72
Best regards,
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH fstests v4 1/3] common/attr: fix the _require_acl test 2023-08-30 10:58 [PATCH fstests v4 0/3] fstests: add appropriate checks for fs features for some tests Jeff Layton @ 2023-08-30 10:58 ` Jeff Layton 2023-08-30 15:02 ` Darrick J. Wong 2023-08-30 10:58 ` [PATCH fstests v4 2/3] generic/578: add a check to ensure that fiemap is supported Jeff Layton 2023-08-30 10:58 ` [PATCH fstests v4 3/3] generic/*: add a check for security attrs Jeff Layton 2 siblings, 1 reply; 7+ messages in thread From: Jeff Layton @ 2023-08-30 10:58 UTC (permalink / raw) To: fstests; +Cc: linux-nfs, linux-fsdevel, Darrick Wong, Zorro Lang, Jeff Layton _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 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH fstests v4 1/3] common/attr: fix the _require_acl test 2023-08-30 10:58 ` [PATCH fstests v4 1/3] common/attr: fix the _require_acl test Jeff Layton @ 2023-08-30 15:02 ` Darrick J. Wong 0 siblings, 0 replies; 7+ messages in thread From: Darrick J. Wong @ 2023-08-30 15:02 UTC (permalink / raw) To: Jeff Layton; +Cc: fstests, linux-nfs, linux-fsdevel, Zorro Lang On Wed, Aug 30, 2023 at 06:58:50AM -0400, Jeff Layton wrote: > _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> Seems logical, Reviewed-by: Darrick J. Wong <djwong@kernel.org> --D > --- > 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 > ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH fstests v4 2/3] generic/578: add a check to ensure that fiemap is supported 2023-08-30 10:58 [PATCH fstests v4 0/3] fstests: add appropriate checks for fs features for some tests Jeff Layton 2023-08-30 10:58 ` [PATCH fstests v4 1/3] common/attr: fix the _require_acl test Jeff Layton @ 2023-08-30 10:58 ` Jeff Layton 2023-08-30 14:59 ` Darrick J. Wong 2023-08-30 10:58 ` [PATCH fstests v4 3/3] generic/*: add a check for security attrs Jeff Layton 2 siblings, 1 reply; 7+ messages in thread From: Jeff Layton @ 2023-08-30 10:58 UTC (permalink / raw) To: fstests; +Cc: linux-nfs, linux-fsdevel, Darrick Wong, Zorro Lang, Jeff Layton This test requires FIEMAP support. Suggested-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Jeff Layton <jlayton@kernel.org> --- tests/generic/578 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/generic/578 b/tests/generic/578 index b024f6ff90b4..e8bb97f7b96c 100755 --- a/tests/generic/578 +++ b/tests/generic/578 @@ -24,6 +24,7 @@ _cleanup() _supported_fs generic _require_test_program "mmap-write-concurrent" _require_command "$FILEFRAG_PROG" filefrag +_require_xfs_io_command "fiemap" _require_test_reflink _require_cp_reflink -- 2.41.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH fstests v4 2/3] generic/578: add a check to ensure that fiemap is supported 2023-08-30 10:58 ` [PATCH fstests v4 2/3] generic/578: add a check to ensure that fiemap is supported Jeff Layton @ 2023-08-30 14:59 ` Darrick J. Wong 0 siblings, 0 replies; 7+ messages in thread From: Darrick J. Wong @ 2023-08-30 14:59 UTC (permalink / raw) To: Jeff Layton; +Cc: fstests, linux-nfs, linux-fsdevel, Zorro Lang On Wed, Aug 30, 2023 at 06:58:51AM -0400, Jeff Layton wrote: > This test requires FIEMAP support. > > Suggested-by: Zorro Lang <zlang@redhat.com> > Signed-off-by: Jeff Layton <jlayton@kernel.org> Looks good now, Reviewed-by: Darrick J. Wong <djwong@kernel.org> --D > --- > tests/generic/578 | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tests/generic/578 b/tests/generic/578 > index b024f6ff90b4..e8bb97f7b96c 100755 > --- a/tests/generic/578 > +++ b/tests/generic/578 > @@ -24,6 +24,7 @@ _cleanup() > _supported_fs generic > _require_test_program "mmap-write-concurrent" > _require_command "$FILEFRAG_PROG" filefrag > +_require_xfs_io_command "fiemap" > _require_test_reflink > _require_cp_reflink > > > -- > 2.41.0 > ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH fstests v4 3/3] generic/*: add a check for security attrs 2023-08-30 10:58 [PATCH fstests v4 0/3] fstests: add appropriate checks for fs features for some tests Jeff Layton 2023-08-30 10:58 ` [PATCH fstests v4 1/3] common/attr: fix the _require_acl test Jeff Layton 2023-08-30 10:58 ` [PATCH fstests v4 2/3] generic/578: add a check to ensure that fiemap is supported Jeff Layton @ 2023-08-30 10:58 ` Jeff Layton 2023-08-30 15:01 ` Darrick J. Wong 2 siblings, 1 reply; 7+ messages in thread From: Jeff Layton @ 2023-08-30 10:58 UTC (permalink / raw) To: fstests; +Cc: linux-nfs, linux-fsdevel, Darrick Wong, Zorro Lang, Jeff Layton There are several generic tests that require "setcap", but don't check whether the underlying fs supports security attrs. Add the appropriate checks. Signed-off-by: Jeff Layton <jlayton@kernel.org> --- tests/generic/270 | 2 ++ tests/generic/513 | 2 ++ tests/generic/675 | 2 ++ tests/generic/688 | 2 ++ tests/generic/727 | 2 ++ 5 files changed, 10 insertions(+) diff --git a/tests/generic/270 b/tests/generic/270 index 8a6a2822b76b..e7329c2f3280 100755 --- a/tests/generic/270 +++ b/tests/generic/270 @@ -13,6 +13,7 @@ _begin_fstest auto quota rw prealloc ioctl enospc stress # Import common functions. . ./common/filter . ./common/quota +. ./common/attr # Disable all sync operations to get higher load FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0" @@ -58,6 +59,7 @@ _require_user _require_scratch _require_command "$KILLALL_PROG" killall _require_command "$SETCAP_PROG" setcap +_require_attrs security _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 _scratch_mount "-o usrquota,grpquota" diff --git a/tests/generic/513 b/tests/generic/513 index dc082787ae4e..7ff845cea35b 100755 --- a/tests/generic/513 +++ b/tests/generic/513 @@ -12,12 +12,14 @@ _begin_fstest auto quick clone # Import common functions. . ./common/filter . ./common/reflink +. ./common/attr # real QA test starts here _supported_fs generic _require_scratch_reflink _require_command "$GETCAP_PROG" getcap _require_command "$SETCAP_PROG" setcap +_require_attrs security _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/675 b/tests/generic/675 index 189251f20c0d..cc4309e45a04 100755 --- a/tests/generic/675 +++ b/tests/generic/675 @@ -12,6 +12,7 @@ _begin_fstest auto clone quick # Import common functions. . ./common/filter . ./common/reflink +. ./common/attr # real QA test starts here @@ -21,6 +22,7 @@ _require_user _require_command "$GETCAP_PROG" getcap _require_command "$SETCAP_PROG" setcap _require_scratch_reflink +_require_attrs security _scratch_mkfs >> $seqres.full _scratch_mount diff --git a/tests/generic/688 b/tests/generic/688 index 426286b6c6ce..e2bf12b4457d 100755 --- a/tests/generic/688 +++ b/tests/generic/688 @@ -18,6 +18,7 @@ _cleanup() # Import common functions. . ./common/filter +. ./common/attr # real QA test starts here @@ -29,6 +30,7 @@ _require_command "$SETCAP_PROG" setcap _require_xfs_io_command falloc _require_test _require_congruent_file_oplen $TEST_DIR 65536 +_require_attrs security junk_dir=$TEST_DIR/$seq junk_file=$junk_dir/a diff --git a/tests/generic/727 b/tests/generic/727 index 58a89e3eda70..2cda49eadab3 100755 --- a/tests/generic/727 +++ b/tests/generic/727 @@ -19,6 +19,7 @@ _begin_fstest auto fiexchange swapext quick # Import common functions. . ./common/filter +. ./common/attr # real QA test starts here @@ -30,6 +31,7 @@ _require_command "$SETCAP_PROG" setcap _require_xfs_io_command swapext '-v vfs -a' _require_xfs_io_command startupdate _require_scratch +_require_attrs security _scratch_mkfs >> $seqres.full _scratch_mount -- 2.41.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH fstests v4 3/3] generic/*: add a check for security attrs 2023-08-30 10:58 ` [PATCH fstests v4 3/3] generic/*: add a check for security attrs Jeff Layton @ 2023-08-30 15:01 ` Darrick J. Wong 0 siblings, 0 replies; 7+ messages in thread From: Darrick J. Wong @ 2023-08-30 15:01 UTC (permalink / raw) To: Jeff Layton; +Cc: fstests, linux-nfs, linux-fsdevel, Zorro Lang On Wed, Aug 30, 2023 at 06:58:52AM -0400, Jeff Layton wrote: > There are several generic tests that require "setcap", but don't check > whether the underlying fs supports security attrs. Add the appropriate > checks. > > Signed-off-by: Jeff Layton <jlayton@kernel.org> Looks good to me, Reviewed-by: Darrick J. Wong <djwong@kernel.org> --D > --- > tests/generic/270 | 2 ++ > tests/generic/513 | 2 ++ > tests/generic/675 | 2 ++ > tests/generic/688 | 2 ++ > tests/generic/727 | 2 ++ > 5 files changed, 10 insertions(+) > > diff --git a/tests/generic/270 b/tests/generic/270 > index 8a6a2822b76b..e7329c2f3280 100755 > --- a/tests/generic/270 > +++ b/tests/generic/270 > @@ -13,6 +13,7 @@ _begin_fstest auto quota rw prealloc ioctl enospc stress > # Import common functions. > . ./common/filter > . ./common/quota > +. ./common/attr > > # Disable all sync operations to get higher load > FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0" > @@ -58,6 +59,7 @@ _require_user > _require_scratch > _require_command "$KILLALL_PROG" killall > _require_command "$SETCAP_PROG" setcap > +_require_attrs security > > _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 > _scratch_mount "-o usrquota,grpquota" > diff --git a/tests/generic/513 b/tests/generic/513 > index dc082787ae4e..7ff845cea35b 100755 > --- a/tests/generic/513 > +++ b/tests/generic/513 > @@ -12,12 +12,14 @@ _begin_fstest auto quick clone > # Import common functions. > . ./common/filter > . ./common/reflink > +. ./common/attr > > # real QA test starts here > _supported_fs generic > _require_scratch_reflink > _require_command "$GETCAP_PROG" getcap > _require_command "$SETCAP_PROG" setcap > +_require_attrs security > > _scratch_mkfs >>$seqres.full 2>&1 > _scratch_mount > diff --git a/tests/generic/675 b/tests/generic/675 > index 189251f20c0d..cc4309e45a04 100755 > --- a/tests/generic/675 > +++ b/tests/generic/675 > @@ -12,6 +12,7 @@ _begin_fstest auto clone quick > # Import common functions. > . ./common/filter > . ./common/reflink > +. ./common/attr > > # real QA test starts here > > @@ -21,6 +22,7 @@ _require_user > _require_command "$GETCAP_PROG" getcap > _require_command "$SETCAP_PROG" setcap > _require_scratch_reflink > +_require_attrs security > > _scratch_mkfs >> $seqres.full > _scratch_mount > diff --git a/tests/generic/688 b/tests/generic/688 > index 426286b6c6ce..e2bf12b4457d 100755 > --- a/tests/generic/688 > +++ b/tests/generic/688 > @@ -18,6 +18,7 @@ _cleanup() > > # Import common functions. > . ./common/filter > +. ./common/attr > > # real QA test starts here > > @@ -29,6 +30,7 @@ _require_command "$SETCAP_PROG" setcap > _require_xfs_io_command falloc > _require_test > _require_congruent_file_oplen $TEST_DIR 65536 > +_require_attrs security > > junk_dir=$TEST_DIR/$seq > junk_file=$junk_dir/a > diff --git a/tests/generic/727 b/tests/generic/727 > index 58a89e3eda70..2cda49eadab3 100755 > --- a/tests/generic/727 > +++ b/tests/generic/727 > @@ -19,6 +19,7 @@ _begin_fstest auto fiexchange swapext quick > > # Import common functions. > . ./common/filter > +. ./common/attr > > # real QA test starts here > > @@ -30,6 +31,7 @@ _require_command "$SETCAP_PROG" setcap > _require_xfs_io_command swapext '-v vfs -a' > _require_xfs_io_command startupdate > _require_scratch > +_require_attrs security > > _scratch_mkfs >> $seqres.full > _scratch_mount > > -- > 2.41.0 > ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-08-30 18:38 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-08-30 10:58 [PATCH fstests v4 0/3] fstests: add appropriate checks for fs features for some tests Jeff Layton 2023-08-30 10:58 ` [PATCH fstests v4 1/3] common/attr: fix the _require_acl test Jeff Layton 2023-08-30 15:02 ` Darrick J. Wong 2023-08-30 10:58 ` [PATCH fstests v4 2/3] generic/578: add a check to ensure that fiemap is supported Jeff Layton 2023-08-30 14:59 ` Darrick J. Wong 2023-08-30 10:58 ` [PATCH fstests v4 3/3] generic/*: add a check for security attrs Jeff Layton 2023-08-30 15:01 ` Darrick J. Wong
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).