5 CTDBD_DIR
=/tmp
/ctdbd-test
6 VALGRIND
="valgrind -q --error-exitcode=111"
8 if [ x
"$1" = x--no-valgrind
]; then
13 if pidof ctdbd
> /dev
/null
; then
14 echo ctdbd already running. Please
kill it.
>&2
23 # Default is to run all tests.
28 # Build ctdb, and build ctdb-test
30 echo Building ctdb-test...
34 mkdir
-p $CTDBD_DIR $CTDBD_DIR/dbs
$CTDBD_DIR/dbs
/persistent
$CTDBD_DIR/dbs
/state
$CTDBD_DIR/event.d
36 if lsmod |
grep -q dummy
; then
39 echo Installing dummy0 network module...
43 echo 10.199.199.1/24 dummy0
> $CTDBD_DIR/addresses
44 cat > $CTDBD_DIR/event.d
/01.print
<<EOF
47 echo "Script invoked with args \$@" >> $CTDBD_DIR/eventscripts.log
49 chmod a
+x
$CTDBD_DIR/event.d
/01.print
51 echo Running ctdbd with logging to
$CTDBD_DIR/log...
52 ..
/..
/bin
/ctdbd
--logfile=$CTDBD_DIR/log
--public-addresses=$CTDBD_DIR/addresses
--dbdir=$CTDBD_DIR/dbs
--reclock=$CTDBD_DIR/reclock
--dbdir-persistent=$CTDBD_DIR/dbs
/persistent
--dbdir-state=$CTDBD_DIR/dbs
/state
--event-script-dir=$CTDBD_DIR/event.d
56 echo Waiting
for ctdbd to be happy...
59 ..
/..
/bin
/ctdb status
> $CTDBD_DIR/status
60 if ! grep -q UNHEALTHY
$CTDBD_DIR/status
; then
66 echo ctdbd failed to start
: >&2
67 tail -n 20 $CTDBD_DIR/log
>&2
73 echo -n Running
$test...
74 if $VALGRIND .
/ctdb-test
--quiet $test > $CTDBD_DIR/test-out
2>&1; then
78 cat $CTDBD_DIR/test-out