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

Merge branch 'registration' into 'master'

Modify Integration to test Registration + UDB

See merge request !26
parents b5aaa83d 3b341178
No related branches found
No related tags found
No related merge requests found
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]
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 18]
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"
################################################################################
## 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
################################################################################
## 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
################################################################################
## 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
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
################################################################################ ################################################################################
# Output log file # Output log file
log: "results/gateway.log" log: "results/gateways/gateway-4.log"
verbose: "true" verbose: "true"
...@@ -17,7 +17,7 @@ cMixNodes: ...@@ -17,7 +17,7 @@ cMixNodes:
- "localhost:50003" - "localhost:50003"
- "localhost:50004" - "localhost:50004"
# The index to which this Gateway is attached in the cMixNodes list # The index to which this Gateway is attached in the cMixNodes list
GatewayNodeIndex: 4 GatewayNodeIndex: 3
# The listening address of this gateway # The listening address of this gateway
GatewayAddress: "localhost:8443" GatewayAddress: "localhost:8443"
......
################################################################################
## 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
...@@ -8,13 +8,14 @@ rm -fr results || true ...@@ -8,13 +8,14 @@ rm -fr results || true
rm blob* || true rm blob* || true
SERVERLOGS=results/servers SERVERLOGS=results/servers
GATEWAYLOGS=results/gateways
CLIENTOUT=results/clients CLIENTOUT=results/clients
CHANNELOUT=results/channelbot.console CHANNELOUT=results/channelbot.console
DUMMYOUT=results/dummy.console DUMMYOUT=results/dummy.console
UDBOUT=results/udb.console UDBOUT=results/udb.console
GATEWAYOUT=results/gateway.console
mkdir -p $SERVERLOGS mkdir -p $SERVERLOGS
mkdir -p $GATEWAYLOGS
mkdir -p $CLIENTOUT mkdir -p $CLIENTOUT
echo "STARTING SERVERS..." echo "STARTING SERVERS..."
...@@ -52,7 +53,7 @@ trap finish INT ...@@ -52,7 +53,7 @@ trap finish INT
sleep 45 # 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 GATEWAY=localhost:8443 export GATEWAY="localhost:8444,localhost:8443,localhost:8442,localhost:8441,localhost:8440"
runclients() { runclients() {
echo "Starting clients..." echo "Starting clients..."
CTR=0 CTR=0
...@@ -69,7 +70,7 @@ runclients() { ...@@ -69,7 +70,7 @@ runclients() {
nid=$(((($cid + 1) % 4) + 4)) nid=$(((($cid + 1) % 4) + 4))
eval NICK=\${NICK${cid}} eval NICK=\${NICK${cid}}
# Send a regular message # 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 & eval $CLIENTCMD >> $CLIENTOUT/client$cid$nid.out 2>&1 &
PIDVAL=$! PIDVAL=$!
eval CLIENTS${CTR}=$PIDVAL eval CLIENTS${CTR}=$PIDVAL
...@@ -87,7 +88,7 @@ runclients() { ...@@ -87,7 +88,7 @@ runclients() {
} }
# Start a channelbot server # 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 & $CHANNELCMD >> $CHANNELOUT 2>&1 &
PIDVAL=$! PIDVAL=$!
echo $PIDVAL >> results/serverpids echo $PIDVAL >> results/serverpids
...@@ -101,31 +102,43 @@ echo $PIDVAL >> results/serverpids ...@@ -101,31 +102,43 @@ echo $PIDVAL >> results/serverpids
echo "$UDBCMD -- $PIDVAL" echo "$UDBCMD -- $PIDVAL"
# Start a dummy client # 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 & $DUMMYCMD >> $DUMMYOUT 2>&1 &
PIDVAL=$! PIDVAL=$!
echo $PIDVAL >> results/serverpids echo $PIDVAL >> results/serverpids
echo "$DUMMYCMD -- $PIDVAL" echo "$DUMMYCMD -- $PIDVAL"
# Start a gateway # Start gateways
GATEWAYCMD="../bin/gateway -v --config gateway.yaml" for GWID in $(seq 5 -1 1)
$GATEWAYCMD >> $GATEWAYOUT 2>&1 & do
GATEWAYCMD="../bin/gateway -v --config gateway-$GWID.yaml"
$GATEWAYCMD > $GATEWAYLOGS/gateway-$GWID.console 2>&1 &
PIDVAL=$! PIDVAL=$!
echo $PIDVAL >> results/serverpids echo $PIDVAL >> results/serverpids
echo "$GATEWAYCMD -- $PIDVAL" echo "$GATEWAYCMD -- $PIDVAL"
done
# Send a registration command # Register two users and then do UDB search on each other
cat registration-commands.txt | while read LINE CLIENTCMD="timeout 90s ../bin/client -f blob9 -g $GATEWAY -E "jake@elixxir.io" -i 9 -d 3 -c ../keys/gateway.cmix.rip.crt"
do eval $CLIENTCMD >> $CLIENTOUT/client9.out 2>&1 &
CLIENTCMD="timeout 90s ../bin/client -f blob9 --numnodes 5 -g $GATEWAY -i 9 -d 3 --certpath ../keys/gateway.cmix.rip.crt -m \"$LINE\"" 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 & eval $CLIENTCMD >> $CLIENTOUT/client9.out 2>&1 &
PIDVAL=$! PIDVAL=$!
echo "$CLIENTCMD -- $PIDVAL" echo "$CLIENTCMD -- $PIDVAL"
wait $PIDVAL wait $PIDVAL
done
# Send a channel message that all clients will receive # 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 & eval $CLIENTCMD >> $CLIENTOUT/client8.out 2>&1 &
PIDVAL=$! PIDVAL=$!
echo "$CLIENTCMD -- $PIDVAL" echo "$CLIENTCMD -- $PIDVAL"
...@@ -148,8 +161,9 @@ diff -ruN results/channel-errors.txt noerrors.txt ...@@ -148,8 +161,9 @@ diff -ruN results/channel-errors.txt noerrors.txt
cat $DUMMYOUT | grep "ERROR" > results/dummy-errors.txt || true cat $DUMMYOUT | grep "ERROR" > results/dummy-errors.txt || true
cat $DUMMYOUT | grep "FATAL" >> results/dummy-errors.txt || true cat $DUMMYOUT | grep "FATAL" >> results/dummy-errors.txt || true
diff -ruN results/dummy-errors.txt noerrors.txt diff -ruN results/dummy-errors.txt noerrors.txt
cat $GATEWAYOUT | grep "ERROR" > results/gateway-errors.txt || true IGNOREMSG="GetRoundBufferInfo: Error received: rpc error: code = Unknown desc = round buffer is empty"
cat $GATEWAYOUT | grep "FATAL" >> results/gateway-errors.txt || true cat $GATEWAYLOGS/*.log | grep "ERROR" | grep -v $IGNOREMSG > results/gateway-errors.txt || true
cat $GATEWAYLOGS/*.log | grep "FATAL" >> results/gateway-errors.txt || true
diff -ruN results/gateway-errors.txt noerrors.txt diff -ruN results/gateway-errors.txt noerrors.txt
......
logPath: "results/servers/server-1.log" logPath: "results/servers/server-1.log"
verbose: "false" verbose: "false"
batchSize: 4 batchSize: 4
dbUsername: "cmix" dbUsername: "bernardo"
dbPassword: "" dbPassword: ""
dbName: "cmix_server" dbName: "node1"
dbAddresses: dbAddresses:
- "" - ""
- "" - ""
...@@ -17,7 +17,8 @@ servers: ...@@ -17,7 +17,8 @@ servers:
- localhost:50003 - localhost:50003
- localhost:50004 - localhost:50004
gateways: gateways:
- "localhost:8443" - "localhost:8440"
keyPath: "../keys/cmix.rip.key" keyPath: "../keys/cmix.rip.key"
certPath: "../keys/cmix.rip.crt" certPath: "../keys/cmix.rip.crt"
gatewayCertPath: "../keys/gateway.cmix.rip.crt" gatewayCertPath: "../keys/gateway.cmix.rip.crt"
skipReg: "true"
logPath: "results/servers/server-2.log" logPath: "results/servers/server-2.log"
verbose: "false" verbose: "false"
batchSize: 4 batchSize: 4
dbUsername: "cmix" dbUsername: "bernardo"
dbPassword: "" dbPassword: ""
dbName: "cmix_server" dbName: "node2"
dbAddresses: dbAddresses:
- "" - ""
- "" - ""
...@@ -17,7 +17,8 @@ servers: ...@@ -17,7 +17,8 @@ servers:
- localhost:50003 - localhost:50003
- localhost:50004 - localhost:50004
gateways: gateways:
- "localhost:8443" - "localhost:8441"
keyPath: "../keys/cmix.rip.key" keyPath: "../keys/cmix.rip.key"
certPath: "../keys/cmix.rip.crt" certPath: "../keys/cmix.rip.crt"
gatewayCertPath: "../keys/gateway.cmix.rip.crt" gatewayCertPath: "../keys/gateway.cmix.rip.crt"
skipReg: "true"
logPath: "results/servers/server-3.log" logPath: "results/servers/server-3.log"
verbose: "false" verbose: "false"
batchSize: 4 batchSize: 4
dbUsername: "cmix" dbUsername: "bernardo"
dbPassword: "" dbPassword: ""
dbName: "cmix_server" dbName: "node3"
dbAddresses: dbAddresses:
- "" - ""
- "" - ""
...@@ -17,7 +17,8 @@ servers: ...@@ -17,7 +17,8 @@ servers:
- localhost:50003 - localhost:50003
- localhost:50004 - localhost:50004
gateways: gateways:
- "localhost:8443" - "localhost:8442"
keyPath: "../keys/cmix.rip.key" keyPath: "../keys/cmix.rip.key"
certPath: "../keys/cmix.rip.crt" certPath: "../keys/cmix.rip.crt"
gatewayCertPath: "../keys/gateway.cmix.rip.crt" gatewayCertPath: "../keys/gateway.cmix.rip.crt"
skipReg: "true"
logPath: "results/servers/server-4.log" logPath: "results/servers/server-4.log"
verbose: "false" verbose: "false"
batchSize: 4 batchSize: 4
dbUsername: "cmix" dbUsername: "bernardo"
dbPassword: "" dbPassword: ""
dbName: "cmix_server" dbName: "node4"
dbAddresses: dbAddresses:
- "" - ""
- "" - ""
...@@ -21,3 +21,4 @@ gateways: ...@@ -21,3 +21,4 @@ gateways:
keyPath: "../keys/cmix.rip.key" keyPath: "../keys/cmix.rip.key"
certPath: "../keys/cmix.rip.crt" certPath: "../keys/cmix.rip.crt"
gatewayCertPath: "../keys/gateway.cmix.rip.crt" gatewayCertPath: "../keys/gateway.cmix.rip.crt"
skipReg: "true"
logPath: "results/servers/server-5.log" logPath: "results/servers/server-5.log"
verbose: "false" verbose: "false"
batchSize: 4 batchSize: 4
dbUsername: "cmix" dbUsername: "bernardo"
dbPassword: "" dbPassword: ""
dbName: "cmix_server" dbName: "node5"
dbAddresses: dbAddresses:
- "" - ""
- "" - ""
...@@ -17,7 +17,8 @@ servers: ...@@ -17,7 +17,8 @@ servers:
- localhost:50003 - localhost:50003
- localhost:50004 - localhost:50004
gateways: gateways:
- "localhost:8443" - "localhost:8444"
keyPath: "../keys/cmix.rip.key" keyPath: "../keys/cmix.rip.key"
certPath: "../keys/cmix.rip.crt" certPath: "../keys/cmix.rip.crt"
gatewayCertPath: "../keys/gateway.cmix.rip.crt" gatewayCertPath: "../keys/gateway.cmix.rip.crt"
skipReg: "true"
# UDB Config for E2E Integration test # UDB Config for E2E Integration test
logPath: "logfile.log" logPath: "logfile.log"
numNodes: 5
gateways: gateways:
- "localhost:8444"
- "localhost:8443" - "localhost:8443"
- "localhost:8442"
- "localhost:8441"
- "localhost:8440"
certPath: "../keys/gateway.cmix.rip.crt" certPath: "../keys/gateway.cmix.rip.crt"
...@@ -47,6 +47,14 @@ pushd $GOPATH/src/gitlab.com/elixxir/client-consoleUI ...@@ -47,6 +47,14 @@ pushd $GOPATH/src/gitlab.com/elixxir/client-consoleUI
update update
popd popd
pushd $GOPATH/src/gitlab.com/elixxir/primitives
update
popd
pushd $GOPATH/src/gitlab.com/elixxir/registration
update
popd
pushd .. pushd ..
go test ./... go test ./...
popd popd
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment