Skip to content
Snippets Groups Projects
Commit 9c240a70 authored by Spencer Brown's avatar Spencer Brown
Browse files

Run a batch through the gateway

parent 36ebc542
No related branches found
No related tags found
No related merge requests found
...@@ -2,3 +2,5 @@ Sending Message to 2, Jim: Hello, 2 ...@@ -2,3 +2,5 @@ Sending Message to 2, Jim: Hello, 2
Message from 31, #General Received: Channel, Hello Message from 31, #General Received: Channel, Hello
Sending Message to 2, Jim: Hello, 2 Sending Message to 2, Jim: Hello, 2
Message from 4, Rick Received: Hello, 1 Message from 4, Rick Received: Hello, 1
Sending Message to 2, Jim: Hello, 2
Message from 4, Rick Received: Hello, 1
...@@ -2,3 +2,5 @@ Sending Message to 3, Ben: Hello, 3 ...@@ -2,3 +2,5 @@ Sending Message to 3, Ben: Hello, 3
Message from 31, #General Received: Channel, Hello Message from 31, #General Received: Channel, Hello
Sending Message to 3, Ben: Hello, 3 Sending Message to 3, Ben: Hello, 3
Message from 1, David Received: Hello, 2 Message from 1, David Received: Hello, 2
Sending Message to 3, Ben: Hello, 3
Message from 1, David Received: Hello, 2
...@@ -2,3 +2,5 @@ Sending Message to 4, Rick: Hello, 4 ...@@ -2,3 +2,5 @@ Sending Message to 4, Rick: Hello, 4
Message from 31, #General Received: Channel, Hello Message from 31, #General Received: Channel, Hello
Sending Message to 4, Rick: Hello, 4 Sending Message to 4, Rick: Hello, 4
Message from 2, Jim Received: Hello, 3 Message from 2, Jim Received: Hello, 3
Sending Message to 4, Rick: Hello, 4
Message from 2, Jim Received: Hello, 3
...@@ -2,3 +2,5 @@ Sending Message to 1, David: Hello, 1 ...@@ -2,3 +2,5 @@ Sending Message to 1, David: Hello, 1
Message from 31, #General Received: Channel, Hello Message from 31, #General Received: Channel, Hello
Sending Message to 1, David: Hello, 1 Sending Message to 1, David: Hello, 1
Message from 3, Ben Received: Hello, 4 Message from 3, Ben Received: Hello, 4
Sending Message to 1, David: Hello, 1
Message from 3, Ben Received: Hello, 4
################################################################################
## Copyright © 2018 Privategrity Corporation #
## #
## All rights reserved. #
################################################################################
##
# Sample Gateway Configuration
##
# Output log file
log: "results/gateway.log"
# 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:8443"
# The number of seconds a message should remain in the globals before being
# deleted from the user's message queue
MessageTimeout: 60
### 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
...@@ -12,6 +12,7 @@ CLIENTOUT=results/clients ...@@ -12,6 +12,7 @@ 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 $CLIENTOUT mkdir -p $CLIENTOUT
...@@ -68,7 +69,7 @@ runclients() { ...@@ -68,7 +69,7 @@ runclients() {
nid=$((($cid % 4) + 1)) nid=$((($cid % 4) + 1))
eval NICK=\${NICK${cid}} eval NICK=\${NICK${cid}}
# Send a regular message # Send a regular message
CLIENTCMD="timeout 60s ../bin/client -f blob$cid --numnodes 5 -s $LASTNODE -i $cid -d $nid -m \"Hello, $nid\" --noratchet" CLIENTCMD="timeout 60s ../bin/client -f blob$cid --numnodes 5 $GATEWAY -s $LASTNODE -i $cid -d $nid -m \"Hello, $nid\" --noratchet"
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
...@@ -106,6 +107,13 @@ PIDVAL=$! ...@@ -106,6 +107,13 @@ PIDVAL=$!
echo $PIDVAL >> results/serverpids echo $PIDVAL >> results/serverpids
echo "$DUMMYCMD -- $PIDVAL" echo "$DUMMYCMD -- $PIDVAL"
# Start a gateway
GATEWAYCMD="../bin/gateway --config gateway.yaml"
$GATEWAYCMD >> $GATEWAYOUT 2>&1 &
PIDVAL=$!
echo $PIDVAL >> results/serverpids
echo "$GATEWAYCMD -- $PIDVAL"
# Send a registration command # Send a registration command
cat registration-commands.txt | while read LINE cat registration-commands.txt | while read LINE
do do
...@@ -129,6 +137,9 @@ echo "RUNNING CLIENTS..." ...@@ -129,6 +137,9 @@ echo "RUNNING CLIENTS..."
runclients runclients
echo "RUNNING CLIENTS (2nd time)..." echo "RUNNING CLIENTS (2nd time)..."
runclients runclients
echo "RUNNING CLIENTS THROUGH GATEWAY..."
GATEWAY="-g localhost:8443"
runclients
# HACK HACK HACK: Remove the ratchet warning from client output # HACK HACK HACK: Remove the ratchet warning from client output
for F in $(find results/clients -type f) for F in $(find results/clients -type f)
...@@ -148,6 +159,10 @@ diff -ruN results/channel-errors.txt noerrors.txt ...@@ -148,6 +159,10 @@ 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
cat $GATEWAYOUT | grep "FATAL" >> results/gateway-errors.txt || true
diff -ruN results/gateway-errors.txt noerrors.txt
echo "SUCCESS!" echo "SUCCESS!"
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
# and assumes that you've cloned the Go repos to your GOPATH and updated them # and assumes that you've cloned the Go repos to your GOPATH and updated them
# with Glide. # with Glide.
mkdir -p bin
pushd $GOPATH/src/gitlab.com/privategrity/client pushd $GOPATH/src/gitlab.com/privategrity/client
go generate cmd/version.go go generate cmd/version.go
go build go build
...@@ -29,3 +31,8 @@ popd ...@@ -29,3 +31,8 @@ popd
go build -o udb $UDBPATH go build -o udb $UDBPATH
mv ./udb bin mv ./udb bin
pushd $GOPATH/src/gitlab.com/privategrity/gateway
go generate cmd/version.go
go build
popd
mv $GOPATH/src/gitlab.com/privategrity/gateway/gateway bin
...@@ -6,30 +6,47 @@ ...@@ -6,30 +6,47 @@
git pull git pull
rm -fr ~/.glide rm -fr ~/.glide
pushd $GOPATH/src/gitlab.com/privategrity/client update() {
git clean -ffdx git clean -ffdx
# git checkout master
git pull git pull
glide cc glide cc
glide up glide up
}
pushd $GOPATH/src/gitlab.com/privategrity/client
update
popd popd
pushd $GOPATH/src/gitlab.com/privategrity/server pushd $GOPATH/src/gitlab.com/privategrity/server
git clean -ffdx update
git pull
glide cc
glide up
popd popd
pushd $GOPATH/src/gitlab.com/privategrity/channelbot pushd $GOPATH/src/gitlab.com/privategrity/channelbot
git clean -ffdx update
git pull
glide cc
glide up
popd popd
pushd $GOPATH/src/gitlab.com/privategrity/user-discovery-bot pushd $GOPATH/src/gitlab.com/privategrity/user-discovery-bot
git clean -ffdx update
git pull
glide cc
glide up
popd popd
pushd $GOPATH/src/gitlab.com/privategrity/gateway
update
popd
#pushd $GOPATH/src/gitlab.com/privategrity/comms
#update
#popd
#pushd $GOPATH/src/gitlab.com/privategrity/crypto
#update
#popd
#pushd $GOPATH/src/gitlab.com/privategrity/client-consoleUI
#update
#popd
pushd ..
go test ./...
popd
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment