FS/XFS testing framework
 help / color / mirror / Atom feed
* [PATCH fstests] generic/126: run it inside its own subdirectory
@ 2025-02-19 16:50 Jeff Layton
  2025-02-19 17:18 ` Darrick J. Wong
  2025-02-19 21:00 ` Dave Chinner
  0 siblings, 2 replies; 3+ messages in thread
From: Jeff Layton @ 2025-02-19 16:50 UTC (permalink / raw)
  To: fstests; +Cc: Jeff Layton

I had been seeing some failures in generic/126 when running on NFS under
kdevops.

The problem turned out to be that kdevops makes the root of the NFS
export mode 01777 by default (i.e. with the sticky bit set). This causes
some of these permission tests to fail because the open() is called with
the O_CREAT bit set.

Make the outcome of this test not depend on the permissions on
$TEST_DIR. Create a new directory to do these tests in, and clean it up
when done.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 tests/generic/126 | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tests/generic/126 b/tests/generic/126
index 142d2bb97db706bafd2152856ef0993c5c273441..fe0d6db1b6bd85d4942333fdf04d23a63c4052ec 100755
--- a/tests/generic/126
+++ b/tests/generic/126
@@ -23,7 +23,13 @@ _require_chown
 
 QA_FS_PERMS=$here/src/fs_perms
 
-cd $TEST_DIR
+testdir="$TEST_DIR/generic-126.$$"
+
+mkdir $testdir
+chown 0:0 $testdir
+chmod 0755 $testdir
+cd $testdir
+
 cp $here/src/testx ./testx.file
 
 # file_perm owner_uid owner_gid tester_uid tester_gid perm_to_test expected_result pass=1
@@ -46,7 +52,8 @@ $QA_FS_PERMS 200 99 99 200 99 w 1
 $QA_FS_PERMS 040 99 99 99 500 r 1
 $QA_FS_PERMS 400 99 99 200 99 r 1
 
-rm -f ./testx.file
+cd /
+rm -rf $testdir
 
 status=0
 exit

---
base-commit: 8467552f09e1672a02712653b532a84bd46ea10e
change-id: 20250219-generic126-f81b3022c4b7

Best regards,
-- 
Jeff Layton <jlayton@kernel.org>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH fstests] generic/126: run it inside its own subdirectory
  2025-02-19 16:50 [PATCH fstests] generic/126: run it inside its own subdirectory Jeff Layton
@ 2025-02-19 17:18 ` Darrick J. Wong
  2025-02-19 21:00 ` Dave Chinner
  1 sibling, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2025-02-19 17:18 UTC (permalink / raw)
  To: Jeff Layton; +Cc: fstests

On Wed, Feb 19, 2025 at 11:50:03AM -0500, Jeff Layton wrote:
> I had been seeing some failures in generic/126 when running on NFS under
> kdevops.
> 
> The problem turned out to be that kdevops makes the root of the NFS
> export mode 01777 by default (i.e. with the sticky bit set). This causes
> some of these permission tests to fail because the open() is called with
> the O_CREAT bit set.
> 
> Make the outcome of this test not depend on the permissions on
> $TEST_DIR. Create a new directory to do these tests in, and clean it up
> when done.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  tests/generic/126 | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/generic/126 b/tests/generic/126
> index 142d2bb97db706bafd2152856ef0993c5c273441..fe0d6db1b6bd85d4942333fdf04d23a63c4052ec 100755
> --- a/tests/generic/126
> +++ b/tests/generic/126
> @@ -23,7 +23,13 @@ _require_chown
>  
>  QA_FS_PERMS=$here/src/fs_perms
>  
> -cd $TEST_DIR
> +testdir="$TEST_DIR/generic-126.$$"
> +
> +mkdir $testdir
> +chown 0:0 $testdir
> +chmod 0755 $testdir
> +cd $testdir
> +
>  cp $here/src/testx ./testx.file
>  
>  # file_perm owner_uid owner_gid tester_uid tester_gid perm_to_test expected_result pass=1
> @@ -46,7 +52,8 @@ $QA_FS_PERMS 200 99 99 200 99 w 1
>  $QA_FS_PERMS 040 99 99 99 500 r 1
>  $QA_FS_PERMS 400 99 99 200 99 r 1
>  
> -rm -f ./testx.file
> +cd /
> +rm -rf $testdir

You might want to put:

	test -n "$testdir" && rm -r -f "$testdir"

into _cleanup so that it's always removed?

--D

>  
>  status=0
>  exit
> 
> ---
> base-commit: 8467552f09e1672a02712653b532a84bd46ea10e
> change-id: 20250219-generic126-f81b3022c4b7
> 
> Best regards,
> -- 
> Jeff Layton <jlayton@kernel.org>
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH fstests] generic/126: run it inside its own subdirectory
  2025-02-19 16:50 [PATCH fstests] generic/126: run it inside its own subdirectory Jeff Layton
  2025-02-19 17:18 ` Darrick J. Wong
@ 2025-02-19 21:00 ` Dave Chinner
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Chinner @ 2025-02-19 21:00 UTC (permalink / raw)
  To: Jeff Layton; +Cc: fstests

On Wed, Feb 19, 2025 at 11:50:03AM -0500, Jeff Layton wrote:
> I had been seeing some failures in generic/126 when running on NFS under
> kdevops.
> 
> The problem turned out to be that kdevops makes the root of the NFS
> export mode 01777 by default (i.e. with the sticky bit set). This causes
> some of these permission tests to fail because the open() is called with
> the O_CREAT bit set.
> 
> Make the outcome of this test not depend on the permissions on
> $TEST_DIR. Create a new directory to do these tests in, and clean it up
> when done.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  tests/generic/126 | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/generic/126 b/tests/generic/126
> index 142d2bb97db706bafd2152856ef0993c5c273441..fe0d6db1b6bd85d4942333fdf04d23a63c4052ec 100755
> --- a/tests/generic/126
> +++ b/tests/generic/126
> @@ -23,7 +23,13 @@ _require_chown
>  
>  QA_FS_PERMS=$here/src/fs_perms
>  
> -cd $TEST_DIR
> +testdir="$TEST_DIR/generic-126.$$"
> +
> +mkdir $testdir
> +chown 0:0 $testdir
> +chmod 0755 $testdir
> +cd $testdir

Comment explaining why this weird setup step is done, please!

> +
>  cp $here/src/testx ./testx.file
>  
>  # file_perm owner_uid owner_gid tester_uid tester_gid perm_to_test expected_result pass=1
> @@ -46,7 +52,8 @@ $QA_FS_PERMS 200 99 99 200 99 w 1
>  $QA_FS_PERMS 040 99 99 99 500 r 1
>  $QA_FS_PERMS 400 99 99 200 99 r 1
>  
> -rm -f ./testx.file
> +cd /
> +rm -rf $testdir

belongs in _cleanup(), not here.

-Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-19 21:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-19 16:50 [PATCH fstests] generic/126: run it inside its own subdirectory Jeff Layton
2025-02-19 17:18 ` Darrick J. Wong
2025-02-19 21:00 ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox