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

Add channel messages to client gold output and enable a message sent from a...

Add channel messages to client gold output and enable a message sent from a channel to all of the clients
parent 6286a96d
No related branches found
No related tags found
No related merge requests found
Sending Message to 2, Jim: Hello, 2 Message from 31, #general Received: Channel, Hello
Message from 4, Rick Received: Hello, 1 Message from 4, Rick Received: Hello, 1
Sending Message to 2, Jim: Hello, 2 Sending Message to 2, Jim: Hello, 2
Message from 4, Rick Received: Hello, 1 Sending Message to 2, Jim: Hello, 2
Sending Message to 3, Ben: Hello, 3
Message from 1, David Received: Hello, 2 Message from 1, David Received: Hello, 2
Message from 31, #general Received: Channel, Hello
Sending Message to 3, Ben: Hello, 3
Sending Message to 3, Ben: Hello, 3 Sending Message to 3, Ben: Hello, 3
Message from 1, David Received: Hello, 2
Sending Message to 4, Rick: Hello, 4
Message from 2, Jim Received: Hello, 3 Message from 2, Jim Received: Hello, 3
Message from 31, #general Received: Channel, Hello
Sending Message to 4, Rick: Hello, 4
Sending Message to 4, Rick: Hello, 4 Sending Message to 4, Rick: Hello, 4
Message from 2, Jim Received: Hello, 3
Sending Message to 1, David: Hello, 1 Message from 31, #general Received: Channel, Hello
Message from 3, Ben Received: Hello, 4 Message from 3, Ben Received: Hello, 4
Sending Message to 1, David: Hello, 1 Sending Message to 1, David: Hello, 1
Message from 3, Ben Received: Hello, 4 Sending Message to 1, David: Hello, 1
Message from 31, #general Received: Channel, Hello
Sending Message to 31, #general: Channel, Hello
...@@ -25,8 +25,8 @@ do ...@@ -25,8 +25,8 @@ do
sleep 15 # This will force a CDE timeout sleep 15 # This will force a CDE timeout
fi fi
$SERVERCMD > $SERVERLOGS/server-$SERVERID.console 2>&1 & $SERVERCMD > $SERVERLOGS/server-$SERVERID.console 2>&1 &
RETVAL=$! PIDVAL=$!
echo "$SERVERCMD -- $RETVAL" echo "$SERVERCMD -- $PIDVAL"
done done
jobs -p > results/serverpids jobs -p > results/serverpids
...@@ -47,7 +47,7 @@ finish() { ...@@ -47,7 +47,7 @@ finish() {
trap finish EXIT trap finish EXIT
trap finish INT trap finish INT
sleep 20 # FIXME: We should not need this, but the servers don't respond quickly sleep 45 # FIXME: We should not need this, but the servers don't respond quickly
# enough on boot right now. # enough on boot right now.
export LASTNODE="localhost:50004" export LASTNODE="localhost:50004"
...@@ -59,29 +59,24 @@ export NICK4="Rick" ...@@ -59,29 +59,24 @@ export NICK4="Rick"
runclients() { runclients() {
echo "Starting clients..." 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
# run multiple clients with the same user id so we need # run multiple clients with the same user id so we need
# updates to make that work. # updates to make that work.
# for nid in 1 2 3 4; do # for nid in 1 2 3 4; do
for nid in 1 for nid in 1
do do
nid=$((($cid % 4) + 1)) nid=$((($cid % 4) + 1))
eval NICK=\${NICK${cid}} eval NICK=\${NICK${cid}}
# Send a channel message
# CLIENTCMD="timeout 10s ../bin/client -f blob$cid$nid --numnodes 5 -s $LASTNODE -i $cid -d 35 -m \"Channel, $nid\" --nick $NICK"
# eval $CLIENTCMD >> $CLIENTOUT/client$cid$nid.out 2>&1 &
# RETVAL=$!
# eval CLIENTSCH${CTR}=$RETVAL
# echo "$CLIENTCMD -- $RETVAL"
# Send a regular message # Send a regular message
CLIENTCMD="timeout 60s ../bin/client -f blob$cid$nid --numnodes 5 -s $LASTNODE -i $cid -d $nid -m \"Hello, $nid\" --nick $NICK --noratchet" CLIENTCMD="timeout 60s ../bin/client -f blob$cid --numnodes 5 -s $LASTNODE -i $cid -d $nid -m \"Hello, $nid\" --nick $NICK --noratchet"
eval $CLIENTCMD >> $CLIENTOUT/client$cid$nid.out 2>&1 & eval $CLIENTCMD >> $CLIENTOUT/client$cid$nid.out 2>&1 &
RETVAL=$! PIDVAL=$!
eval CLIENTS${CTR}=$RETVAL eval CLIENTS${CTR}=$PIDVAL
echo "$CLIENTCMD -- $RETVAL" echo "$CLIENTCMD -- $PIDVAL"
CTR=$(($CTR + 1)) CTR=$(($CTR + 1))
done done
done done
...@@ -95,16 +90,25 @@ runclients() { ...@@ -95,16 +90,25 @@ runclients() {
} }
# Start a channelbot server # Start a channelbot server
../bin/client channelbot -v -i 31 --nick "#general" --numnodes 5 -s $LASTNODE \ CHANNELCMD="../bin/client channelbot -v -i 31 --nick \"#general\" --numnodes 5 -s $LASTNODE -f blobchannel --noratchet"
-f blobchannel --noratchet \ eval $CHANNELCMD >> $CHANNELOUT 2>&1 &
2>&1 > $CHANNELOUT & PIDVAL=$!
echo $! >> results/serverpids echo "$CHANNELCMD -- $PIDVAL"
echo $PIDVAL >> results/serverpids
# Start a dummy client # Start a dummy client
../bin/client -i 35 -d 35 -s $LASTNODE --numnodes 5 -m "dummy" --nick "dummy" \ DUMMYCMD="../bin/client -i 35 -d 35 -s $LASTNODE --numnodes 5 -m \"dummy\" --nick \"dummy\" --dummyfrequency 0.5 --noratchet -f blobdummy"
--dummyfrequency 0.5 --noratchet \ eval $DUMMYCMD >> $DUMMYOUT 2>&1 &
-f blobdummy 2>&1 > $DUMMYOUT & PIDVAL=$!
echo $! >> results/serverpids echo "$DUMMYCMD -- $PIDVAL"
echo $PIDVAL >> results/serverpids
# Send a channel message that all clients will receive
CLIENTCMD="timeout 60s ../bin/client -f blob5 --numnodes 5 -s $LASTNODE -i 5 -d 31 -m \"Channel, Hello\" --nick Spencer --noratchet"
eval $CLIENTCMD >> $CLIENTOUT/client5.out 2>&1 &
PIDVAL=$!
echo "$CLIENTCMD -- $PIDVAL"
wait $PIDVAL
echo "RUNNING CLIENTS..." echo "RUNNING CLIENTS..."
runclients runclients
...@@ -115,7 +119,9 @@ runclients ...@@ -115,7 +119,9 @@ runclients
for F in $(find results/clients -type f) for F in $(find results/clients -type f)
do do
cat $F | grep -v "[Rr]atcheting" > $F.tmp cat $F | grep -v "[Rr]atcheting" > $F.tmp
mv $F.tmp $F # Sort the messages, as we don't care if they arrive out of order
sort $F.tmp > $F
rm $F.tmp
done done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment