ia64/xen-unstable

view tools/xenstore/testsuite/test.sh @ 6946:e703abaf6e3d

Add behaviour to the remove methods to remove the transaction's path itself. This allows us to write Remove(path) to remove the specified path rather than having to slice the path ourselves.
author emellor@ewan
date Sun Sep 18 14:42:13 2005 +0100 (2005-09-18)
parents 3233e7ecfa9f
children 06d84bf87159
line source
1 #! /bin/sh
3 set -e
4 set -m
6 run_test()
7 {
8 rm -rf $XENSTORED_ROOTDIR
9 mkdir $XENSTORED_ROOTDIR
10 if [ $VALGRIND -eq 1 ]; then
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 &
12 while [ ! -s /tmp/pid ]; do sleep 0; done
13 PID=`cat /tmp/pid`
14 rm /tmp/pid
15 else
16 # We don't get error messages from this, though.
17 PID=`./xenstored_test --output-pid --trace-file=testsuite/tmp/trace`
18 fi
19 if ./xs_test $2 $1; then
20 if [ -s testsuite/tmp/xenstored_errors ]; then
21 kill $PID
22 echo Errors:
23 cat testsuite/tmp/xenstored_errors
24 return 1
25 fi
26 echo shutdown | ./xs_test
27 return 0
28 else
29 # In case daemon is wedged.
30 kill $PID
31 sleep 1
32 return 1
33 fi
34 }
36 if [ x$1 = x--fast ]; then
37 VALGRIND=0
38 SLOWTESTS=""
39 shift
40 else
41 if type valgrind >/dev/null 2>&1; then
42 VALGRIND=1
43 else
44 echo "WARNING: valgrind not available" >&2
45 VALGRIND=0
46 fi
47 SLOWTESTS=testsuite/[0-9]*.slowtest
48 fi
50 MATCH=${1:-"*"}
51 for f in testsuite/[0-9]*.test $SLOWTESTS; do
52 case `basename $f` in $MATCH) RUN=1;; esac
53 [ -n "$RUN" ] || continue
55 if run_test $f -x >/tmp/out; then
56 echo -n .
57 else
58 cat /tmp/out
59 # That will have filled the screen, repeat message.
60 echo Test $f failed
61 exit 1
62 fi
63 done