Skip to content
Snippets Groups Projects
Commit cc7343c1 authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Merge branch 'feature/dummy_and_channel' into 'master'

Feature: dummy and channel

See merge request privategrity/integration!9
parents d211095b 30a10f0c
Branches
Tags
No related merge requests found
......@@ -80,3 +80,5 @@ benchmark:
when: always
paths:
- bin/
only:
- benchmark
Sending Message to 2, Jim: Hello, 2
Message from 4, Rick Received: Hello, 1
Message from 31, #General Received: Channel, Hello
Sending Message to 2, Jim: Hello, 2
Message from 4, Rick Received: Hello, 1
Sending Message to 3, Ben: Hello, 3
Message from 1, David Received: Hello, 2
Message from 31, #General Received: Channel, Hello
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 31, #General Received: Channel, Hello
Sending Message to 4, Rick: Hello, 4
Message from 2, Jim Received: Hello, 3
Sending Message to 1, David: Hello, 1
Message from 3, Ben Received: Hello, 4
Message from 31, #General Received: Channel, Hello
Sending Message to 1, David: Hello, 1
Message from 3, Ben Received: Hello, 4
Sending Message to 31, #General: Channel, Hello
Message from 31, #General Received: Channel, Hello
......@@ -9,22 +9,24 @@ rm blob* || true
SERVERLOGS=results/servers
CLIENTOUT=results/clients
CHANNELOUT=results/channelbot.console
DUMMYOUT=results/dummy.console
mkdir -p $SERVERLOGS
mkdir -p $CLIENTOUT
echo "STARTING SERVERS..."
for SERVERID in $(seq 1 5)
for SERVERID in $(seq 5 -1 1)
do
IDX=$(($SERVERID - 1))
SERVERCMD="../bin/server -v -i $IDX --config server-$SERVERID.yaml"
SERVERCMD="../bin/server -v -i $IDX --config server-$SERVERID.yaml --noratchet"
if [ $SERVERID -eq 4 ]; then
sleep 15 # This will force a CDE timeout
fi
$SERVERCMD > $SERVERLOGS/server-$SERVERID.console 2>&1 &
RETVAL=$!
echo "$SERVERCMD -- $RETVAL"
PIDVAL=$!
echo "$SERVERCMD -- $PIDVAL"
done
jobs -p > results/serverpids
......@@ -45,7 +47,7 @@ finish() {
trap finish EXIT
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.
export LASTNODE="localhost:50004"
......@@ -57,21 +59,24 @@ export NICK4="Rick"
runclients() {
echo "Starting clients..."
CTR=0
for cid in $(seq 1 4)
do
# TODO: Change the recipients to send multiple messages. We can't
# 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="timeout 10s ../bin/client -f blob$cid$nid --numnodes 5 -s $LASTNODE -i $cid -d $nid -m \"Hello, $nid\" --nick $NICK"
# Send a regular message
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 &
RETVAL=$!
eval CLIENTS${CTR}=$RETVAL
echo "$CLIENTCMD -- $RETVAL"
PIDVAL=$!
eval CLIENTS${CTR}=$PIDVAL
echo "$CLIENTCMD -- $PIDVAL"
CTR=$(($CTR + 1))
done
done
......@@ -84,15 +89,52 @@ runclients() {
done
}
# Start a channelbot server
CHANNELCMD="../bin/client channelbot -v -i 31 --nick \"#General\" --numnodes 5 -s $LASTNODE -f blobchannel --noratchet"
eval $CHANNELCMD >> $CHANNELOUT 2>&1 &
PIDVAL=$!
echo $PIDVAL >> results/serverpids
echo "$CHANNELCMD -- $PIDVAL"
# Start a dummy client
DUMMYCMD="../bin/client -i 35 -d 35 -s $LASTNODE --numnodes 5 -m \"dummy\" --nick \"dummy\" --dummyfrequency 0.5 --noratchet -f blobdummy"
eval $DUMMYCMD >> $DUMMYOUT 2>&1 &
PIDVAL=$!
echo $PIDVAL >> results/serverpids
echo "$DUMMYCMD -- $PIDVAL"
# 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
sleep 10 # Spend some time waiting for the channel bot to send messages
echo "RUNNING CLIENTS..."
runclients
echo "RUNNING CLIENTS (2nd time)..."
runclients
# HACK HACK HACK: Remove the ratchet warning from client output
for F in $(find results/clients -type f)
do
cat $F | grep -v "[Rr]atcheting" > $F.tmp
mv $F.tmp $F
done
diff -ruN clients.goldoutput $CLIENTOUT
cat $SERVERLOGS/*.log | grep "ERROR" > results/server-errors.txt || true
cat $SERVERLOGS/*.log | grep "FATAL" >> results/server-errors.txt || true
diff -ruN results/server-errors.txt noerrors.txt
cat $CHANNELOUT | grep "ERROR" > results/channel-errors.txt || true
cat $CHANNELOUT | grep "FATAL" >> results/channel-errors.txt || true
diff -ruN results/channel-errors.txt noerrors.txt
cat $DUMMYOUT | grep "ERROR" > results/dummy-errors.txt || true
cat $DUMMYOUT | grep "FATAL" >> results/dummy-errors.txt || true
diff -ruN results/dummy-errors.txt noerrors.txt
echo "SUCCESS!"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment