Skip to content
Snippets Groups Projects
Commit 48bebb0a authored by Bernardo Cardoso's avatar Bernardo Cardoso
Browse files

Merge branch 'rekey' into 'master'

Test E2E rekey between 2 users

See merge request !28
parents dd6dbcb5 1b0904d4
No related branches found
No related tags found
No related merge requests found
= Basic End-to-End Integration Test (basice2e)
This test runs several servers and clients as a smoke test against the
system. We runs a multi node, multi message, multi user test of the
system. We run a multi node, multi message, multi user test of the
system over multiple rounds all over network traffic. The basic
structure is as follows:
* 5 Nodes, BatchSize of 12
* 3 Clients, each send 4 messages over several rounds:
** 2 messages to itself
** 1 message to each of the other nodes
* Each client asserts they receive their predefined messages
* 5 Nodes, BatchSize of 4
* 5 Gateways, each connected to its own node
* User Discovery Bot
* Channel Bot
* Client sending 2 dummy messages per second, in order to fill batches
Then, the following tests are performed:
* 2 Clients (9 and 18) register with the system and UDB by Email
* These users look each other up on UDB
* Test is successful if the first line of gold output file matches
* The same 2 clients exchange E2E encrypted messages for 65s at a rate of 0.1msg/s
* This will result in clients sending 6 messages to each other
* It will also test that 2 rekeys on each side happen properly
* Test is successful if all the aforementioned messages are accounted for.
This is done by grep'ing the logs for sent messages, received messages, sent rekeys
and received rekeys, and comparing to gold output of 6, 6, 2, 2
* 4 Clients are started at two separate times and send messages to channel and to each other
* 2 messages to itself
* 1 message to each of the other clients
* Test is successful if all gold output files match for client conversations:
4-5, 5-6, 6-7, 7-4
For now, we do nothing on assertion of crypto, we just assume
api-level compliance with sending and receiving messages.
......
UDB search successful. Returned user [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9]
Sending Message to 9, Spencer: Hello, 9, with E2E Encryption
6
6
2
2
UDB search successful. Returned user [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 18]
Message from 18, Bernardo Received: Hello, 9, with E2E Encryption
6
6
2
2
......@@ -119,36 +119,36 @@ do
done
# Register two users and then do UDB search on each other
CLIENTCMD="timeout 90s ../bin/client -f blob9 -g $GATEWAY -E "spencer@elixxir.io" -i 9 -d 3 -c ../keys/gateway.cmix.rip.crt"
CLIENTCMD="timeout 90s ../bin/client -f blob9 -g $GATEWAY -E spencer@elixxir.io -i 9 -c ../keys/gateway.cmix.rip.crt"
eval $CLIENTCMD >> $CLIENTOUT/client9.out 2>&1 &
PIDVAL=$!
echo "$CLIENTCMD -- $PIDVAL"
wait $PIDVAL
CLIENTCMD="timeout 90s ../bin/client -f blob18 -g $GATEWAY -E "bernardo@elixxir.io" -i 18 -d 3 -c ../keys/gateway.cmix.rip.crt -m \"SEARCH EMAIL spencer@elixxir.io\""
CLIENTCMD="timeout 90s ../bin/client -f blob18 -g $GATEWAY -E bernardo@elixxir.io -i 18 -d 3 -c ../keys/gateway.cmix.rip.crt -m \"SEARCH EMAIL spencer@elixxir.io\" --keyParams 3,4,2,1.0,2"
eval $CLIENTCMD >> $CLIENTOUT/client18.out 2>&1 &
PIDVAL=$!
echo "$CLIENTCMD -- $PIDVAL"
wait $PIDVAL
CLIENTCMD="timeout 90s ../bin/client -f blob9 -g $GATEWAY -i 9 -d 3 -c ../keys/gateway.cmix.rip.crt -m \"SEARCH EMAIL bernardo@elixxir.io\""
CLIENTCMD="timeout 90s ../bin/client -f blob9 -g $GATEWAY -i 9 -d 3 -c ../keys/gateway.cmix.rip.crt -m \"SEARCH EMAIL bernardo@elixxir.io\" --keyParams 3,4,2,1.0,2"
eval $CLIENTCMD >> $CLIENTOUT/client9.out 2>&1 &
PIDVAL=$!
echo "$CLIENTCMD -- $PIDVAL"
wait $PIDVAL
# Send E2E encrypted message between users that discovered each other
CLIENTCMD="timeout 60s ../bin/client -f blob18 -g $GATEWAY -i 18 -d 9 -c ../keys/gateway.cmix.rip.crt -m \"Hello, 9, with E2E Encryption\" --end2end"
eval $CLIENTCMD >> $CLIENTOUT/client18.out 2>&1 &
# Send multiple E2E encrypted messages between users that discovered each other
CLIENTCMD="timeout 65s ../bin/client -v -i 18 -d 9 -f blob18 -g $GATEWAY -c ../keys/gateway.cmix.rip.crt -m \"Hello, 9, with E2E Encryption\" --end2end --dummyfrequency 0.1"
eval $CLIENTCMD >> $CLIENTOUT/client18_rekey.out 2>&1 &
PIDVAL=$!
echo "$CLIENTCMD -- $PIDVAL"
wait $PIDVAL
CLIENTCMD="timeout 60s ../bin/client -f blob9 -g $GATEWAY -i 9 -c ../keys/gateway.cmix.rip.crt"
eval $CLIENTCMD >> $CLIENTOUT/client9.out 2>&1 &
sleep 2
CLIENTCMD="timeout 63s ../bin/client -v -i 9 -d 18 -f blob9 -g $GATEWAY -c ../keys/gateway.cmix.rip.crt -m \"Hello, 18, with E2E Encryption\" --end2end --dummyfrequency 0.1"
eval $CLIENTCMD >> $CLIENTOUT/client9_rekey.out 2>&1 &
PIDVAL=$!
echo "$CLIENTCMD -- $PIDVAL"
wait $PIDVAL
# Send a channel message that all clients will receive
CLIENTCMD="timeout 60s ../bin/client -f blob8 -c ../keys/gateway.cmix.rip.crt -g $GATEWAY -i 8 -d 31 -m \"Channel, Hello\""
......@@ -164,6 +164,18 @@ runclients
echo "RUNNING CLIENTS (2nd time)..."
runclients
# Confirm all messages and rekeys by counting with grep
grep -ac "Sending Message to 9, Spencer" $CLIENTOUT/client18_rekey.out >> $CLIENTOUT/client18.out
grep -ac "Message from 9, Spencer Received" $CLIENTOUT/client18_rekey.out >> $CLIENTOUT/client18.out
grep -ac "Generated new send keys" $CLIENTOUT/client18_rekey.out >> $CLIENTOUT/client18.out
grep -ac "Generated new receiving keys" $CLIENTOUT/client18_rekey.out >> $CLIENTOUT/client18.out
grep -ac "Sending Message to 18, Bernardo" $CLIENTOUT/client9_rekey.out >> $CLIENTOUT/client9.out
grep -ac "Message from 18, Bernardo Received" $CLIENTOUT/client9_rekey.out >> $CLIENTOUT/client9.out
grep -ac "Generated new send keys" $CLIENTOUT/client9_rekey.out >> $CLIENTOUT/client9.out
grep -ac "Generated new receiving keys" $CLIENTOUT/client9_rekey.out >> $CLIENTOUT/client9.out
rm $CLIENTOUT/client18_rekey.out $CLIENTOUT/client9_rekey.out
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment