diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/100_configs.test | 73 | ||||
| -rwxr-xr-x[-rw-r--r--] | tests/200_deploy.test | 0 | ||||
| -rwxr-xr-x | tests/get-unit-info | 46 | ||||
| -rw-r--r-- | tests/tests.yaml | 1 |
4 files changed, 0 insertions, 120 deletions
diff --git a/tests/100_configs.test b/tests/100_configs.test deleted file mode 100644 index c3aa820..0000000 --- a/tests/100_configs.test +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh - -set -e - -teardown() { - juju destroy-service mongodb -} -trap teardown EXIT - -juju deploy cs:trusty/mongodb -juju expose mongodb - -for try in `seq 1 600` ; do - host=`juju status | tests/get-unit-info mongodb public-address` - - if [ -z "$host" ] ; then - sleep 10 - else - break - fi -done - -if [ -z "$host" ] ; then - echo FAIL: host timed out - exit 1 -fi - -assert_unit_ready() { - for try in `seq 1 600` ; do - status=`juju status | tests/get-unit-info mongodb agent-state` - if [ "$status" != "started" ] ; then - sleep 10 - else - echo "found status as $status" - break - fi - done - - if [ -z "$status" ] ; then - echo FAIL: status timed out - exit 1 - fi -} - -assert_is_listening() { - local port=$1 - tries=$2 - listening="" - for try in `seq 1 $tries` ; do - if ! nc $host $port < /dev/null ; then - continue - fi - listening="27017" - break - done - - if [ -z "$listening" ] ; then - echo "FAIL: not listening on port $port after $tries retries" - return 1 - else - echo "PASS: listening on port $port" - return 0 - fi -} - -assert_unit_ready - -assert_is_listening 27017 10 - -juju set mongodb port=55555 -assert_is_listening 55555 200000 -echo PASS: config changes tests passed. -exit 0 diff --git a/tests/200_deploy.test b/tests/200_deploy.test index e607587..e607587 100644..100755 --- a/tests/200_deploy.test +++ b/tests/200_deploy.test diff --git a/tests/get-unit-info b/tests/get-unit-info deleted file mode 100755 index f5ef103..0000000 --- a/tests/get-unit-info +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/python -# machines: -# 0: {dns-name: ec2-50-17-84-127.compute-1.amazonaws.com, instance-id: i-8c5c3fec} -# 1: {dns-name: ec2-184-73-102-113.compute-1.amazonaws.com, instance-id: i-14a2c174} -# 2: {dns-name: ec2-75-101-184-93.compute-1.amazonaws.com, instance-id: i-e0a2c180} -# services: -# mysql: -# charm: local:mysql-11 -# relations: {db: wordpress} -# units: -# mysql/0: -# machine: 2 -# relations: -# db: {state: up} -# state: started -# wordpress: -# charm: local:wordpress-31 -# exposed: true -# relations: {db: mysql} -# units: -# wordpress/0: -# machine: 1 -# open-ports: [] -# relations: {} -# state: null - -import yaml -import sys -from subprocess import Popen, PIPE - - -def main(): - d = yaml.safe_load(Popen(['juju','status'],stdout=PIPE).stdout) - srv = d.get("services", {}).get(sys.argv[1]) - if srv is None: - return - units = srv.get("units", {}) - if units is None: - return - item = units.items()[0][1].get(sys.argv[2]) - if item is None: - return - print item - -if __name__ == "__main__": - main() diff --git a/tests/tests.yaml b/tests/tests.yaml deleted file mode 100644 index 193e5ac..0000000 --- a/tests/tests.yaml +++ /dev/null @@ -1 +0,0 @@ -tests: "[0-9]*" |
