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 54659ecdb5 ("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.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Eryu Guan
2016-11-07 01:43:33 +08:00
parent e604301e26
commit ae254a9f9f
4 changed files with 13 additions and 17 deletions
+10 -14
View File
@@ -2911,30 +2911,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