Improved xeno-test: Ready for checkin
Hi
Here is my patch for improved versions of xeno-info/load/config/test as well as a Ruby test script for the maintainers.
The modified scripts pass the test for most options to xeno-test. The only exception is "-v" for verbose. As I have no clue how/what this option should do I left it as is.
The modifications are:
- busybox supported
- The load jobs (dd) are killed correctly
- two new lines for my buildbot "xeno-test started" and "xeno-test finished"
- the options -m / -L are no more silent, but echo also on the standard out. If the old behaviour is preferred, it would be simple to restore it. But the actual behaviour is easier to debug and fits better into the buildbot logs.
The tests under the busybox are not as good as with a normal shell, but work good enough with my buildbot. I will try to integrate them later into the Ruby test script.
Attached are also all log files of my testruns, if you want to verify that everything work as expected. A manual inspection of all logfiles did not reveal anymore hidden bugs to me (after quite a few runs to improve my test cases -).
After generating all logs, the testscript resumed the results like this:
Quoted 7 lines
Thu Jun 22 23:31:34 CEST 2006: 14 PASSED: 0 seconds. opts <-M
[email protected] -xxxx > returned 0 Writing tst to/mnt/data.ng/hcu/kernel/xenomai-head/scripts/test/logs/xeno-test.storeThuJun 22 23:31:34 CEST 2006: 9 PASSED: -N marker:["markertest-2.6.14-1252M-ppc-060622.232920"] Thu Jun 22 23:31:34 CEST 2006: 8 PASSED: -L: ["
/tmp/test-2.6.14-1252M-ppc-060622.232417", "/tmp/test-2.6.14-1252M-ppc-060622.232452",
<..>
Quoted 8 lines
"
/tmp/test-2.6.14-1252M-ppc-2006-marker-06-marker", "/tmp/test-2.6.14-1252M-ppc-060622.233100"] running all Checks CHK 10 FAILED opts -v could not find xeno-test: finished
searched in/mnt/data.ng/hcu/kernel/xenomai-head/scripts/test/logs/test_xeno_test.log.10 CHK 10 FAILED, could not find xeno-test: finished in/mnt/data.ng/hcu/kernel/xenomai-head/scripts/test/logs/test_xeno_test.log.10 completed all Checks
Unless you spot any error in my tests, I will not improve my scripts nor the xeno-test scripts in the near future. Also I would appreciate go know whether the error is already present in the current version of xeno-test.
As rc3 is still not out, I do not see any reason not to check in this patch. But I would like to see this happen soon, as I will not be able to fix errors after next Wednesday.
Best regards
Signature · 1 line
Niklaus Giger
xeno-config.in +1 -1
@@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh staging=${DESTDIR} prefix="@prefix@"
xeno-info +23 -2
@@ -1,31 +1,46 @@ -#!/bin/sh +#! /bin/sh # # This file has been lifted 'as is' from linux/scripts/ver_linux. -# +# Adapted to be run also under the BusyBox. If you want to test it under the BusyBox use +# busybox sh xeno-info PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:$PATH echo 'If some fields are empty or look unusual you may have an old version.' echo 'Compare to the current minimal requirements in Documentation/Changes.' echo ' ' +withBusybox=0 +if sh --help 2>&1| grep -q BusyBox; then + withBusybox=1; +# else running a real /bin/sh (bash) shell +fi + +if test $withBusybox -eq 1; then busybox | grep -i "BusyBox v" ; fi + uname -a echo ' ' +if test -n "`which gcc`" ; then gcc --version 2>&1| head -n 1 | grep -v gcc | awk \ 'NR==1{print "Gnu C ", $1}' gcc --version 2>&1| grep gcc | awk \ 'NR==1{print "Gnu C ", $3}' +fi +if test -n "`which gcc`" ; then make --version 2>&1 | awk -F, '{print $1}' | awk \ '/GNU Make/{print "Gnu make ",$NF}' +fi ld -v 2>&1 | awk -F\) '{print $1}' | awk \ '/BFD/{print "binutils ",$NF}' +if test 0 -eq $withBusybox ; then fdformat --version | awk -F\- '{print "util-linux ", $NF}' mount --version | awk -F\- '{print "mount ", $NF}' +fi depmod -V 2>&1 | awk 'NR==1 {print "module-init-tools ",$NF}'
@@ -50,21 +65,26 @@ isdnctrl 2>&1 | grep version | awk \ 'NR==1{print "isdn4k-utils ", $NF}' +if test -n "`which ldd`" ; then ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed \ -e 's/\.so$//' | awk -F'[.-]' '{print "Linux C Library " \ $(NF-2)"."$(NF-1)"."$NF}' ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n1 | awk \ 'NR==1{print "Dynamic linker (ldd) ", $NF}' +fi ls -l /usr/lib/lib{g,stdc}++.so 2>/dev/null | awk -F. \ '{print "Linux C++ Library " $4"."$5"."$6}' +if test 0 -eq $withBusybox ; then ps --version 2>&1 | awk 'NR==1{print "Procps ", $NF}' +fi ifconfig --version 2>&1 | grep tools | awk \ 'NR==1{print "Net-tools ", $NF}' +if test 0 -eq $withBusybox ; then # Kbd needs 'loadkeys -h', loadkeys -h 2>&1 | awk \ '(NR==1 && ($3 !~ /option/)) {print "Kbd ", $3}'
@@ -74,6 +94,7 @@ '(NR==1 && ($2 ~ /console-tools/)) {print "Console-tools ", $3}' expr --v 2>&1 | awk 'NR==1{print "Sh-utils ", $NF}' +fi if [ -e /proc/modules ]; then X=`cat /proc/modules | sed -e "s/ .*$//"`
maint/test-xeno-test.rb +301 -0
301 lines not on this page · raw message
Eigenschaftsänderungen: scripts/maint/test-xeno-test.rb
___________________________________________________________________
Name: svn:executable
+ *
xeno-load.in +8 -6
@@ -1,7 +1,9 @@ -#! /bin/bash +#! /bin/sh # Xenomai application loader script. # (Processes the .runinfo files) # June 2004, <[email protected]> +# Adapted to be run also under the BusyBox. If you want to test it under the BusyBox use +# busybox sh xeno-info usage='usage: xeno-load [[dir:]target]' prefix="@prefix@"
@@ -23,7 +25,7 @@ shift fi -if test "x$1" = x--; then +if test -z "$1" || test "x$1" = x--; then target_dir=`pwd` target_name=default else
@@ -80,7 +82,7 @@ eval $user_moddir -if `$sudo $modprobe -nq xeno_nucleus >& /dev/null`; then +if `$sudo $modprobe -nq xeno_nucleus > /dev/null 2>&1`; then target_deps="${target_deps}nucleus+" else target_deps=
@@ -92,8 +94,8 @@ test $verbose = 1 && echo "Running $target_name from $run_info_file" -if test \! "x`type -t sudo`" = x; then - sudo=sudo +if test -n "`which sudo`"; then + sudo=`which sudo` fi if test \! "x$target_mesg" = x; then
@@ -161,7 +163,7 @@ echo "ERROR: cannot load $xeno_moddir/xeno_$mod$modext" break fi - elif `$sudo $modprobe -n xeno_$mod >& /dev/null`; then + elif `$sudo $modprobe -n xeno_$mod > /dev/null 2>&1`; then test $verbose = 1 && echo "+ $modprobe xeno_$mod" $sudo $modprobe xeno_$mod inslist="xeno_$mod $inslist"
xeno-test.in +142 -54
323 lines not on this page · raw message
Philippe Gerum
AppliedQuoted 8 lines · Niklaus Giger
Hi
Here is my patch for improved versions of xeno-info/load/config/test as well as a Ruby test script for the maintainers.
The modified scripts pass the test for most options to xeno-test. The only exception is "-v" for verbose. As I have no clue how/what this option should do I left it as is.
The getopt list lacked the "v" option letter. Fixed, thanks.
Quoted 9 lines
The modifications are:
- busybox supported
- The load jobs (dd) are killed correctly
- two new lines for my buildbot "xeno-test started" and "xeno-test finished"
- the options -m / -L are no more silent, but echo also on the standard out. If the old behaviour is preferred, it would be simple to restore it. But the actual behaviour is easier to debug and fits better into the buildbot logs.
Logs look ok.
Quoted 4 lines
As rc3 is still not out, I do not see any reason not to check in this patch. But I would like to see this happen soon, as I will not be able to fix errors after next Wednesday.
Applied, thanks.
Signature · 1 line
Philippe.