* [PATCH] xfstests: print missing utility name
@ 2013-06-12 14:02 Lukáš Czerner
2013-06-13 2:53 ` Dave Chinner
0 siblings, 1 reply; 3+ messages in thread
From: Lukáš Czerner @ 2013-06-12 14:02 UTC (permalink / raw)
To: xfs-oss
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@redhat.com>
---
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
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] xfstests: print missing utility name
2013-06-12 14:02 [PATCH] xfstests: print missing utility name Lukáš Czerner
@ 2013-06-13 2:53 ` Dave Chinner
2013-06-14 14:08 ` Lukáš Czerner
0 siblings, 1 reply; 3+ messages in thread
From: Dave Chinner @ 2013-06-13 2:53 UTC (permalink / raw)
To: Lukáš Czerner; +Cc: xfs-oss
On Wed, Jun 12, 2013 at 04:02:19PM +0200, Lukáš Czerner wrote:
> 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@redhat.com>
> ---
> 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>"
The problem here is that the command will be empty if it doesn't
exist, so it's difficult to tell if one or two parameters is valid.
So, I'd suggest that _require_command should be changed to:
_require_command()
{
_name=$1
_cmd=$2
[ $# -ge 1 ] || _fatal "Brainfart! What command is required?"
[ -n $_cmd -a -x $_cmd ] || _notrun "$_name not found, skipping test."
}
And all the callers have their parameters swapped to avoid this
confusion about what exists and what doesn't....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] xfstests: print missing utility name
2013-06-13 2:53 ` Dave Chinner
@ 2013-06-14 14:08 ` Lukáš Czerner
0 siblings, 0 replies; 3+ messages in thread
From: Lukáš Czerner @ 2013-06-14 14:08 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs-oss
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1567 bytes --]
On Thu, 13 Jun 2013, Dave Chinner wrote:
> Date: Thu, 13 Jun 2013 12:53:50 +1000
> From: Dave Chinner <david@fromorbit.com>
> To: Lukáš Czerner <lczerner@redhat.com>
> Cc: xfs-oss <xfs@oss.sgi.com>
> Subject: Re: [PATCH] xfstests: print missing utility name
>
> On Wed, Jun 12, 2013 at 04:02:19PM +0200, Lukáš Czerner wrote:
> > 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@redhat.com>
> > ---
> > 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>"
>
>
> The problem here is that the command will be empty if it doesn't
> exist, so it's difficult to tell if one or two parameters is valid.
>
> So, I'd suggest that _require_command should be changed to:
>
> _require_command()
> {
> _name=$1
> _cmd=$2
>
> [ $# -ge 1 ] || _fatal "Brainfart! What command is required?"
> [ -n $_cmd -a -x $_cmd ] || _notrun "$_name not found, skipping test."
> }
>
> And all the callers have their parameters swapped to avoid this
> confusion about what exists and what doesn't....
>
> Cheers,
>
> Dave.
Fair enough.
-Lukas
>
>
[-- Attachment #2: Type: text/plain, Size: 121 bytes --]
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-06-14 14:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-12 14:02 [PATCH] xfstests: print missing utility name Lukáš Czerner
2013-06-13 2:53 ` Dave Chinner
2013-06-14 14:08 ` Lukáš Czerner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox