ia64/xen-unstable

annotate tools/xenstore/testsuite/test.sh @ 6552:a9873d384da4

Merge.
author adsharma@los-vmm.sc.intel.com
date Thu Aug 25 12:24:48 2005 -0700 (2005-08-25)
parents 112d44270733 fa0754a9f64f
children dfaf788ab18c
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
cl349@6385 55 if run_test $f -x >/tmp/out; then
kaf24@6039 56 echo -n .
cl349@5357 57 else
cl349@6385 58 cat /tmp/out
cl349@5872 59 # That will have filled the screen, repeat message.
cl349@5872 60 echo Test $f failed
cl349@5357 61 exit 1
cl349@5357 62 fi
cl349@5357 63 done