mbox series

[fstests,v4,0/3] fstests: add appropriate checks for fs features for some tests

Message ID 20230830-fixes-v4-0-88d7b8572aa3@kernel.org (mailing list archive)
Headers show
Series fstests: add appropriate checks for fs features for some tests | expand

Message

Jeff Layton Aug. 30, 2023, 10:58 a.m. UTC
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,

Comments

Darrick J. Wong Aug. 30, 2023, 2:59 p.m. UTC | #1
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
>
Darrick J. Wong Aug. 30, 2023, 3:02 p.m. UTC | #2
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
>