Skip to content
Snippets Groups Projects
Commit 88f2a786 authored by Rick Carback's avatar Rick Carback
Browse files

Convert the runclients into a function that is called twice

parent f1fd5ba7
Branches
Tags
No related merge requests found
...@@ -45,15 +45,15 @@ trap finish INT ...@@ -45,15 +45,15 @@ trap finish INT
sleep 20 # FIXME: We should not need this, but the servers don't respond quickly sleep 20 # FIXME: We should not need this, but the servers don't respond quickly
# enough on boot right now. # enough on boot right now.
LASTNODE="localhost:50004" export LASTNODE="localhost:50004"
NICK1="David" export NICK1="David"
NICK2="Jim" export NICK2="Jim"
NICK3="Ben" export NICK3="Ben"
NICK4="Rick" export NICK4="Rick"
echo "STARTING CLIENTS..." runclients() {
echo "Starting clients..."
CTR=0 CTR=0
for cid in $(seq 1 4) for cid in $(seq 1 4)
do do
# TODO: Change the recipients to send multiple messages. We can't # TODO: Change the recipients to send multiple messages. We can't
...@@ -79,33 +79,12 @@ do ...@@ -79,33 +79,12 @@ do
eval echo "Waiting on \${CLIENTS${i}} ..." eval echo "Waiting on \${CLIENTS${i}} ..."
eval wait \${CLIENTS${i}} eval wait \${CLIENTS${i}}
done done
}
CTR=0 echo "RUNNING CLIENTS..."
for cid in $(seq 1 4) runclients
do echo "RUNNING CLIENTS (2nd time)..."
# TODO: Change the recipients to send multiple messages. We can't runclients
# run multiple clients with the same user id so we need
# updates to make that work.
# for nid in 1 2 3 4; do
for nid in 1
do
nid=$((($cid % 4) + 1))
eval NICK=\${NICK${cid}}
CLIENTCMD="../bin/client -f blob$cid$nid --numnodes 5 -s $LASTNODE -i $cid -d $nid -m \"Hello, $nid\" --nick $NICK"
eval $CLIENTCMD >> $CLIENTOUT/client$cid$nid.out 2>&1 &
RETVAL=$!
eval CLIENTS${CTR}=$RETVAL
echo "$CLIENTCMD -- $RETVAL"
CTR=$(($CTR + 1))
done
done
echo "WAITING FOR $CTR CLIENTS (2nd msg set) TO EXIT..."
for i in $(seq 0 $(($CTR - 1)))
do
eval echo "Waiting on \${CLIENTS${i}} ..."
eval wait \${CLIENTS${i}}
done
diff -ruN clients.goldoutput $CLIENTOUT diff -ruN clients.goldoutput $CLIENTOUT
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment