From 9bd695a8162ff6cb4652acdc2cc53c6081ac0ccf Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Thu, 19 Mar 2015 17:22:20 +0000 Subject: [PATCH] restore workingness of smoketests sans vagrant Fixes #456. --- test/README.md | 4 ++-- test/config.sh | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/test/README.md b/test/README.md index 99e91bb8..9d7cbdc7 100644 --- a/test/README.md +++ b/test/README.md @@ -33,8 +33,8 @@ to run everything named `*_test.sh`. By default the tests assume the Vagrant VMs are used. -To use other VMs, set the environment variables HOST1 and -HOST2 to the IP addresses of two docker hosts, and set the +To use other VMs, set the environment variable HOSTS to the +space-separated list of IP addresses of the docker hosts, and set the environment variable SSH to a command that will log into either (which may just be `ssh`). diff --git a/test/config.sh b/test/config.sh index 7acba9ec..9bd15125 100644 --- a/test/config.sh +++ b/test/config.sh @@ -7,15 +7,16 @@ N_MACHINES=${N_MACHINES:-2} IP_PREFIX=${IP_PREFIX:-192.168.48} IP_SUFFIX_BASE=${IP_SUFFIX_BASE:-10} -HOSTS= -for i in $(seq 1 $N_MACHINES); do - IP="${IP_PREFIX}.$((${IP_SUFFIX_BASE}+$i))" - HOSTS="$HOSTS $IP" -done +if [ -z "$HOSTS" ] ; then + for i in $(seq 1 $N_MACHINES); do + IP="${IP_PREFIX}.$((${IP_SUFFIX_BASE}+$i))" + HOSTS="$HOSTS $IP" + done +fi # these are used by the tests -HOST1="${IP_PREFIX}.$((${IP_SUFFIX_BASE}+1))" -HOST2="${IP_PREFIX}.$((${IP_SUFFIX_BASE}+2))" +HOST1=$(echo $HOSTS | cut -f 1 -d ' ') +HOST2=$(echo $HOSTS | cut -f 2 -d ' ') . ./assert.sh