common: fix "utility required warning" with empty utility name

In generic/019, if we hadn't install fio, we will get following output:

 generic/019      [not run]  utility required, skipped this test <- *
 Not run: generic/019
 Passed all 0 tests

When fio is not installed, "$FIO_PROG" is set to blank, and
_require_fio() call _require_command() with none arguments.

This patch fixed all misuse of _require_command(), add 2nd argument
to let _require_command() output right message, and add quotes to
first argument to avoid argument shifting.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Zhao Lei
2015-03-18 15:00:23 +11:00
committed by Dave Chinner
parent 57914b8850
commit 7a1ad744f2
12 changed files with 17 additions and 17 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ _require_defrag()
;;
esac
_require_command $DEFRAG_PROG
_require_command "$DEFRAG_PROG" defragment
_require_xfs_io_command "fiemap"
}
+3 -3
View File
@@ -1299,7 +1299,7 @@ _require_dm_flakey()
{
# require SCRATCH_DEV to be a valid block device
_require_block_device $SCRATCH_DEV
_require_command $DMSETUP_PROG
_require_command "$DMSETUP_PROG" dmsetup
modprobe dm-flakey >/dev/null 2>&1
$DMSETUP_PROG targets | grep flakey >/dev/null 2>&1
@@ -2289,7 +2289,7 @@ _require_deletable_scratch_dev_pool()
_require_btrfs()
{
cmd=$1
_require_command $BTRFS_UTIL_PROG btrfs
_require_command "$BTRFS_UTIL_PROG" btrfs
if [ -z "$1" ]; then
return 1;
fi
@@ -2302,7 +2302,7 @@ _require_fio()
{
job=$1
_require_command $FIO_PROG
_require_command "$FIO_PROG" fio
if [ -z "$1" ]; then
return 1;
fi
+1 -1
View File
@@ -51,7 +51,7 @@ _supported_os Linux
_require_scratch
_require_scratch_dev_pool 4
_require_deletable_scratch_dev_pool
_require_command $WIPEFS_PROG
_require_command "$WIPEFS_PROG" wipefs
rm -f $seqres.full
+1 -1
View File
@@ -53,7 +53,7 @@ _supported_os Linux
_require_scratch
_require_no_large_scratch_dev
_require_btrfs inspect-internal
_require_command "/usr/sbin/filefrag"
_require_command "/usr/sbin/filefrag" filefrag
rm -f $seqres.full
+1 -1
View File
@@ -63,7 +63,7 @@ _need_to_be_root
_supported_fs btrfs
_require_scratch_nocheck
_require_scratch_dev_pool 4
_require_command $BTRFS_SHOW_SUPER_PROG btrfs-show-super
_require_command "$BTRFS_SHOW_SUPER_PROG" btrfs-show-super
rm -f $seqres.full
rm -f $tmp.tmp
+3 -3
View File
@@ -57,9 +57,9 @@ _require_scratch_nocheck
BTRFS_CONVERT_PROG="`set_prog_path btrfs-convert`"
E2FSCK_PROG="`set_prog_path e2fsck`"
_require_command $BTRFS_CONVERT_PROG btrfs-convert
_require_command $MKFS_EXT4_PROG mkfs.ext4
_require_command $E2FSCK_PROG e2fsck
_require_command "$BTRFS_CONVERT_PROG" btrfs-convert
_require_command "$MKFS_EXT4_PROG" mkfs.ext4
_require_command "$E2FSCK_PROG" e2fsck
rm -f $seqres.full
+1 -1
View File
@@ -61,7 +61,7 @@ _require_scratch
_need_to_be_root
# Since xfs_io's fiemap always use SYNC flag and can't be unset,
# we must use filefrag to call fiemap without SYNC flag.
_require_command "/usr/sbin/filefrag"
_require_command "/usr/sbin/filefrag" filefrag
_require_xfs_io_command "falloc"
filesize=$((10 * 1024 * 1024 * 1024)) #10G size
+2 -2
View File
@@ -72,8 +72,8 @@ _supported_os Linux
_require_test
_require_scratch
_require_command $DUMP_PROG
_require_command $RESTORE_PROG
_require_command "$DUMP_PROG" dump
_require_command "$RESTORE_PROG" restore
rm -f $seqres.full
echo "Silence is golden"
+1 -1
View File
@@ -46,7 +46,7 @@ _supported_fs xfs
_supported_os IRIX Linux
_require_realtime
_require_scratch
_require_command $XFS_IO_PROG xfs_io
_require_command "$XFS_IO_PROG" xfs_io
_filter_realtime_flag()
{
+1 -1
View File
@@ -66,7 +66,7 @@ _filter_noymlinks_flag()
# real QA test starts here
_supported_os Linux IRIX
_supported_fs xfs
_require_command $XFS_IO_PROG xfs_io
_require_command "$XFS_IO_PROG" xfs_io
_require_scratch
_create_scratch
+1 -1
View File
@@ -39,7 +39,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
# real QA test starts here
_supported_fs xfs
_supported_os Linux
_require_command $INDENT_PROG "indent"
_require_command "$INDENT_PROG" indent
# filter out known changes to xfs type sizes
_type_size_filter()
+1 -1
View File
@@ -65,7 +65,7 @@ _supported_os Linux
_require_test
_require_user
_require_command $XFSDUMP_PROG xfsdump
_require_command "$XFSDUMP_PROG" xfsdump
echo "Preparing subtree"
mkdir $TEST_DIR/d