From 0ae2becdb965d3ba10c4a44efb3f3ca97fdf3c60 Mon Sep 17 00:00:00 2001 From: Bernardo Cardoso <bernardo@elixxir.io> Date: Mon, 15 Apr 2019 16:07:35 -0600 Subject: [PATCH] Update integration for registration --- basice2e/clients.goldoutput/client18.out | 1 + basice2e/clients.goldoutput/client9.out | 3 +- basice2e/gateway-1.yaml | 38 ++++++++++++++++ basice2e/gateway-2.yaml | 38 ++++++++++++++++ basice2e/gateway-3.yaml | 38 ++++++++++++++++ basice2e/{gateway.yaml => gateway-4.yaml} | 4 +- basice2e/gateway-5.yaml | 38 ++++++++++++++++ basice2e/run.sh | 55 ++++++++++++++--------- basice2e/server-1.yaml | 7 +-- basice2e/server-2.yaml | 7 +-- basice2e/server-3.yaml | 7 +-- basice2e/server-4.yaml | 5 ++- basice2e/server-5.yaml | 7 +-- basice2e/udb.yaml | 5 ++- update.sh | 8 ++++ 15 files changed, 221 insertions(+), 40 deletions(-) create mode 100644 basice2e/clients.goldoutput/client18.out create mode 100644 basice2e/gateway-1.yaml create mode 100644 basice2e/gateway-2.yaml create mode 100644 basice2e/gateway-3.yaml rename basice2e/{gateway.yaml => gateway-4.yaml} (95%) create mode 100644 basice2e/gateway-5.yaml diff --git a/basice2e/clients.goldoutput/client18.out b/basice2e/clients.goldoutput/client18.out new file mode 100644 index 0000000..0264639 --- /dev/null +++ b/basice2e/clients.goldoutput/client18.out @@ -0,0 +1 @@ +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] diff --git a/basice2e/clients.goldoutput/client9.out b/basice2e/clients.goldoutput/client9.out index 63dab81..ce992b4 100644 --- a/basice2e/clients.goldoutput/client9.out +++ b/basice2e/clients.goldoutput/client9.out @@ -1,2 +1 @@ -UDB registration successful. -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], public key "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00this is not a real public key" +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] diff --git a/basice2e/gateway-1.yaml b/basice2e/gateway-1.yaml new file mode 100644 index 0000000..f11f062 --- /dev/null +++ b/basice2e/gateway-1.yaml @@ -0,0 +1,38 @@ +################################################################################ +## Copyright © 2018 Privategrity Corporation # +## # +## All rights reserved. # +################################################################################ + +# Output log file +log: "results/gateways/gateway-1.log" + +verbose: "true" + +# The cMix nodes in the network +cMixNodes: + - "localhost:50000" + - "localhost:50001" + - "localhost:50002" + - "localhost:50003" + - "localhost:50004" +# The index to which this Gateway is attached in the cMixNodes list +GatewayNodeIndex: 0 + +# The listening address of this gateway +GatewayAddress: "localhost:8440" + +# The number of seconds a message should remain in the globals before being +# deleted from the user's message queue +MessageTimeout: 1800 + +keyPath: "../keys/gateway.cmix.rip.key" +certPath: "../keys/gateway.cmix.rip.crt" +serverCertPath: "../keys/cmix.rip.crt" + +### Anything below this line is to be deprecated ### + +# Number of nodes in the cMix Network + +# Batch size of the cMix Network (to be deprecated) +batchSize: 4 diff --git a/basice2e/gateway-2.yaml b/basice2e/gateway-2.yaml new file mode 100644 index 0000000..b556c48 --- /dev/null +++ b/basice2e/gateway-2.yaml @@ -0,0 +1,38 @@ +################################################################################ +## Copyright © 2018 Privategrity Corporation # +## # +## All rights reserved. # +################################################################################ + +# Output log file +log: "results/gateways/gateway-2.log" + +verbose: "true" + +# The cMix nodes in the network +cMixNodes: + - "localhost:50000" + - "localhost:50001" + - "localhost:50002" + - "localhost:50003" + - "localhost:50004" +# The index to which this Gateway is attached in the cMixNodes list +GatewayNodeIndex: 1 + +# The listening address of this gateway +GatewayAddress: "localhost:8441" + +# The number of seconds a message should remain in the globals before being +# deleted from the user's message queue +MessageTimeout: 1800 + +keyPath: "../keys/gateway.cmix.rip.key" +certPath: "../keys/gateway.cmix.rip.crt" +serverCertPath: "../keys/cmix.rip.crt" + +### Anything below this line is to be deprecated ### + +# Number of nodes in the cMix Network + +# Batch size of the cMix Network (to be deprecated) +batchSize: 4 diff --git a/basice2e/gateway-3.yaml b/basice2e/gateway-3.yaml new file mode 100644 index 0000000..cc775fd --- /dev/null +++ b/basice2e/gateway-3.yaml @@ -0,0 +1,38 @@ +################################################################################ +## Copyright © 2018 Privategrity Corporation # +## # +## All rights reserved. # +################################################################################ + +# Output log file +log: "results/gateways/gateway-3.log" + +verbose: "true" + +# The cMix nodes in the network +cMixNodes: + - "localhost:50000" + - "localhost:50001" + - "localhost:50002" + - "localhost:50003" + - "localhost:50004" +# The index to which this Gateway is attached in the cMixNodes list +GatewayNodeIndex: 2 + +# The listening address of this gateway +GatewayAddress: "localhost:8442" + +# The number of seconds a message should remain in the globals before being +# deleted from the user's message queue +MessageTimeout: 1800 + +keyPath: "../keys/gateway.cmix.rip.key" +certPath: "../keys/gateway.cmix.rip.crt" +serverCertPath: "../keys/cmix.rip.crt" + +### Anything below this line is to be deprecated ### + +# Number of nodes in the cMix Network + +# Batch size of the cMix Network (to be deprecated) +batchSize: 4 diff --git a/basice2e/gateway.yaml b/basice2e/gateway-4.yaml similarity index 95% rename from basice2e/gateway.yaml rename to basice2e/gateway-4.yaml index 7b7fc4c..01a4c87 100644 --- a/basice2e/gateway.yaml +++ b/basice2e/gateway-4.yaml @@ -5,7 +5,7 @@ ################################################################################ # Output log file -log: "results/gateway.log" +log: "results/gateways/gateway-4.log" verbose: "true" @@ -17,7 +17,7 @@ cMixNodes: - "localhost:50003" - "localhost:50004" # The index to which this Gateway is attached in the cMixNodes list -GatewayNodeIndex: 4 +GatewayNodeIndex: 3 # The listening address of this gateway GatewayAddress: "localhost:8443" diff --git a/basice2e/gateway-5.yaml b/basice2e/gateway-5.yaml new file mode 100644 index 0000000..bddcb76 --- /dev/null +++ b/basice2e/gateway-5.yaml @@ -0,0 +1,38 @@ +################################################################################ +## Copyright © 2018 Privategrity Corporation # +## # +## All rights reserved. # +################################################################################ + +# Output log file +log: "results/gateways/gateway-5.log" + +verbose: "true" + +# The cMix nodes in the network +cMixNodes: + - "localhost:50000" + - "localhost:50001" + - "localhost:50002" + - "localhost:50003" + - "localhost:50004" +# The index to which this Gateway is attached in the cMixNodes list +GatewayNodeIndex: 4 + +# The listening address of this gateway +GatewayAddress: "localhost:8444" + +# The number of seconds a message should remain in the globals before being +# deleted from the user's message queue +MessageTimeout: 1800 + +keyPath: "../keys/gateway.cmix.rip.key" +certPath: "../keys/gateway.cmix.rip.crt" +serverCertPath: "../keys/cmix.rip.crt" + +### Anything below this line is to be deprecated ### + +# Number of nodes in the cMix Network + +# Batch size of the cMix Network (to be deprecated) +batchSize: 4 diff --git a/basice2e/run.sh b/basice2e/run.sh index 157ef4a..4717bde 100755 --- a/basice2e/run.sh +++ b/basice2e/run.sh @@ -8,13 +8,14 @@ rm -fr results || true rm blob* || true SERVERLOGS=results/servers +GATEWAYLOGS=results/gateways CLIENTOUT=results/clients CHANNELOUT=results/channelbot.console DUMMYOUT=results/dummy.console UDBOUT=results/udb.console -GATEWAYOUT=results/gateway.console mkdir -p $SERVERLOGS +mkdir -p $GATEWAYLOGS mkdir -p $CLIENTOUT echo "STARTING SERVERS..." @@ -52,7 +53,7 @@ trap finish INT sleep 45 # FIXME: We should not need this, but the servers don't respond quickly # enough on boot right now. -export GATEWAY=localhost:8443 +export GATEWAY="localhost:8444,localhost:8443,localhost:8442,localhost:8441,localhost:8440" runclients() { echo "Starting clients..." CTR=0 @@ -69,7 +70,7 @@ runclients() { nid=$(((($cid + 1) % 4) + 4)) eval NICK=\${NICK${cid}} # Send a regular message - CLIENTCMD="timeout 80s ../bin/client -f blob$cid --numnodes 5 -g $GATEWAY -i $cid -d $nid -m \"Hello, $nid\"" + CLIENTCMD="timeout 80s ../bin/client -f blob$cid -g $GATEWAY -c ../keys/gateway.cmix.rip.crt -i $cid -d $nid -m \"Hello, $nid\"" eval $CLIENTCMD >> $CLIENTOUT/client$cid$nid.out 2>&1 & PIDVAL=$! eval CLIENTS${CTR}=$PIDVAL @@ -87,7 +88,7 @@ runclients() { } # Start a channelbot server -CHANNELCMD="../bin/channelbot -v -i 31 --numnodes 5 --certpath ..//keys/gateway.cmix.rip.crt -g $GATEWAY -f blobchannel" +CHANNELCMD="../bin/channelbot -v -i 31 -c ..//keys/gateway.cmix.rip.crt -g $GATEWAY -f blobchannel" $CHANNELCMD >> $CHANNELOUT 2>&1 & PIDVAL=$! echo $PIDVAL >> results/serverpids @@ -101,31 +102,43 @@ echo $PIDVAL >> results/serverpids echo "$UDBCMD -- $PIDVAL" # Start a dummy client -DUMMYCMD="../bin/client -i 35 -d 35 -g $GATEWAY --numnodes 5 -m \"dummy\" --dummyfrequency 2 --certpath ../keys/gateway.cmix.rip.crt -f blobdummy" +DUMMYCMD="../bin/client -i 35 -d 35 -g $GATEWAY -m \"dummy\" --dummyfrequency 2 -c ../keys/gateway.cmix.rip.crt -f blobdummy" $DUMMYCMD >> $DUMMYOUT 2>&1 & PIDVAL=$! echo $PIDVAL >> results/serverpids echo "$DUMMYCMD -- $PIDVAL" -# Start a gateway -GATEWAYCMD="../bin/gateway -v --config gateway.yaml" -$GATEWAYCMD >> $GATEWAYOUT 2>&1 & -PIDVAL=$! -echo $PIDVAL >> results/serverpids -echo "$GATEWAYCMD -- $PIDVAL" - -# Send a registration command -cat registration-commands.txt | while read LINE +# Start gateways +for GWID in $(seq 5 -1 1) do - CLIENTCMD="timeout 90s ../bin/client -f blob9 --numnodes 5 -g $GATEWAY -i 9 -d 3 --certpath ../keys/gateway.cmix.rip.crt -m \"$LINE\"" - eval $CLIENTCMD >> $CLIENTOUT/client9.out 2>&1 & + GATEWAYCMD="../bin/gateway -v --config gateway-$GWID.yaml" + $GATEWAYCMD > $GATEWAYLOGS/gateway-$GWID.console 2>&1 & PIDVAL=$! - echo "$CLIENTCMD -- $PIDVAL" - wait $PIDVAL + echo $PIDVAL >> results/serverpids + echo "$GATEWAYCMD -- $PIDVAL" done +# Register two users and then do UDB search on each other +CLIENTCMD="timeout 90s ../bin/client -f blob9 -g $GATEWAY -E "jake@elixxir.io" -i 9 -d 3 -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 jake@elixxir.io\"" +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\"" +eval $CLIENTCMD >> $CLIENTOUT/client9.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 --numnodes 5 --certpath ../keys/gateway.cmix.rip.crt -g $GATEWAY -i 8 -d 31 -m \"Channel, Hello\"" +CLIENTCMD="timeout 60s ../bin/client -f blob8 -c ../keys/gateway.cmix.rip.crt -g $GATEWAY -i 8 -d 31 -m \"Channel, Hello\"" eval $CLIENTCMD >> $CLIENTOUT/client8.out 2>&1 & PIDVAL=$! echo "$CLIENTCMD -- $PIDVAL" @@ -148,8 +161,8 @@ 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 -cat $GATEWAYOUT | grep "ERROR" > results/gateway-errors.txt || true -cat $GATEWAYOUT | grep "FATAL" >> results/gateway-errors.txt || true +cat $GATEWAYLOGS/*.log | grep "ERROR" > results/gateway-errors.txt || true +cat $GATEWAYLOGS/*.log | grep "FATAL" >> results/gateway-errors.txt || true diff -ruN results/gateway-errors.txt noerrors.txt diff --git a/basice2e/server-1.yaml b/basice2e/server-1.yaml index 389959d..1b9e5e4 100644 --- a/basice2e/server-1.yaml +++ b/basice2e/server-1.yaml @@ -1,9 +1,9 @@ logPath: "results/servers/server-1.log" verbose: "false" batchSize: 4 -dbUsername: "cmix" +dbUsername: "bernardo" dbPassword: "" -dbName: "cmix_server" +dbName: "node1" dbAddresses: - "" - "" @@ -17,7 +17,8 @@ servers: - localhost:50003 - localhost:50004 gateways: - - "localhost:8443" + - "localhost:8440" keyPath: "../keys/cmix.rip.key" certPath: "../keys/cmix.rip.crt" gatewayCertPath: "../keys/gateway.cmix.rip.crt" +skipReg: "true" diff --git a/basice2e/server-2.yaml b/basice2e/server-2.yaml index 66853d5..184abe1 100644 --- a/basice2e/server-2.yaml +++ b/basice2e/server-2.yaml @@ -1,9 +1,9 @@ logPath: "results/servers/server-2.log" verbose: "false" batchSize: 4 -dbUsername: "cmix" +dbUsername: "bernardo" dbPassword: "" -dbName: "cmix_server" +dbName: "node2" dbAddresses: - "" - "" @@ -17,7 +17,8 @@ servers: - localhost:50003 - localhost:50004 gateways: - - "localhost:8443" + - "localhost:8441" keyPath: "../keys/cmix.rip.key" certPath: "../keys/cmix.rip.crt" gatewayCertPath: "../keys/gateway.cmix.rip.crt" +skipReg: "true" diff --git a/basice2e/server-3.yaml b/basice2e/server-3.yaml index 5fbfbe8..e402126 100644 --- a/basice2e/server-3.yaml +++ b/basice2e/server-3.yaml @@ -1,9 +1,9 @@ logPath: "results/servers/server-3.log" verbose: "false" batchSize: 4 -dbUsername: "cmix" +dbUsername: "bernardo" dbPassword: "" -dbName: "cmix_server" +dbName: "node3" dbAddresses: - "" - "" @@ -17,7 +17,8 @@ servers: - localhost:50003 - localhost:50004 gateways: - - "localhost:8443" + - "localhost:8442" keyPath: "../keys/cmix.rip.key" certPath: "../keys/cmix.rip.crt" gatewayCertPath: "../keys/gateway.cmix.rip.crt" +skipReg: "true" diff --git a/basice2e/server-4.yaml b/basice2e/server-4.yaml index da56647..0a6839f 100644 --- a/basice2e/server-4.yaml +++ b/basice2e/server-4.yaml @@ -1,9 +1,9 @@ logPath: "results/servers/server-4.log" verbose: "false" batchSize: 4 -dbUsername: "cmix" +dbUsername: "bernardo" dbPassword: "" -dbName: "cmix_server" +dbName: "node4" dbAddresses: - "" - "" @@ -21,3 +21,4 @@ gateways: keyPath: "../keys/cmix.rip.key" certPath: "../keys/cmix.rip.crt" gatewayCertPath: "../keys/gateway.cmix.rip.crt" +skipReg: "true" diff --git a/basice2e/server-5.yaml b/basice2e/server-5.yaml index 6f263c8..b587879 100644 --- a/basice2e/server-5.yaml +++ b/basice2e/server-5.yaml @@ -1,9 +1,9 @@ logPath: "results/servers/server-5.log" verbose: "false" batchSize: 4 -dbUsername: "cmix" +dbUsername: "bernardo" dbPassword: "" -dbName: "cmix_server" +dbName: "node5" dbAddresses: - "" - "" @@ -17,7 +17,8 @@ servers: - localhost:50003 - localhost:50004 gateways: - - "localhost:8443" + - "localhost:8444" keyPath: "../keys/cmix.rip.key" certPath: "../keys/cmix.rip.crt" gatewayCertPath: "../keys/gateway.cmix.rip.crt" +skipReg: "true" diff --git a/basice2e/udb.yaml b/basice2e/udb.yaml index 67b314b..091e0c1 100644 --- a/basice2e/udb.yaml +++ b/basice2e/udb.yaml @@ -1,6 +1,9 @@ # UDB Config for E2E Integration test logPath: "logfile.log" -numNodes: 5 gateways: + - "localhost:8444" - "localhost:8443" + - "localhost:8442" + - "localhost:8441" + - "localhost:8440" certPath: "../keys/gateway.cmix.rip.crt" diff --git a/update.sh b/update.sh index 791e482..53d9690 100755 --- a/update.sh +++ b/update.sh @@ -47,6 +47,14 @@ pushd $GOPATH/src/gitlab.com/elixxir/client-consoleUI update popd +pushd $GOPATH/src/gitlab.com/elixxir/primitives +update +popd + +pushd $GOPATH/src/gitlab.com/elixxir/registration +update +popd + pushd .. go test ./... popd -- GitLab