fstests: make xfs_io mandatory
PATCH 1/1 fstests: make xfs_io mandatory
_test_inode_flag() and _test_inode_extsz() use "which $XFS_IO_PROG" to check if xfs_io command is available. And "-i" option was added to XFS_IO_PROG varibable by commit 54659ecdb575 ("fstests: run xfs_io with -i option if supported"). So the command becomes "which /usr/sbin/xfs_io -i", and it stops and waits for input from stdin, because "-i" option of "which" means "Read aliases from stdin".
I've seen xfs/008 hang when testing with latest xfsprogs, where xfs_io has "-i" support.
Fix it by removing the xfs_io command detections, and making xfs_io mandatory in common/config.
Also fix the indentions in these functions, use tab instead of spaces, while we're at it.
--- common/config | 4 +++- common/rc | 24 ++++++++++-------------- tests/xfs/094 | 1 - tests/xfs/103 | 1 - 4 files changed, 13 insertions(+), 17 deletions(-)
common/config +3 -1
@@ -158,11 +158,13 @@ export DF_PROG="`set_prog_path df`" [ "$DF_PROG" = "" ] && _fatal "df not found" [ "$HOSTOS" = "Linux" ] && export DF_PROG="$DF_PROG -T -P" +export XFS_IO_PROG="`set_prog_path xfs_io`" +[ "$XFS_IO_PROG" = "" ] && _fatal "xfs_io not found" + export XFS_LOGPRINT_PROG="`set_prog_path xfs_logprint`" export XFS_REPAIR_PROG="`set_prog_path xfs_repair`" export XFS_DB_PROG="`set_prog_path xfs_db`" export XFS_GROWFS_PROG=`set_prog_path xfs_growfs` -export XFS_IO_PROG="`set_prog_path xfs_io`" export XFS_SCRUB_PROG="`set_prog_path xfs_scrub`" export XFS_PARALLEL_REPAIR_PROG="`set_prog_path xfs_prepair`" export XFS_PARALLEL_REPAIR64_PROG="`set_prog_path xfs_prepair64`"
common/rc +10 -14
@@ -2896,30 +2896,26 @@ _populate_fs() # _test_inode_flag() { - flag=$1 - file=$2 + flag=$1 + file=$2 - if which $XFS_IO_PROG >/dev/null; then - if $XFS_IO_PROG -r -c 'lsattr -v' "$file" | grep -q "$flag" ; then - return 0 - fi - fi - return 1 + if $XFS_IO_PROG -r -c 'lsattr -v' "$file" | grep -q "$flag" ; then + return 0 + fi + return 1 } # query the given files extsize allocator hint in bytes (if any) # _test_inode_extsz() { - file=$1 - blocks="" + file=$1 + blocks="" - if which $XFS_IO_PROG >/dev/null; then blocks=`$XFS_IO_PROG -r -c 'stat' "$file" | \ awk '/^xattr.extsize =/ { print $3 }'` - fi - [ -z "$blocks" ] && blocks="0" - echo $blocks + [ -z "$blocks" ] && blocks="0" + echo $blocks } # scratch_dev_pool should contain the disks pool for the btrfs raid
tests/xfs/094 +0 -1
@@ -46,7 +46,6 @@ _supported_fs xfs _supported_os IRIX Linux _require_realtime _require_scratch -_require_command "$XFS_IO_PROG" xfs_io _filter_realtime_flag() {
tests/xfs/103 +0 -1
@@ -66,7 +66,6 @@ _filter_noymlinks_flag() # real QA test starts here _supported_os Linux IRIX _supported_fs xfs -_require_command "$XFS_IO_PROG" xfs_io _require_scratch _create_scratch
Signature · 1 line
2.7.4
Quoted 6 lines · Eryu Guan
_test_inode_flag()and_test_inode_extsz()use "which $XFS_IO_PROG" to check ifxfs_iocommand is available. And "-i" option was added toXFS_IO_PROGvaribable by commit54659ecdb575("fstests: runxfs_iowith -i option if supported"). So the command becomes "which/usr/sbin/xfs_io-i", and it stops and waits for input from stdin, because "-i" option of "which" means "Read aliases from stdin".
Funnily enough, I looked at those functions a couple of days ago and thought "wow, they must have been written a long time ago if they are trying to work if xfs_io is installed"...
Quoted 8 lines
I've seen xfs/008 hang when testing with latest xfsprogs, where
xfs_iohas "-i" support.Fix it by removing the
xfs_iocommand detections, and makingxfs_iomandatory in common/config.Also fix the indentions in these functions, use tab instead of spaces, while we're at it.
Yeah, I noticed that too :P
Quoted 13 lines
Signed-off-by Eryu Guan <[email protected]>--- common/config | 4 +++- common/rc | 24 ++++++++++-------------- tests/xfs/094 | 1 - tests/xfs/103 | 1 - 4 files changed, 13 insertions(+), 17 deletions(-)common/config +0
-0
common/config export DF_PROG="`set_prog_path df`" · line 163
Quoted 6 lines
common/config +3
-0@@ -158,11 +158,13 @@ export DF_PROG="`set_prog_path df`" [ "$DF_PROG" = "" ] && _fatal "df not found" [ "$HOSTOS" = "Linux" ] && export DF_PROG="$DF_PROG -T -P" +export XFS_IO_PROG="`set_prog_path xfs_io`" +[ "$XFS_IO_PROG" = "" ] && _fatal "xfs_io not found" +
Yup, seems like a reasonable thing to do at this point.
Signature · 2 lines
Dave Chinner [email protected]
Looks good: