xfs
[Top] [All Lists]

[PATCH] xfstests: print missing utility name

To: xfs-oss <xfs@xxxxxxxxxxx>
Subject: [PATCH] xfstests: print missing utility name
From: Lukáš Czerner <lczerner@xxxxxxxxxx>
Date: Wed, 12 Jun 2013 16:02:19 +0200 (CEST)
Delivered-to: xfs@xxxxxxxxxxx
User-agent: Alpine 2.00 (LFD 1167 2008-08-23)
Currently when the utility such as fio or dmsetup is missing user does
not get the information about the utility name which is actually
missing. Fix it by providing second argument to the _require_command().

Signed-off-by: Lukas Czerner <lczerner@xxxxxxxxxx>
---
 common/rc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/rc b/common/rc
index fe6bbfc..984cef1 100644
--- a/common/rc
+++ b/common/rc
@@ -1054,6 +1054,7 @@ _require_realtime()
 _require_command()
 {
     [ -n "$1" ] && _cmd="$1" || _cmd="$2"
+    [ -z $_cmd ] && _cmd="<fill utility name>"
     [ -n "$1" -a -x "$1" ] || _notrun "$_cmd utility required, skipped this 
test"
 }
 
@@ -1061,7 +1062,7 @@ _require_command()
 #
 _require_dm_flakey()
 {
-    _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
@@ -2036,7 +2037,7 @@ _require_fio()
 {
        job=$1
 
-       _require_command $FIO_PROG
+       _require_command $FIO_PROG fio
        if [ -z "$1" ]; then
                return 1;
        fi
-- 
1.8.2.1

<Prev in Thread] Current Thread [Next in Thread>