Skip to content

Commit

Permalink
Merge pull request #178 from MysteriumNetwork/feature/simple-integrat…
Browse files Browse the repository at this point in the history
…ion-test

Add simple integration test for client with CLI
  • Loading branch information
donce committed Feb 27, 2018
2 parents afee6ae + 97a3a95 commit 013da86
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bin/client_docker/docker-entrypoint.sh
Expand Up @@ -9,6 +9,6 @@ exec /usr/bin/mysterium_client \
--config-dir=$OS_DIR_CONFIG \
--data-dir=$OS_DIR_DATA \
--runtime-dir=$OS_DIR_RUN \
--tequilapi.address=localhost \
--tequilapi.address=0.0.0.0 \
--tequilapi.port=$MYSTERIUM_CLIENT_TEQUILAPI_PORT \
--discovery-address=$MYSTERIUM_DISCOVERY_ADDRESS \
48 changes: 48 additions & 0 deletions bin/integration_test.sh
@@ -0,0 +1,48 @@
#!/usr/bin/env bash

PROJECT_NAME="nodetest"
SUCCESS_COLOR='\033[0;32m' # green
FAILURE_COLOR="\033[0;31m" # red
DEFAULT_COLOR="\033[0;0m"

print_success () {
echo -e $SUCCESS_COLOR$1$DEFAULT_COLOR
}

print_error () {
echo -e $FAILURE_COLOR$1$DEFAULT_COLOR
}

setup () {
sudo docker-compose -p $PROJECT_NAME build
if [ ! $? -eq 0 ]; then
print_error "Building docker images failed"
exit 1
fi

docker-compose -p $PROJECT_NAME up -d
if [ ! $? -eq 0 ]; then
print_error "Starting built docker images failed"
exit 1
fi
}

cleanup () {
echo "Cleaning up"
docker-compose -p $PROJECT_NAME down
}


setup

result=`curl localhost:4050/connection`
if [ "$result" != '{"status":"NotConnected"}' ]
then
print_error "Unexpected status response: $result"
cleanup
exit 1
fi

print_success "Tests passed"
cleanup
exit 0
3 changes: 0 additions & 3 deletions docker-compose.yml
Expand Up @@ -4,7 +4,6 @@ services:
broker:
tty: true
image: nats
container_name: mysterium-broker
networks:
- default
ports:
Expand All @@ -19,7 +18,6 @@ services:
dockerfile: bin/server_docker/ubuntu/Dockerfile
args:
PACKAGE_VERSION: 0.0.1-docker
container_name: mysterium-server-ubuntu
depends_on:
- broker
cap_add:
Expand All @@ -43,7 +41,6 @@ services:
dockerfile: bin/client_docker/ubuntu/Dockerfile
args:
PACKAGE_VERSION: 0.0.1-docker
container_name: mysterium-client
depends_on:
- broker
- server-ubuntu
Expand Down

0 comments on commit 013da86

Please sign in to comment.