generic/126: run it inside its own subdirectory
PATCH v2 1/1 generic/126: run it inside its own subdirectory
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.
---
Changes in v2:
- add commands to _cleanup() to clean up test directory (Thanks Darrick!)
- Link to v1: https://lore.kernel.org/r/[email protected]
--- tests/generic/126 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
tests/generic/126 +10 -2
@@ -13,6 +13,7 @@ _begin_fstest perms auto quick _cleanup() { cd / + test -n "$testdir" && rm -rf "$testdir" } # Import common functions.
@@ -23,7 +24,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 +53,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,
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 8 lines · 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 theO_CREATbit set.
Quoted 5 lines
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 <[email protected]>
Looks good to me, thanks for the _cleanup fix!
--D
Quoted 55 lines
---
Changes in v2:
- add commands to_cleanup()to clean up test directory (Thanks Darrick!)
- Link to v1: https://lore.kernel.org/r/[email protected]--- tests/generic/126 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)tests/generic/126 +10
-3@@ -13,6 +13,7 @@ _begin_fstest perms auto quick _cleanup() { cd / + test -n "$testdir" && rm -rf "$testdir" } # Import common functions.@@ -23,7 +24,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 +53,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-f81b3022c4b7Best regards,
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 13 lines · 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 theO_CREATbit 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 <[email protected]>
Quoted 8 lines
---
Changes in v2:
- add commands to_cleanup()to clean up test directory (Thanks Darrick!)
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Hi Jeff,
Thanks for fixing nfs test issue again :)
Quoted 31 lines
tests/generic/126 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)tests/generic/126 +8
-1@@ -13,6 +13,7 @@ _begin_fstest perms auto quick _cleanup() { cd / + test -n "$testdir" && rm -rf "$testdir" } # Import common functions.@@ -23,7 +24,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
tests/generic/126 $QA_FS_PERMS 200 99 99 200 99 w 1 · line 57
Quoted 6 lines
tests/generic/126 +2
-1@@ -46,7 +53,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
I think these two steps are useless, due to you let _cleanup to do it. Others looks good to me. If you agree, I'll help to change that when I merge this patch :)
Thanks,
Zorro
Quoted 13 lines
tests/generic/126 +0
-1status=0 exit ---base-commit:
8467552f09e1672a02712653b532a84bd46ea10e
change-id: 20250219-generic126-f81b3022c4b7Best regards,
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 34 lines · 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 theO_CREATbit 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 <[email protected]>---
Changes in v2:
- add commands to_cleanup()to clean up test directory (Thanks Darrick!)
- Link to v1: https://lore.kernel.org/r/[email protected]--- tests/generic/126 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)tests/generic/126 +1
-0@@ -13,6 +13,7 @@ _begin_fstest perms auto quick _cleanup() { cd / + test -n "$testdir" && rm -rf "$testdir" } # Import common functions.
tests/generic/126 _require_chown · line 31
Quoted 9 lines
tests/generic/126 +5
-1@@ -23,7 +24,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
Sorry, more review points :)
We have a _require_chmod helper, due to not all filesystems supports it. If the chmod is need, you need to add _require_chmod.
And as Dave suggested, can you explain why these steps are necessary? If this test fails without these steps, please add some comments for that.
Thanks,
Zorro
Quoted 25 lines
tests/generic/126 +4
-2+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 +53,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-f81b3022c4b7Best regards,
Signature · 1 line
Jeff Layton <[email protected]>