xfstest random fixes
cover xfstest random fixes
Below are some of xfstest fixes with 4k blocksize(ppc64) and xfs filesystem.
Anju T Sudhakar (3):
xfs/504: Add scratch_mount before checking for xfs_scrub unicode
support.
xfs/514: Check xfsprogs version for verifying the xfs_db commands xfs/515: Check xfsprogs version for testing xfs_quota commands
tests/xfs/504 | 3 +++ tests/xfs/514 | 12 +++++++++++- tests/xfs/515 | 15 +++++++++++++-- 3 files changed, 27 insertions(+), 3 deletions(-)
Signature · 1 line
2.31.1
PATCH 1/3 xfs/504: Add scratch_mount before checking for xfs_scrub unicode support.
We may not detect the error Inappropriate ioctl for device, while running $XFS_IO_PROG -c "scrub probe" "$mountpoint", if scratch device is not mounted before invoking _check_xfs_scrub_does_unicode(). So do _scratch_mount before checking for xfs_scrub support.
--- tests/xfs/504 | 3 +++ 1 file changed, 3 insertions(+)
tests/xfs/504 +3 -0
@@ -21,8 +21,11 @@ _require_xfs_io_command 'label' echo "Silence is golden." +_scratch_mkfs > /dev/null +_scratch_mount want_scrub= _check_xfs_scrub_does_unicode "$SCRATCH_MNT" "$SCRATCH_DEV" && want_scrub=yes +_scratch_unmount filter_scrub() { grep 'Unicode' | sed -e 's/^.*Duplicate/Duplicate/g'
Signature · 1 line
2.31.1
Re: [PATCH 1/3] xfs/504: Add scratch_mount before checking for xfs_scrub unicode support.
Quoted 6 lines · Anju T Sudhakar
We may not detect the error
Inappropriate ioctl for device, while running$XFS_IO_PROG -c "scrub probe" "$mountpoint", if scratch device is not mounted before invoking_check_xfs_scrub_does_unicode(). So do_scratch_mountbefore checking forxfs_scrubsupport.Signed-off-by Anju T Sudhakar <[email protected]>
Oops, heh, good catch!
--D
Quoted 23 lines
--- tests/xfs/504 | 3 +++ 1 file changed, 3 insertions(+)tests/xfs/504 +3
-0@@ -21,8 +21,11 @@ _require_xfs_io_command 'label' echo "Silence is golden." +_scratch_mkfs > /dev/null +_scratch_mount want_scrub= _check_xfs_scrub_does_unicode "$SCRATCH_MNT" "$SCRATCH_DEV" && want_scrub=yes +_scratch_unmount filter_scrub() { grep 'Unicode' | sed -e 's/^.*Duplicate/Duplicate/g'Signature · 1 line
2.31.1
PATCH 2/3 xfs/514: Check xfsprogs version for verifying the xfs_db commands
In reply to Anju T Sudhakarxfs_db commands like attr_remove, attr_set, btheight, and logformat, are documented only in xfsprogs version v5.5 and later. So skip checking for these commands in xfs_db manpage,if the test is running with xfsprogs version less than v5.5.
---
Query: The reason to add this check is, while running xfstest with an older version of xfsprogs, this test case flags as failure, though xfs_db is not expected to have those commands. Otherwise upon failure we should ask the user to use the latest version of xfsprogs. OR is there any better solution for this?
tests/xfs/514 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
tests/xfs/514 +11 -1
@@ -27,6 +27,11 @@ _require_test echo "Silence is golden" MANPAGE=$($MAN_PROG --path xfs_db) +# xfs_db commands - attr_remove, attr_set, btheight, and logformat +# are documented in 5.5.0 and later versions only. So skip checking for +# those commands if the version is less than 5.5.0. +command_list="attr_set attr_remove btheight logformat" +req_version=$($XFS_DB_PROG -V | cut -d" " -f3) case "$MANPAGE" in *.gz|*.z\|*.Z) CAT=zcat;;
@@ -41,7 +46,12 @@ truncate -s 128m $file $MKFS_XFS_PROG $file >> /dev/null for COMMAND in `$XFS_DB_PROG -x -c help $file | awk '{print $1}' | grep -v "^Use"`; do - $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \ + if [ "$req_version" \< "5.5.0" ]; then + if (echo $command_list | tr ' ' '\n' | grep -F -x -q "$COMMAND");then + continue + fi + fi + $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \ echo "$COMMAND not documented in the xfs_db manpage" done
Signature · 1 line
2.31.1
Re: [PATCH 2/3] xfs/514: Check xfsprogs version for verifying the xfs_db commands
Quoted 21 lines · Anju T Sudhakar
xfs_dbcommands likeattr_remove, attr_set, btheight, and logformat, are documented only in xfsprogs version v5.5 and later. So skip checking for these commands inxfs_dbmanpage,if the test is running with xfsprogs version less than v5.5.Signed-off-by Anju T Sudhakar <[email protected]>---
Query: The reason to add this check is, while running xfstest with an older version of xfsprogs, this test case flags as failure, thoughxfs_dbis not expected to have those commands. Otherwise upon failure we should ask the user to use the latest version of xfsprogs. OR is there any better solution for this?tests/xfs/514 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)tests/xfs/514 +0
-0
tests/xfs/514 _require_test · line 34
Quoted 8 lines
tests/xfs/514 +5
-0@@ -27,6 +27,11 @@ _require_test echo "Silence is golden" MANPAGE=$($MAN_PROG --path xfs_db) +# xfs_db commands - attr_remove, attr_set, btheight, and logformat +# are documented in 5.5.0 and later versions only. So skip checking for +# those commands if the version is less than 5.5.0. +command_list="attr_set attr_remove btheight logformat" +req_version=$($XFS_DB_PROG -V | cut -d" " -f3)
Generally I think it's a known "bug"(doc missing), and this case hit this bug in old xfsprogs, that's as expected.
Thanks,
Zorro
Quoted 20 lines
tests/xfs/514 +6
-1case "$MANPAGE" in *.gz|*.z\|*.Z) CAT=zcat;;@@ -41,7 +46,12 @@ truncate -s 128m $file $MKFS_XFS_PROG $file >> /dev/null for COMMAND in `$XFS_DB_PROG -x -c help $file | awk '{print $1}' | grep -v "^Use"`; do - $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \ + if [ "$req_version" \< "5.5.0" ]; then + if (echo $command_list | tr ' ' '\n' | grep -F -x -q "$COMMAND");then + continue + fi + fi + $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \ echo "$COMMAND not documented in the xfs_db manpage" doneSignature · 1 line
2.31.1
Re: [PATCH 2/3] xfs/514: Check xfsprogs version for verifying the xfs_db commands
In reply to Anju T SudhakarQuoted 5 lines · Anju T Sudhakar
xfs_dbcommands likeattr_remove, attr_set, btheight, and logformat, are documented only in xfsprogs version v5.5 and later. So skip checking for these commands inxfs_dbmanpage,if the test is running with xfsprogs version less than v5.5.
Quoted 7 lines
Signed-off-by Anju T Sudhakar <[email protected]>---
Query: The reason to add this check is, while running xfstest with an older version of xfsprogs, this test case flags as failure, thoughxfs_dbis not expected to have those commands. Otherwise upon failure we should ask the user to use the latest version of xfsprogs. OR is there any better solution for this?
If you're shipping xfsprogs 5.5 in a product, why not update the manpage to document the functionality that's in your product? If you aren't shipping 5.5, then why run such an old version?
--D
Quoted 37 lines
tests/xfs/514 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)tests/xfs/514 +11
-1@@ -27,6 +27,11 @@ _require_test echo "Silence is golden" MANPAGE=$($MAN_PROG --path xfs_db) +# xfs_db commands - attr_remove, attr_set, btheight, and logformat +# are documented in 5.5.0 and later versions only. So skip checking for +# those commands if the version is less than 5.5.0. +command_list="attr_set attr_remove btheight logformat" +req_version=$($XFS_DB_PROG -V | cut -d" " -f3) case "$MANPAGE" in *.gz|*.z\|*.Z) CAT=zcat;;@@ -41,7 +46,12 @@ truncate -s 128m $file $MKFS_XFS_PROG $file >> /dev/null for COMMAND in `$XFS_DB_PROG -x -c help $file | awk '{print $1}' | grep -v "^Use"`; do - $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \ + if [ "$req_version" \< "5.5.0" ]; then + if (echo $command_list | tr ' ' '\n' | grep -F -x -q "$COMMAND");then + continue + fi + fi + $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \ echo "$COMMAND not documented in the xfs_db manpage" doneSignature · 1 line
2.31.1
Re: [PATCH 2/3] xfs/514: Check xfsprogs version for verifying the xfs_db commands
Hi,
Quoted 13 lines · Darrick J. Wong
Quoted 5 lines · Anju T Sudhakar
xfs_dbcommands likeattr_remove, attr_set, btheight, and logformat, are documented only in xfsprogs version v5.5 and later. So skip checking for these commands inxfs_dbmanpage,if the test is running with xfsprogs version less than v5.5.Quoted 7 lines
Signed-off-by Anju T Sudhakar <[email protected]>---
Query: The reason to add this check is, while running xfstest with an older version of xfsprogs, this test case flags as failure, thoughxfs_dbis not expected to have those commands. Otherwise upon failure we should ask the user to use the latest version of xfsprogs. OR is there any better solution for this?
Quoted 5 lines
If you're shipping xfsprogs 5.5 in a product, why not update the manpage to document the functionality that's in your product? If you aren't shipping 5.5, then why run such an old version?
--D
OK. Then I think we can drop patch 2/3 and 3/3 in this series, as both checks for the
xfsprogs version to run the test.
Thanks,
Anju
PATCH 3/3 xfs/515: Check xfsprogs version for testing xfs_quota commands
In reply to Anju T Sudhakarxfs_quota command 'limit' is reformated in xfsprogs version v5.5.0, to make it suitable for this(xfs/515) test case. So the test case will flag failure while running with xfsprogs version less than v5.5, even though limit is documented in xfs_quota manpage. So skip this test for xfsprogs versions less than v5.5.
--- tests/xfs/515 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
tests/xfs/515 +13 -2
@@ -27,6 +27,11 @@ _require_test echo "Silence is golden" MANPAGE=$($MAN_PROG --path xfs_quota) +# xfs_quota command 'limit' is reformated in xfsprogs version v5.5.0, +# to make it suitable for this test case. For xfprogs versions less than +# v5.5.0, this test case can not detect the command 'limit'. +req_version=$($XFS_DB_PROG -V | cut -d" " -f3) +req_command="limit" case "$MANPAGE" in *.gz|*.z\|*.Z) CAT=zcat;;
@@ -36,8 +41,14 @@ case "$MANPAGE" in esac _require_command `which $CAT` $CAT -for COMMAND in `$XFS_QUOTA_PROG -x -c help $file | awk '{print $1}' | grep -v "^Use"`; do - $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \ +for COMMAND in `$XFS_QUOTA_PROG -x -c help $file | awk '{print $1}' | grep -v "^Use"`; +do + if [ "$req_version" \< "5.5.0" ]; then + if [ "$COMMAND" == "$req_command" ];then + continue + fi + fi + $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \ echo "$COMMAND not documented in the xfs_quota manpage" done
Signature · 1 line
2.31.1
Re: [PATCH 3/3] xfs/515: Check xfsprogs version for testing xfs_quota commands
Quoted 16 lines · Anju T Sudhakar
xfs_quotacommand 'limit' is reformated in xfsprogs version v5.5.0, to make it suitable for this(xfs/515) test case. So the test case will flag failure while running with xfsprogs version less than v5.5, even thoughlimitis documented inxfs_quotamanpage. So skip this test for xfsprogs versions less than v5.5.Signed-off-by Anju T Sudhakar <[email protected]>--- tests/xfs/515 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)tests/xfs/515 +0
-0
tests/xfs/515 _require_test · line 34
Quoted 8 lines
tests/xfs/515 +5
-0@@ -27,6 +27,11 @@ _require_test echo "Silence is golden" MANPAGE=$($MAN_PROG --path xfs_quota) +# xfs_quota command 'limit' is reformated in xfsprogs version v5.5.0, +# to make it suitable for this test case. For xfprogs versions less than +# v5.5.0, this test case can not detect the command 'limit'. +req_version=$($XFS_DB_PROG -V | cut -d" " -f3) +req_command="limit"
It's similar as the patch of [2/3], and I have similar review points. And checking program version isn't a good way to judge the expect behavior of a program, especially downstream always backport patches of upstream.
Thanks,
Zorro
Quoted 23 lines
tests/xfs/515 +8
-2case "$MANPAGE" in *.gz|*.z\|*.Z) CAT=zcat;;@@ -36,8 +41,14 @@ case "$MANPAGE" in esac _require_command `which $CAT` $CAT -for COMMAND in `$XFS_QUOTA_PROG -x -c help $file | awk '{print $1}' | grep -v "^Use"`; do - $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \ +for COMMAND in `$XFS_QUOTA_PROG -x -c help $file | awk '{print $1}' | grep -v "^Use"`; +do + if [ "$req_version" \< "5.5.0" ]; then + if [ "$COMMAND" == "$req_command" ];then + continue + fi + fi + $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \ echo "$COMMAND not documented in the xfs_quota manpage" doneSignature · 1 line
2.31.1