diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4caf067811d81a254d4ce5f04a1d1a5f42052f51..42cb9282ddb5808f635bbf0c7f5b1ad9bdb545d0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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: diff --git a/basice2e/clients.goldoutput/client2122.out b/basice2e/clients.goldoutput/client2122.out new file mode 100644 index 0000000000000000000000000000000000000000..50a0d726bcecbcb73748ff04661ed2a0bb50428b --- /dev/null +++ b/basice2e/clients.goldoutput/client2122.out @@ -0,0 +1,2 @@ +Sending Message to 22, : Hello, 22 +Message from 24, Received: Hello, 21 diff --git a/basice2e/clients.goldoutput/client2223.out b/basice2e/clients.goldoutput/client2223.out new file mode 100644 index 0000000000000000000000000000000000000000..af930c46bb4f715b46f829e78250bc1f7f669317 --- /dev/null +++ b/basice2e/clients.goldoutput/client2223.out @@ -0,0 +1,2 @@ +Sending Message to 23, : Hello, 23 +Message from 21, Received: Hello, 22 diff --git a/basice2e/clients.goldoutput/client2324.out b/basice2e/clients.goldoutput/client2324.out new file mode 100644 index 0000000000000000000000000000000000000000..7b5f808e59276820eb7ab2e59018eaca801b1964 --- /dev/null +++ b/basice2e/clients.goldoutput/client2324.out @@ -0,0 +1,2 @@ +Sending Message to 24, : Hello, 24 +Message from 22, Received: Hello, 23 diff --git a/basice2e/clients.goldoutput/client2421.out b/basice2e/clients.goldoutput/client2421.out new file mode 100644 index 0000000000000000000000000000000000000000..4e758a236e242f5c11f57f0c7c5d942b31883d88 --- /dev/null +++ b/basice2e/clients.goldoutput/client2421.out @@ -0,0 +1,2 @@ +Sending Message to 21, : Hello, 21 +Message from 23, Received: Hello, 24 diff --git a/basice2e/gateway.yaml b/basice2e/gateway.yaml new file mode 100644 index 0000000000000000000000000000000000000000..eeffe0d73c766d6d778c0d27ca0d8ea9d5467e63 --- /dev/null +++ b/basice2e/gateway.yaml @@ -0,0 +1,32 @@ +################################################################################ +## 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 diff --git a/basice2e/run.sh b/basice2e/run.sh index 311d52d0ffd49c8889c34bc30b9ed006252999af..c831c25388a54bd4a667476f3143c5e504501dc6 100755 --- a/basice2e/run.sh +++ b/basice2e/run.sh @@ -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!" diff --git a/basice2e/server-5.yaml b/basice2e/server-5.yaml index 8c715f7c5ef0270c9aa49304c3bd60c43f6a30df..6f483d2cec24eff3d2b5f57fee712cca23f03cae 100644 --- a/basice2e/server-5.yaml +++ b/basice2e/server-5.yaml @@ -16,3 +16,4 @@ servers: - localhost:50002 - localhost:50003 - localhost:50004 +gatewayAddress: "localhost:8443" diff --git a/build.sh b/build.sh index c9c9f7148b17a77f1553dc379039c91d33e73e1e..3faffc819f1d3bdf4b18690380de900dc41c0b0a 100755 --- a/build.sh +++ b/build.sh @@ -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 diff --git a/update.sh b/update.sh index 32db2e7db60d26551cb26e5dc192f17ec38431d6..d173a60468b9077124e94fe8fa5a6823923026c0 100755 --- a/update.sh +++ b/update.sh @@ -6,30 +6,47 @@ git pull rm -fr ~/.glide +update() { + git clean -ffdx +# git checkout master + git pull + glide cc + glide up +} + pushd $GOPATH/src/gitlab.com/privategrity/client -git clean -ffdx -git pull -glide cc -glide up +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 +