diff options
Diffstat (limited to 'source4/cluster/ctdb/tests/bench.sh')
-rwxr-xr-x | source4/cluster/ctdb/tests/bench.sh | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/source4/cluster/ctdb/tests/bench.sh b/source4/cluster/ctdb/tests/bench.sh index 3d0696f171..48a4277591 100755 --- a/source4/cluster/ctdb/tests/bench.sh +++ b/source4/cluster/ctdb/tests/bench.sh @@ -1,9 +1,24 @@ #!/bin/sh -killall -q ctdb_bench +killall -q ctdb_bench ctdbd -echo "Trying 2 nodes" -$VALGRIND bin/ctdb_bench --nlist tests/nodes.txt --listen 127.0.0.2:9001 $* & -$VALGRIND bin/ctdb_bench --nlist tests/nodes.txt --listen 127.0.0.1:9001 $* -wait +NUMNODES=2 +if [ $# -gt 0 ]; then + NUMNODES=$1 +fi + +rm -f nodes.txt +for i in `seq 1 $NUMNODES`; do + echo 127.0.0.$i >> nodes.txt +done + +tests/start_daemons.sh $NUMNODES nodes.txt || exit 1 +killall -9 ctdb_bench +echo "Trying $NUMNODES nodes" +for i in `seq 1 $NUMNODES`; do + valgrind -q $VALGRIND bin/ctdb_bench --socket sock.$i -n $NUMNODES $* & +done + +wait +bin/ctdb shutdown --socket sock.1 -n all |