1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
samba-mirror/ctdb/tests/persistent.sh
Andrew Tridgell b7e9d0dccf - cleanup persistent db at start
- catch SIGINT and kill daemons

(This used to be ctdb commit d3f5d75665a78ae0081fda57e58384b27a6ae396)
2008-07-30 13:20:47 +10:00

48 lines
1017 B
Bash
Executable File

#!/bin/sh
NUMNODES=4
if [ $# -gt 0 ]; then
NUMNODES=$1
fi
killall -9 -q ctdb_persistent ctdbd
rm -rf test.db/persistent
echo "Starting $NUMNODES daemons for SAFE persistent writes"
tests/start_daemons.sh $NUMNODES || exit 1
trap 'echo "Killing test"; killall -9 -q ctdbd ctdb_persistent; exit 1' INT TERM
for i in `seq 1 $NUMNODES`; do
$VALGRIND bin/ctdb_persistent --timelimit 30 --socket sock.$i $* &
$VALGRIND bin/ctdb_persistent --timelimit 30 --socket sock.$i $* &
done
wait
echo "Shutting down"
bin/ctdb shutdown -n all --socket=sock.1
killall -9 ctdbd
echo "Starting $NUMNODES daemons for UNSAFE persistent writes"
tests/start_daemons.sh $NUMNODES || exit 1
killall -9 -q ctdb_persistent
for i in `seq 1 $NUMNODES`; do
$VALGRIND bin/ctdb_persistent --unsafe-writes --timelimit 30 --socket sock.$i $* &
$VALGRIND bin/ctdb_persistent --unsafe-writes --timelimit 30 --socket sock.$i $* &
done
wait
echo "Shutting down"
bin/ctdb shutdown -n all --socket=sock.1
killall -9 ctdbd
exit 0