common/filter: add _filter_stat
PATCH 1/1 common/filter: add _filter_stat
New stat(2) starts to use statx(7) call. Then if file does not exist, it breaks golden output like this:
-stat: cannot stat 'SCRATCH_MNT/xxx': No such file or directory +stat: cannot statx 'SCRATCH_MNT/xxx': No such file or directory
Add this filter to fix it, and add this filter to testcases that need it.
--- common/filter | 6 ++++++ tests/generic/397 | 6 +++--- tests/generic/435 | 2 +- tests/generic/440 | 2 +- tests/xfs/348 | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-)
common/filter +6 -0
@@ -510,6 +510,12 @@ _filter_mv() sed -e "s/^renamed //" } +# New stat(2) uses statx(7) +_filter_stat() +{ + sed -e "s/cannot statx/cannot stat/" +} + _filter_lostfound() { sed -e '/^lost+found$/d'
tests/generic/397 +3 -3
@@ -83,8 +83,8 @@ _unlink_session_encryption_key $keydesc _scratch_cycle_mount # Check that unencrypted names aren't there -stat $SCRATCH_MNT/edir/empty |& _filter_scratch -stat $SCRATCH_MNT/edir/symlink |& _filter_scratch +stat $SCRATCH_MNT/edir/empty |& _filter_stat |& _filter_scratch +stat $SCRATCH_MNT/edir/symlink |& _filter_stat |& _filter_scratch # Check that the correct numbers of files and subdirectories are there ls $SCRATCH_MNT/edir | wc -l
@@ -106,7 +106,7 @@ ln -s foo $SCRATCH_MNT/edir/0123456789abcdef |& _filter_scratch # Delete the encrypted directory (should succeed) rm -r $SCRATCH_MNT/edir -stat $SCRATCH_MNT/edir |& _filter_scratch +stat $SCRATCH_MNT/edir |& _filter_stat |& _filter_scratch # success, all done status=0
tests/generic/435 +1 -1
@@ -73,7 +73,7 @@ _scratch_cycle_mount # and ext4 reported a "Structure needs cleaning" error when removing files. find $SCRATCH_MNT/edir/ -type f | xargs stat -c %i | sort | uniq | wc -l rm -rf $SCRATCH_MNT/edir |& head -n 10 -stat $SCRATCH_MNT/edir |& _filter_scratch +stat $SCRATCH_MNT/edir |& _filter_stat |& _filter_scratch # success, all done status=0
tests/generic/440 +1 -1
@@ -87,7 +87,7 @@ _scratch_cycle_mount cat $SCRATCH_MNT/edir2/link exec 3< $SCRATCH_MNT/edir2/link # pin inode with cached key in memory _unlink_session_encryption_key $keydesc -stat $SCRATCH_MNT/edir/file |& _filter_scratch +stat $SCRATCH_MNT/edir/file |& _filter_stat |& _filter_scratch cat "$(find $SCRATCH_MNT/edir/ -type f)" exec 3>&-
tests/xfs/348 +1 -1
@@ -112,7 +112,7 @@ for dt in $dtypes; do rm -f $tmp.stat.err ftype=$(stat --printf=%F $testdir/$file 2>$tmp.stat.err) if [ -s $tmp.stat.err ]; then - cat $tmp.stat.err + cat $tmp.stat.err | _filter_stat else echo "stat: '$testdir/$file' is a $ftype" # Verify that readlink of a file posing as a symlink
Signature · 1 line
2.20.1
Quoted 23 lines · Murphy Zhou
New stat(2) starts to use statx(7) call. Then if file does not exist, it breaks golden output like this:
(quoted diff) +1
-1-stat: cannot stat 'SCRATCH_MNT/xxx': No such file or directory +stat: cannot statx 'SCRATCH_MNT/xxx': No such file or directoryAdd this filter to fix it, and add this filter to testcases that need it.
Signed-off-by Murphy Zhou <[email protected]>--- common/filter | 6 ++++++ tests/generic/397 | 6 +++--- tests/generic/435 | 2 +- tests/generic/440 | 2 +- tests/xfs/348 | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-)common/filter +0
-0
common/filter _filter_mv() · line 518
Quoted 9 lines
common/filter +6
-0@@ -510,6 +510,12 @@ _filter_mv() sed -e "s/^renamed //" } +# New stat(2) uses statx(7) +_filter_stat() +{ + sed -e "s/cannot statx/cannot stat/" +} +
Thanks for the fix! But I think maybe it's better to filter 'stat' to 'statx' (and update the affected .out files accordingly), so that when all distros pick up the new behavior we may eventually remove this filter, or at least we won't see failures if new tests forget to use _filter_stat, as no-one is testing with old distros.
Thanks,
Eryu
Quoted 68 lines
common/filter +0
-0_filter_lostfound() { sed -e '/^lost+found$/d'tests/generic/397 +3
-3@@ -83,8 +83,8 @@ _unlink_session_encryption_key $keydesc _scratch_cycle_mount # Check that unencrypted names aren't there -stat $SCRATCH_MNT/edir/empty |& _filter_scratch -stat $SCRATCH_MNT/edir/symlink |& _filter_scratch +stat $SCRATCH_MNT/edir/empty |& _filter_stat |& _filter_scratch +stat $SCRATCH_MNT/edir/symlink |& _filter_stat |& _filter_scratch # Check that the correct numbers of files and subdirectories are there ls $SCRATCH_MNT/edir | wc -l@@ -106,7 +106,7 @@ ln -s foo $SCRATCH_MNT/edir/0123456789abcdef |& _filter_scratch # Delete the encrypted directory (should succeed) rm -r $SCRATCH_MNT/edir -stat $SCRATCH_MNT/edir |& _filter_scratch +stat $SCRATCH_MNT/edir |& _filter_stat |& _filter_scratch # success, all done status=0tests/generic/435 +1
-1@@ -73,7 +73,7 @@ _scratch_cycle_mount # and ext4 reported a "Structure needs cleaning" error when removing files. find $SCRATCH_MNT/edir/ -type f | xargs stat -c %i | sort | uniq | wc -l rm -rf $SCRATCH_MNT/edir |& head -n 10 -stat $SCRATCH_MNT/edir |& _filter_scratch +stat $SCRATCH_MNT/edir |& _filter_stat |& _filter_scratch # success, all done status=0tests/generic/440 +1
-1@@ -87,7 +87,7 @@ _scratch_cycle_mount cat $SCRATCH_MNT/edir2/link exec 3< $SCRATCH_MNT/edir2/link # pin inode with cached key in memory _unlink_session_encryption_key $keydesc -stat $SCRATCH_MNT/edir/file |& _filter_scratch +stat $SCRATCH_MNT/edir/file |& _filter_stat |& _filter_scratch cat "$(find $SCRATCH_MNT/edir/ -type f)" exec 3>&-tests/xfs/348 +1
-1@@ -112,7 +112,7 @@ for dt in $dtypes; do rm -f $tmp.stat.err ftype=$(stat --printf=%F $testdir/$file 2>$tmp.stat.err) if [ -s $tmp.stat.err ]; then - cat $tmp.stat.err + cat $tmp.stat.err | _filter_stat else echo "stat: '$testdir/$file' is a $ftype" # Verify that readlink of a file posing as a symlinkSignature · 1 line
2.20.1
Quoted 27 lines · Eryu Guan
Quoted 26 lines · Murphy Zhou
New stat(2) starts to use statx(7) call. Then if file does not exist, it breaks golden output like this:
(quoted diff) +1
-1-stat: cannot stat 'SCRATCH_MNT/xxx': No such file or directory +stat: cannot statx 'SCRATCH_MNT/xxx': No such file or directoryAdd this filter to fix it, and add this filter to testcases that need it.
Signed-off-by Murphy Zhou <[email protected]>--- common/filter | 6 ++++++ tests/generic/397 | 6 +++--- tests/generic/435 | 2 +- tests/generic/440 | 2 +- tests/xfs/348 | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-)common/filter +0
-0@@ -510,6 +510,12 @@ _filter_mv() sed -e "s/^renamed //" }
Quoted 12 lines
common/filter _filter_mv() · line 518
Quoted 6 lines
common/filter +6
-0+# New stat(2) uses statx(7) +_filter_stat() +{ + sed -e "s/cannot statx/cannot stat/" +} +Thanks for the fix! But I think maybe it's better to filter 'stat' to 'statx' (and update the affected .out files accordingly), so that when all distros pick up the new behavior we may eventually remove this filter, or at least we won't see failures if new tests forget to use
_filter_stat, as no-one is testing with old distros.
Agree and Okay, this makes sense.
Thanks very much for the reviewing!
Quoted 72 lines
Thanks,
EryuQuoted 68 lines
common/filter +0
-0_filter_lostfound() { sed -e '/^lost+found$/d'tests/generic/397 +3
-3@@ -83,8 +83,8 @@ _unlink_session_encryption_key $keydesc _scratch_cycle_mount # Check that unencrypted names aren't there -stat $SCRATCH_MNT/edir/empty |& _filter_scratch -stat $SCRATCH_MNT/edir/symlink |& _filter_scratch +stat $SCRATCH_MNT/edir/empty |& _filter_stat |& _filter_scratch +stat $SCRATCH_MNT/edir/symlink |& _filter_stat |& _filter_scratch # Check that the correct numbers of files and subdirectories are there ls $SCRATCH_MNT/edir | wc -l@@ -106,7 +106,7 @@ ln -s foo $SCRATCH_MNT/edir/0123456789abcdef |& _filter_scratch # Delete the encrypted directory (should succeed) rm -r $SCRATCH_MNT/edir -stat $SCRATCH_MNT/edir |& _filter_scratch +stat $SCRATCH_MNT/edir |& _filter_stat |& _filter_scratch # success, all done status=0tests/generic/435 +1
-1@@ -73,7 +73,7 @@ _scratch_cycle_mount # and ext4 reported a "Structure needs cleaning" error when removing files. find $SCRATCH_MNT/edir/ -type f | xargs stat -c %i | sort | uniq | wc -l rm -rf $SCRATCH_MNT/edir |& head -n 10 -stat $SCRATCH_MNT/edir |& _filter_scratch +stat $SCRATCH_MNT/edir |& _filter_stat |& _filter_scratch # success, all done status=0tests/generic/440 +1
-1@@ -87,7 +87,7 @@ _scratch_cycle_mount cat $SCRATCH_MNT/edir2/link exec 3< $SCRATCH_MNT/edir2/link # pin inode with cached key in memory _unlink_session_encryption_key $keydesc -stat $SCRATCH_MNT/edir/file |& _filter_scratch +stat $SCRATCH_MNT/edir/file |& _filter_stat |& _filter_scratch cat "$(find $SCRATCH_MNT/edir/ -type f)" exec 3>&-tests/xfs/348 +1
-1@@ -112,7 +112,7 @@ for dt in $dtypes; do rm -f $tmp.stat.err ftype=$(stat --printf=%F $testdir/$file 2>$tmp.stat.err) if [ -s $tmp.stat.err ]; then - cat $tmp.stat.err + cat $tmp.stat.err | _filter_stat else echo "stat: '$testdir/$file' is a $ftype" # Verify that readlink of a file posing as a symlinkSignature · 1 line
2.20.1
Signature · 1 line
Murphy
PATCH v2 1/1 common/filter: add _filter_stat
New stat(1) starts to use statx(2) call. If file does not exist, it breaks golden output like this:
-stat: cannot stat 'SCRATCH_MNT/xxx': No such file or directory +stat: cannot statx 'SCRATCH_MNT/xxx': No such file or directory
Add this filter to fix it, and add this filter to testcases that need it.
---
v2:
filter "stat" to "statx"
common/filter | 6 ++ tests/generic/397 | 6 +- tests/generic/397.out | 6 +- tests/generic/435 | 2 +- tests/generic/435.out | 2 +- tests/generic/440 | 2 +- tests/generic/440.out | 2 +- tests/xfs/348 | 2 +- tests/xfs/348.out | 188 +++++++++++++++++++++--------------------- 9 files changed, 111 insertions(+), 105 deletions(-)
common/filter +6 -0
@@ -510,6 +510,12 @@ _filter_mv() sed -e "s/^renamed //" } +# New stat(1) uses statx(2) +_filter_stat() +{ + sed -e "s/\<cannot stat\>/cannot statx/" +} + _filter_lostfound() { sed -e '/^lost+found$/d'
tests/generic/397 +3 -3
@@ -83,8 +83,8 @@ _unlink_session_encryption_key $keydesc _scratch_cycle_mount # Check that unencrypted names aren't there -stat $SCRATCH_MNT/edir/empty |& _filter_scratch -stat $SCRATCH_MNT/edir/symlink |& _filter_scratch +stat $SCRATCH_MNT/edir/empty |& _filter_stat |& _filter_scratch +stat $SCRATCH_MNT/edir/symlink |& _filter_stat |& _filter_scratch # Check that the correct numbers of files and subdirectories are there ls $SCRATCH_MNT/edir | wc -l
@@ -106,7 +106,7 @@ ln -s foo $SCRATCH_MNT/edir/0123456789abcdef |& _filter_scratch # Delete the encrypted directory (should succeed) rm -r $SCRATCH_MNT/edir -stat $SCRATCH_MNT/edir |& _filter_scratch +stat $SCRATCH_MNT/edir |& _filter_stat |& _filter_scratch # success, all done status=0
tests/generic/397.out +3 -3
@@ -1,6 +1,6 @@ QA output created by 397 -stat: cannot stat 'SCRATCH_MNT/edir/empty': No such file or directory -stat: cannot stat 'SCRATCH_MNT/edir/symlink': No such file or directory +stat: cannot statx 'SCRATCH_MNT/edir/empty': No such file or directory +stat: cannot statx 'SCRATCH_MNT/edir/symlink': No such file or directory 8 1 Required key not available
@@ -10,4 +10,4 @@ mkdir: cannot create directory 'SCRATCH_MNT/edir/newdir': Required key not avail mkdir: cannot create directory 'SCRATCH_MNT/edir/0123456789abcdef': Required key not available ln: failed to create symbolic link 'SCRATCH_MNT/edir/newlink': Required key not available ln: failed to create symbolic link 'SCRATCH_MNT/edir/0123456789abcdef': Required key not available -stat: cannot stat 'SCRATCH_MNT/edir': No such file or directory +stat: cannot statx 'SCRATCH_MNT/edir': No such file or directory
tests/generic/435 +1 -1
@@ -73,7 +73,7 @@ _scratch_cycle_mount # and ext4 reported a "Structure needs cleaning" error when removing files. find $SCRATCH_MNT/edir/ -type f | xargs stat -c %i | sort | uniq | wc -l rm -rf $SCRATCH_MNT/edir |& head -n 10 -stat $SCRATCH_MNT/edir |& _filter_scratch +stat $SCRATCH_MNT/edir |& _filter_stat |& _filter_scratch # success, all done status=0
tests/generic/435.out +1 -1
@@ -1,4 +1,4 @@ QA output created by 435 100000 100000 -stat: cannot stat 'SCRATCH_MNT/edir': No such file or directory +stat: cannot statx 'SCRATCH_MNT/edir': No such file or directory
tests/generic/440 +1 -1
@@ -87,7 +87,7 @@ _scratch_cycle_mount cat $SCRATCH_MNT/edir2/link exec 3< $SCRATCH_MNT/edir2/link # pin inode with cached key in memory _unlink_session_encryption_key $keydesc -stat $SCRATCH_MNT/edir/file |& _filter_scratch +stat $SCRATCH_MNT/edir/file |& _filter_stat |& _filter_scratch cat "$(find $SCRATCH_MNT/edir/ -type f)" exec 3>&-
tests/generic/440.out +1 -1
@@ -9,5 +9,5 @@ cat: SCRATCH_MNT/edir/symlink: No such file or directory ***** Child has key, but parent doesn't ***** contents -stat: cannot stat 'SCRATCH_MNT/edir/file': No such file or directory +stat: cannot statx 'SCRATCH_MNT/edir/file': No such file or directory contents
tests/xfs/348 +1 -1
@@ -112,7 +112,7 @@ for dt in $dtypes; do rm -f $tmp.stat.err ftype=$(stat --printf=%F $testdir/$file 2>$tmp.stat.err) if [ -s $tmp.stat.err ]; then - cat $tmp.stat.err + cat $tmp.stat.err | _filter_stat else echo "stat: '$testdir/$file' is a $ftype" # Verify that readlink of a file posing as a symlink
tests/xfs/348.out +94 -94
285 lines not on this page · raw message
Signature · 1 line
2.20.1