Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple integration test for client with CLI #178

Merged
merged 5 commits into from
Feb 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/client_docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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