runcampaign.sh uses start-clients.sh instead of duplicating code

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1852 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
hsc
2012-10-26 17:31:35 +00:00
parent 3353bad6c6
commit 720a59cfde

View File

@ -7,16 +7,6 @@
# - (possibly overridden) env variables from fail-env.sh # - (possibly overridden) env variables from fail-env.sh
# #
set -e
# determine absolute path of this script
SCRIPTDIR=$(readlink -f $(dirname $0))
# env variable defaults
source $SCRIPTDIR/fail-env.sh
CMD="killall -q client.sh || true; cd $FAIL_EXPERIMENT_TARGETDIR; ./multiple-clients.sh"
CONNECTION_ATTEMPTS=2
SSH="ssh -o BatchMode=yes -o ConnectTimeout=60 -o ConnectionAttempts=$CONNECTION_ATTEMPTS"
# runcampaign.sh <campaignserver-binary> # runcampaign.sh <campaignserver-binary>
if [ ! -x "$1" ]; then echo "usage: $0 <campaignserver-binary>" >&2; exit 1; fi if [ ! -x "$1" ]; then echo "usage: $0 <campaignserver-binary>" >&2; exit 1; fi
CAMPAIGNSERVER_BINARY=$1 CAMPAIGNSERVER_BINARY=$1
@ -25,20 +15,7 @@ date
/usr/bin/time -po .time "$CAMPAIGNSERVER_BINARY" > $(basename "$CAMPAIGNSERVER_BINARY")_progress.txt 2>&1 & /usr/bin/time -po .time "$CAMPAIGNSERVER_BINARY" > $(basename "$CAMPAIGNSERVER_BINARY")_progress.txt 2>&1 &
sleep .1 # wait until server is likely to have a listening socket opened sleep .1 # wait until server is likely to have a listening socket opened
for h in $FAIL_EXPERIMENT_HOSTS $(dirname $0)/start-clients.sh
do
if [[ $h == *:* ]]
then
# split in host:nclients
NCLIENTS=${h#*:}
h=${h%:*}
else
NCLIENTS=
fi
$SSH $h "$CMD $NCLIENTS" &
disown
done
wait wait
echo "duration:" echo "duration:"