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

Merge branch 'gateway-integration' into 'master'

Run a batch through the gateway

See merge request privategrity/integration!14
parents ccb52931 23b7b15d
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,7 @@ variables:
CLIENT_URL: $PRIVATEGRITY_REPOS/client/$DL_URL_FRAG/client.linux64?job=build
CHANNELBOT_URL: $PRIVATEGRITY_REPOS/channelbot/$DL_URL_FRAG/channelbot.linux64?job=build
UDB_URL: $PRIVATEGRITY_REPOS/user-discovery-bot/$DL_URL_FRAG/udb.linux64?job=build
GATEWAY_URL: $PRIVATEGRITY_REPOS/gateway/$DL_URL_FRAG/gateway.linux64?job=build
before_script:
##
......@@ -54,8 +55,14 @@ installbinaries:
- chmod +x bin/channelbot
- "curl -f -L -H \"PRIVATE-TOKEN: $PATKEY\" -o bin/udb $UDB_URL"
- chmod +x bin/udb
- "curl -f -L -H \"PRIVATE-TOKEN: $PATKEY\" -o bin/gateway $GATEWAY_URL"
- chmod +x bin/gateway
- echo $PWD
- find bin/ -type f -exec file {} \;
- bin/server --version
- bin/client --version
- bin/channelbot --version
- bin/udb --version
- bin/gateway --version
artifacts:
when: always
paths:
......
Sending Message to 22, : Hello, 22
Message from 24, Received: Hello, 21
Sending Message to 23, : Hello, 23
Message from 21, Received: Hello, 22
Sending Message to 24, : Hello, 24
Message from 22, Received: Hello, 23
Sending Message to 21, : Hello, 21
Message from 23, Received: Hello, 24
################################################################################
## Copyright © 2018 Privategrity Corporation #
## #
## All rights reserved. #
################################################################################
# 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: 1800
### 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
CHANNELOUT=results/channelbot.console
DUMMYOUT=results/dummy.console
UDBOUT=results/udb.console
GATEWAYOUT=results/gateway.console
mkdir -p $SERVERLOGS
mkdir -p $CLIENTOUT
......@@ -85,6 +86,39 @@ runclients() {
done
}
export GATEWAY=localhost:8443
runclientsgw() {
CTR=0
for cid in $(seq 21 24)
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) + 21))
eval NICK=\${NICK${cid}}
# Send a regular message
CLIENTCMD="timeout 60s ../bin/client -f blobgw$cid --numnodes 5 -g $GATEWAY -s $LASTNODE -i $cid -d $nid -m \"Hello, $nid\" --noratchet"
eval $CLIENTCMD >> $CLIENTOUT/client$cid$nid.out 2>&1 &
PIDVAL=$!
eval CLIENTS${CTR}=$PIDVAL
echo "$CLIENTCMD -- $PIDVAL"
CTR=$(($CTR + 1))
done
done
echo "WAITING FOR $CTR CLIENTS TO EXIT..."
for i in $(seq 0 $(($CTR - 1)))
do
eval echo "Waiting on \${CLIENTS${i}} ..."
eval wait \${CLIENTS${i}}
done
}
# Start a channelbot server
CHANNELCMD="../bin/channelbot -v -i 31 --numnodes 5 -s $LASTNODE -f blobchannel"
$CHANNELCMD >> $CHANNELOUT 2>&1 &
......@@ -106,6 +140,13 @@ PIDVAL=$!
echo $PIDVAL >> results/serverpids
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
cat registration-commands.txt | while read LINE
do
......@@ -130,6 +171,10 @@ runclients
echo "RUNNING CLIENTS (2nd time)..."
runclients
# Same function, different blob names and client IDs
echo "RUNNING CLIENTS THROUGH GATEWAY..."
runclientsgw
# HACK HACK HACK: Remove the ratchet warning from client output
for F in $(find results/clients -type f)
do
......@@ -148,6 +193,10 @@ 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
diff -ruN results/gateway-errors.txt noerrors.txt
echo "SUCCESS!"
......@@ -16,3 +16,4 @@ servers:
- localhost:50002
- localhost:50003
- localhost:50004
gatewayAddress: "localhost:8443"
......@@ -4,6 +4,8 @@
# and assumes that you've cloned the Go repos to your GOPATH and updated them
# with Glide.
mkdir -p bin
pushd $GOPATH/src/gitlab.com/privategrity/client
go generate cmd/version.go
go build
......@@ -29,3 +31,8 @@ popd
go build -o udb $UDBPATH
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 @@
git pull
rm -fr ~/.glide
pushd $GOPATH/src/gitlab.com/privategrity/client
update() {
git clean -ffdx
# git checkout master
git pull
glide cc
glide up
}
pushd $GOPATH/src/gitlab.com/privategrity/client
update
popd
pushd $GOPATH/src/gitlab.com/privategrity/server
git clean -ffdx
git pull
glide cc
glide up
update
popd
pushd $GOPATH/src/gitlab.com/privategrity/channelbot
git clean -ffdx
git pull
glide cc
glide up
update
popd
pushd $GOPATH/src/gitlab.com/privategrity/user-discovery-bot
git clean -ffdx
git pull
glide cc
glide up
update
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