diff options
author | Andrew Tridgell <tridge@samba.org> | 2007-04-16 00:18:54 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:50:40 -0500 |
commit | c9f04d8648cfdd573d45d47467bc964ef01f754d (patch) | |
tree | 115acf98b7b136f07dd8b16bbd50c9f7cbcdd3bb /source4/cluster/ctdb/tests/bench-ssh.sh | |
parent | bb36705c8d360a2ba865a3d8118c52afa1e46f4e (diff) | |
download | samba-c9f04d8648cfdd573d45d47467bc964ef01f754d.tar.gz samba-c9f04d8648cfdd573d45d47467bc964ef01f754d.tar.bz2 samba-c9f04d8648cfdd573d45d47467bc964ef01f754d.zip |
r22231: merge from bzr ctdb tree
(This used to be commit 807b959082d3b9a929c9f6597714e636638a940e)
Diffstat (limited to 'source4/cluster/ctdb/tests/bench-ssh.sh')
-rwxr-xr-x | source4/cluster/ctdb/tests/bench-ssh.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/source4/cluster/ctdb/tests/bench-ssh.sh b/source4/cluster/ctdb/tests/bench-ssh.sh new file mode 100755 index 0000000000..0d11ee9cdd --- /dev/null +++ b/source4/cluster/ctdb/tests/bench-ssh.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +if [ $# -lt 1 ]; then + echo "Usage: bench-ssh.sh <NODES> <OPTIONS>" + exit 1 +fi + +while :; do + if [ "`echo $1 | cut -c1`" = "-" -o $# -eq 0 ]; then break; fi + nodes="$nodes $1"; + shift; +done + +options=$* +dir=`pwd` + +echo "Creating nodes-ssh.txt" +rm -f nodes-ssh.txt +count=0 +for h in $nodes; do + echo "$h:9001" >> nodes-ssh.txt + count=`expr $count + 1` +done + + +echo "Killing old processes" +for h in $nodes; do + scp -q nodes-ssh.txt $h:$dir + ssh $h killall -q ctdb_bench +done + +echo "Starting nodes" +i=0 +for h in $nodes; do + if [ $i -eq `expr $count - 1` ]; then + ssh $h $dir/bin/ctdb_bench --nlist $dir/nodes-ssh.txt --listen $h:9001 $options + else + ssh -f $h $dir/bin/ctdb_bench --nlist $dir/nodes-ssh.txt --listen $h:9001 $options + fi + i=`expr $i + 1` +done + +wait |