Re: [Xenomai-core] [patch] fix xeno-test for busybox

2006-09-13 Thread Romain Lenglet
Romain Lenglet wrote:
> Romain Lenglet wrote:
> > Gilles Chanteperdrix wrote:
> > > Jan Kiszka wrote:
> > >  > Jan Kiszka wrote:
> > >  > > Hi,
> > >  > >
> > >  > > I just tried to fire up xeno-test on a busybox system
> > >  > > - without success. Reason: missing getopts. But
> > >  > > busybox initial test checks for something else,
> > >  > > namely getopt. The attached patch should fix this it,
> > >  > > also taking into account that getopts in a shell
> > >  > > built-in, not an applet.
> > >  >
> > >  > Another quirk: switchtest runs with hard-wired -T
> > >  > 120...
> > >
> > > Could you try the attached patch ?
> >
> > Dumb question about your patch...
> > Shouldn't you keep the -T option in the $pass variable, to
> > pass it to latency?
> >
> > T) timeout=$OPTARG
> > pass="$pass -T $timeout" ;;
>
> The problem is that, if you don't put it in $pass, you must
> re-pass the latency option explicitly when logging, since it
> is no more in $pass, and is not in $loadpass. Otherwise,
>
> script -c "`dirname $0`/xeno-test $loadpass $pass $*" $wfile
>
> should become:
>
> script -c "`dirname $0`/xeno-test $loadpass $pass -T $latency
> $*" $wfile
>
>
> Therefore, I propose a slightly different patch. The -T option
> may be duplicated in $opts, but hopefully this is not a
> problem with the latency command?

A patch that avoid duplicating the -T option.

-- 
Romain LENGLET

-- 
Romain LENGLET
Pr. Chiba Shigeru Group
Dept. of Mathematical and Computing Sciences
Tokyo Institute of Technology
--- xeno-test.in.orig	2006-09-13 15:49:31.0 +0900
+++ xeno-test.in	2006-09-13 15:58:13.0 +0900
@@ -24,6 +24,8 @@
   -v		verbose
   -M 	sends output to given addr
   -m		sends output to [EMAIL PROTECTED]
+  -T  do not run each test for more than  seconds (defaults
+		to 120 seconds)
   -U 	uploads output to given URL
   -D 	alternate options to date, for timestamp (dflt: 
 
@@ -31,7 +33,6 @@
   -s	print statistics of sampled data (default on)
   -h	print histogram of sampled data (default on, implies -s)
   -q	quiet, dont print 1 sec sampled data (default on, off if !-T)
-  -T 		 (default: 120 sec)
   -l  (default 21)
   -H 	 (default 100)
   -B 	 (default 1000 ns)
@@ -186,10 +187,13 @@
 fi
 }
 
+timeoutset=n
+timeout=120
 
 run_w_load() {
 local opts="$*";
-[ "$opts"  = '' ] && opts='-sh -T 120'
+[ "$opts"  = '' ] && opts='-sh'
+[ "$timeoutset" = 'n' ] && opts="$opts -T $timeout"
 
 boxinfo
 loudly generate_loads $workload
@@ -201,7 +205,7 @@
 	loudly ./run -- $XENOT_LATENCY $opts -t2 '# latency'
 )
 (	cd `dirname $0`/../testsuite/switchtest
-	loudly ./run -- -T 120 $XENOT_SWITCHTEST '# switchtest'
+	loudly ./run -- -T $timeout $XENOT_SWITCHTEST '# switchtest'
 )
 (	cd `dirname $0`/../testsuite/switchbench
 	loudly ./run -- -h $XENOT_SWITCHBENCH '# switchbench'
@@ -280,9 +284,13 @@
 	# latency passthrus
 	s|h|q)
 	pass="$pass -$FOO" ;;
-	T|l|H|B|p)
+	l|H|B|p)
 	pass="$pass -$FOO $OPTARG" ;;
 
+	T) timeout=$OPTARG 
+	timeoutset=y
+	pass="$pass -T $timeout" ;;
+
 	# workload related
 	d) 
 	device=$OPTARG
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [patch] fix xeno-test for busybox

2006-09-12 Thread Romain Lenglet
Romain Lenglet wrote:
> Gilles Chanteperdrix wrote:
> > Jan Kiszka wrote:
> >  > Jan Kiszka wrote:
> >  > > Hi,
> >  > >
> >  > > I just tried to fire up xeno-test on a busybox system -
> >  > > without success. Reason: missing getopts. But busybox
> >  > > initial test checks for something else, namely getopt.
> >  > > The attached patch should fix this it, also taking into
> >  > > account that getopts in a shell built-in, not an
> >  > > applet.
> >  >
> >  > Another quirk: switchtest runs with hard-wired -T 120...
> >
> > Could you try the attached patch ?
>
> Dumb question about your patch...
> Shouldn't you keep the -T option in the $pass variable, to
> pass it to latency?
>
> T) timeout=$OPTARG
> pass="$pass -T $timeout" ;;

The problem is that, if you don't put it in $pass, you must 
re-pass the latency option explicitly when logging, since it is 
no more in $pass, and is not in $loadpass. Otherwise,

script -c "`dirname $0`/xeno-test $loadpass $pass $*" $wfile

should become:

script -c "`dirname $0`/xeno-test $loadpass $pass -T $latency $*" 
$wfile


Therefore, I propose a slightly different patch. The -T option 
may be duplicated in $opts, but hopefully this is not a problem 
with the latency command?


-- 
Romain LENGLET
--- xeno-test.in.orig	2006-09-13 15:49:31.0 +0900
+++ xeno-test.in	2006-09-13 15:52:50.0 +0900
@@ -24,6 +24,8 @@
   -v		verbose
   -M 	sends output to given addr
   -m		sends output to [EMAIL PROTECTED]
+  -T  do not run each test for more than  seconds (defaults
+		to 120 seconds)
   -U 	uploads output to given URL
   -D 	alternate options to date, for timestamp (dflt: 
 
@@ -31,7 +33,6 @@
   -s	print statistics of sampled data (default on)
   -h	print histogram of sampled data (default on, implies -s)
   -q	quiet, dont print 1 sec sampled data (default on, off if !-T)
-  -T 		 (default: 120 sec)
   -l  (default 21)
   -H 	 (default 100)
   -B 	 (default 1000 ns)
@@ -186,10 +187,12 @@
 fi
 }
 
+timeout=120
 
 run_w_load() {
 local opts="$*";
-[ "$opts"  = '' ] && opts='-sh -T 120'
+[ "$opts"  = '' ] && opts='-sh'
+opts="$opts -T $timeout"
 
 boxinfo
 loudly generate_loads $workload
@@ -201,7 +204,7 @@
 	loudly ./run -- $XENOT_LATENCY $opts -t2 '# latency'
 )
 (	cd `dirname $0`/../testsuite/switchtest
-	loudly ./run -- -T 120 $XENOT_SWITCHTEST '# switchtest'
+	loudly ./run -- -T $timeout $XENOT_SWITCHTEST '# switchtest'
 )
 (	cd `dirname $0`/../testsuite/switchbench
 	loudly ./run -- -h $XENOT_SWITCHBENCH '# switchbench'
@@ -280,9 +283,12 @@
 	# latency passthrus
 	s|h|q)
 	pass="$pass -$FOO" ;;
-	T|l|H|B|p)
+	l|H|B|p)
 	pass="$pass -$FOO $OPTARG" ;;
 
+	T) timeout=$OPTARG 
+	pass="$pass -T $timeout" ;;
+
 	# workload related
 	d) 
 	device=$OPTARG
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [patch] fix xeno-test for busybox

2006-09-12 Thread Gilles Chanteperdrix
Gilles Chanteperdrix wrote:
 > Jan Kiszka wrote:
 >  > Jan Kiszka wrote:
 >  > > Hi,
 >  > > 
 >  > > I just tried to fire up xeno-test on a busybox system - without success.
 >  > > Reason: missing getopts. But busybox initial test checks for something
 >  > > else, namely getopt. The attached patch should fix this it, also taking
 >  > > into account that getopts in a shell built-in, not an applet.
 >  > > 
 >  > 
 >  > Another quirk: switchtest runs with hard-wired -T 120...
 > 
 > Could you try the attached patch ?

A better patch.

-- 


Gilles Chanteperdrix.
Index: scripts/xeno-test.in
===
--- scripts/xeno-test.in(revision 1600)
+++ scripts/xeno-test.in(working copy)
@@ -24,6 +24,8 @@
   -v   verbose
   -Msends output to given addr
   -m   sends output to [EMAIL PROTECTED]
+  -T  do not run each test for more than  seconds (defaults
+   to 120 seconds)
   -U  uploads output to given URL
   -D  alternate options to date, for timestamp (dflt: 
 
@@ -31,7 +33,6 @@
   -s   print statistics of sampled data (default on)
   -h   print histogram of sampled data (default on, implies -s)
   -q   quiet, dont print 1 sec sampled data (default on, off if !-T)
-  -T  (default: 120 sec)
   -l  (default 21)
   -H   (default 100)
   -B (default 1000 ns)
@@ -186,10 +187,12 @@
 fi
 }
 
+timeout=120
 
 run_w_load() {
 local opts="$*";
-[ "$opts"  = '' ] && opts='-sh -T 120'
+[ "$opts"  = '' ] && opts='-sh'
+opts="$opts -T $timeout"
 
 boxinfo
 loudly generate_loads $workload
@@ -201,7 +204,7 @@
loudly ./run -- $XENOT_LATENCY $opts -t2 '# latency'
 )
 (  cd `dirname $0`/../testsuite/switchtest
-   loudly ./run -- -T 120 $XENOT_SWITCHTEST '# switchtest'
+   loudly ./run -- -T $timeout $XENOT_SWITCHTEST '# switchtest'
 )
 (  cd `dirname $0`/../testsuite/switchbench
loudly ./run -- -h $XENOT_SWITCHBENCH '# switchbench'
@@ -280,9 +283,11 @@
# latency passthrus
s|h|q)
pass="$pass -$FOO" ;;
-   T|l|H|B|p)
+   l|H|B|p)
pass="$pass -$FOO $OPTARG" ;;
 
+   T) timeout=$OPTARG;;
+
# workload related
d) 
device=$OPTARG
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [patch] fix xeno-test for busybox

2006-09-12 Thread Romain Lenglet
Gilles Chanteperdrix wrote:
> Jan Kiszka wrote:
>  > Jan Kiszka wrote:
>  > > Hi,
>  > >
>  > > I just tried to fire up xeno-test on a busybox system -
>  > > without success. Reason: missing getopts. But busybox
>  > > initial test checks for something else, namely getopt.
>  > > The attached patch should fix this it, also taking into
>  > > account that getopts in a shell built-in, not an applet.
>  >
>  > Another quirk: switchtest runs with hard-wired -T 120...
>
> Could you try the attached patch ?

Dumb question about your patch...
Shouldn't you keep the -T option in the $pass variable, to pass 
it to latency?

T) timeout=$OPTARG
pass="$pass -T $timeout" ;;



-- 
Romain LENGLET

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [patch] fix xeno-test for busybox

2006-09-12 Thread Gilles Chanteperdrix
Jan Kiszka wrote:
 > Jan Kiszka wrote:
 > > Hi,
 > > 
 > > I just tried to fire up xeno-test on a busybox system - without success.
 > > Reason: missing getopts. But busybox initial test checks for something
 > > else, namely getopt. The attached patch should fix this it, also taking
 > > into account that getopts in a shell built-in, not an applet.
 > > 
 > 
 > Another quirk: switchtest runs with hard-wired -T 120...

Could you try the attached patch ?

-- 


Gilles Chanteperdrix.
Index: scripts/xeno-test.in
===
--- scripts/xeno-test.in(revision 1599)
+++ scripts/xeno-test.in(working copy)
@@ -24,6 +24,8 @@
   -v   verbose
   -Msends output to given addr
   -m   sends output to [EMAIL PROTECTED]
+  -T  do not run each test for more than  seconds (defaults
+   to 120 seconds)
   -U  uploads output to given URL
   -D  alternate options to date, for timestamp (dflt: 
 
@@ -31,7 +33,6 @@
   -s   print statistics of sampled data (default on)
   -h   print histogram of sampled data (default on, implies -s)
   -q   quiet, dont print 1 sec sampled data (default on, off if !-T)
-  -T  (default: 120 sec)
   -l  (default 21)
   -H   (default 100)
   -B (default 1000 ns)
@@ -186,10 +187,11 @@
 fi
 }
 
+timeout=120
 
 run_w_load() {
 local opts="$*";
-[ "$opts"  = '' ] && opts='-sh -T 120'
+[ "$opts"  = '' ] && opts="-sh -T $timeout"
 
 boxinfo
 loudly generate_loads $workload
@@ -201,7 +203,7 @@
loudly ./run -- $XENOT_LATENCY $opts -t2 '# latency'
 )
 (  cd `dirname $0`/../testsuite/switchtest
-   loudly ./run -- -T 120 $XENOT_SWITCHTEST '# switchtest'
+   loudly ./run -- -T $timeout $XENOT_SWITCHTEST '# switchtest'
 )
 (  cd `dirname $0`/../testsuite/switchbench
loudly ./run -- -h $XENOT_SWITCHBENCH '# switchbench'
@@ -280,9 +282,11 @@
# latency passthrus
s|h|q)
pass="$pass -$FOO" ;;
-   T|l|H|B|p)
+   l|H|B|p)
pass="$pass -$FOO $OPTARG" ;;
 
+   T) timeout=$OPTARG;;
+
# workload related
d) 
device=$OPTARG
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [patch] fix xeno-test for busybox

2006-09-12 Thread Jan Kiszka
Niklaus Giger wrote:
> Am Dienstag, 12. September 2006 21:11 schrieb Jan Kiszka:
>> Niklaus Giger wrote:
>>> Am Dienstag, 12. September 2006 18:56 schrieb Jan Kiszka:
>> I do not, please re-read the second part of my patch.
> Sorry, I seem to have a bad day today, and cannot even distinguish between - 
> and + :-)
> 

I took this as an ack and applied the patch. :)

Jan

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core



Re: [Xenomai-core] [patch] fix xeno-test for busybox

2006-09-12 Thread Niklaus Giger
Am Dienstag, 12. September 2006 21:11 schrieb Jan Kiszka:
> Niklaus Giger wrote:
> > Am Dienstag, 12. September 2006 18:56 schrieb Jan Kiszka:
> I do not, please re-read the second part of my patch.
Sorry, I seem to have a bad day today, and cannot even distinguish between - 
and + :-)

Best regards
-- 
Niklaus Giger

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [patch] fix xeno-test for busybox

2006-09-12 Thread Jan Kiszka
Niklaus Giger wrote:
> Am Dienstag, 12. September 2006 18:56 schrieb Jan Kiszka:
>> Hi,
>>
>> I just tried to fire up xeno-test on a busybox system - without success.
>> Reason: missing getopts. But busybox initial test checks for something
>> else, namely getopt. The attached patch should fix this it, also taking
>> into account that getopts in a shell built-in, not an applet.
>>
>> Jan
> I agree that getopt is not used anywhere in xeno-test. Therefore we may skip 
> the test.
> 
> But why do you want to eliminate the test whether getopts is really a 
> built-in 
> of the busybox? My intention was to simplify chasing the bug if someobody 
> uses a busybox without a built-in getopts, e.g. Busybox option 
> CONFIG_ASH_GETOPTS is not set.

I do not, please re-read the second part of my patch.

Jan



signature.asc
Description: OpenPGP digital signature
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [patch] fix xeno-test for busybox

2006-09-12 Thread Niklaus Giger
Am Dienstag, 12. September 2006 18:56 schrieb Jan Kiszka:
> Hi,
>
> I just tried to fire up xeno-test on a busybox system - without success.
> Reason: missing getopts. But busybox initial test checks for something
> else, namely getopt. The attached patch should fix this it, also taking
> into account that getopts in a shell built-in, not an applet.
>
> Jan
I agree that getopt is not used anywhere in xeno-test. Therefore we may skip 
the test.

But why do you want to eliminate the test whether getopts is really a built-in 
of the busybox? My intention was to simplify chasing the bug if someobody 
uses a busybox without a built-in getopts, e.g. Busybox option 
CONFIG_ASH_GETOPTS is not set.

Best regards

-- 
Niklaus Giger

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [patch] fix xeno-test for busybox

2006-09-12 Thread Jan Kiszka
Jan Kiszka wrote:
> Hi,
> 
> I just tried to fire up xeno-test on a busybox system - without success.
> Reason: missing getopts. But busybox initial test checks for something
> else, namely getopt. The attached patch should fix this it, also taking
> into account that getopts in a shell built-in, not an applet.
> 

Another quirk: switchtest runs with hard-wired -T 120...

Jan



signature.asc
Description: OpenPGP digital signature
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


[Xenomai-core] [patch] fix xeno-test for busybox

2006-09-12 Thread Jan Kiszka
Hi,

I just tried to fire up xeno-test on a busybox system - without success.
Reason: missing getopts. But busybox initial test checks for something
else, namely getopt. The attached patch should fix this it, also taking
into account that getopts in a shell built-in, not an applet.

Jan
Index: scripts/xeno-test.in
===
--- scripts/xeno-test.in(revision 1591)
+++ scripts/xeno-test.in(working copy)
@@ -57,8 +57,8 @@ pidFile=/var/lock/`basename $0.$$`.pids
 
 checkUtilities() {
   # Check for needed helper utilities
-  local neededApplets="awk basename cut date dd dirname egrep grep getopt
-  head kill md5sum mount sleep test top uname zcat"
+  local neededApplets="awk basename cut date dd dirname egrep grep head
+  kill md5sum mount sleep test top uname zcat"
   local foundAll=1
   for  _j in $neededApplets
   do
@@ -67,6 +67,10 @@ checkUtilities() {
   foundAll=0
 fi
   done
+  if ! type getopts 2>&1 >/dev/null; then
+echo "Please build busybox's ash with support for getopts"
+foundAll=0
+  fi
   if test $foundAll -eq 0 ; then exit 3 ; fi
 }
 


signature.asc
Description: OpenPGP digital signature
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core