ia64/xen-unstable

annotate tools/xenstore/testsuite/test.sh @ 6384:c51562192ef6

Fix xenstore testsuite for valgrind 3.0 and latest Debian glibc.
Debian upgrade revealed two problems: glibc spits out a warning on every
binary, and valgrind 3.0 gratuitously changed --logfile-fd to --log-fd,
so don't use it.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Tue Aug 23 19:57:32 2005 +0000 (2005-08-23)
parents 9faafa21bf98
children f34e732ed4bf
rev   line source
cl349@5357 1 #! /bin/sh
cl349@5357 2
cl349@5357 3 set -e
cl349@5357 4 set -m
cl349@5357 5
cl349@5357 6 run_test()
cl349@5357 7 {
cl349@5357 8 rm -rf $XENSTORED_ROOTDIR
cl349@5357 9 mkdir $XENSTORED_ROOTDIR
kaf24@6039 10 if [ $VALGRIND -eq 1 ]; then
cl349@6384 11 valgrind --suppressions=testsuite/vg-suppressions -q ./xenstored_test --output-pid --trace-file=testsuite/tmp/trace --no-fork > /tmp/pid 2> testsuite/tmp/xenstored_errors &
cl349@5357 12 while [ ! -s /tmp/pid ]; do sleep 0; done
cl349@5357 13 PID=`cat /tmp/pid`
cl349@5357 14 rm /tmp/pid
cl349@5357 15 else
kaf24@6039 16 # We don't get error messages from this, though.
kaf24@6039 17 PID=`./xenstored_test --output-pid --trace-file=testsuite/tmp/trace`
cl349@5357 18 fi
kaf24@6039 19 if ./xs_test $2 $1; then
cl349@6384 20 if [ -s testsuite/tmp/xenstored_errors ]; then
cl349@5357 21 kill $PID
cl349@6384 22 echo Errors:
cl349@6384 23 cat testsuite/tmp/xenstored_errors
cl349@5357 24 return 1
cl349@5357 25 fi
cl349@5357 26 echo shutdown | ./xs_test
cl349@5357 27 return 0
cl349@5357 28 else
cl349@5357 29 # In case daemon is wedged.
cl349@5357 30 kill $PID
cl349@5357 31 sleep 1
cl349@5357 32 return 1
cl349@5357 33 fi
cl349@5357 34 }
cl349@5357 35
kaf24@6039 36 if [ x$1 = x--fast ]; then
kaf24@6039 37 VALGRIND=0
kaf24@6039 38 SLOWTESTS=""
kaf24@6039 39 shift
kaf24@6039 40 else
kaf24@6039 41 if type valgrind >/dev/null 2>&1; then
kaf24@6039 42 VALGRIND=1
kaf24@6039 43 else
kaf24@6039 44 echo "WARNING: valgrind not available" >&2
kaf24@6039 45 VALGRIND=0
kaf24@6039 46 fi
kaf24@6039 47 SLOWTESTS=testsuite/[0-9]*.slowtest
kaf24@6039 48 fi
kaf24@6039 49
cl349@5874 50 MATCH=${1:-"*"}
kaf24@6039 51 for f in testsuite/[0-9]*.test $SLOWTESTS; do
cl349@5874 52 case `basename $f` in $MATCH) RUN=1;; esac
cl349@5874 53 [ -n "$RUN" ] || continue
kaf24@6039 54
kaf24@6039 55 if run_test $f > /dev/null; then
kaf24@6039 56 echo -n .
cl349@5357 57 else
cl349@5357 58 echo Test $f failed, running verbosely...
cl349@5872 59 run_test $f -x || true
cl349@5872 60 # That will have filled the screen, repeat message.
cl349@5872 61 echo Test $f failed
cl349@5357 62 exit 1
cl349@5357 63 fi
cl349@5357 64 done