diff --git a/circle.yml b/circle.yml index 7b23b9f1..4bc4d29b 100644 --- a/circle.yml +++ b/circle.yml @@ -41,9 +41,9 @@ test: parallel: true - cd $SRCDIR/test; ./gce.sh setup: parallel: true - - cd $SRCDIR/test; . ./gce.sh hosts; ./setup.sh: + - cd $SRCDIR/test; eval $(./gce.sh hosts); ./setup.sh: parallel: true - - cd $SRCDIR/test; . ./gce.sh hosts; export COVERAGE=true; ./run_all.sh: + - cd $SRCDIR/test; eval $(./gce.sh hosts); export COVERAGE=true; ./run_all.sh: parallel: true timeout: 300 post: diff --git a/test/210_dns_cross_hosts_test.sh b/test/210_dns_cross_hosts_test.sh index 1d936e3e..7f134654 100755 --- a/test/210_dns_cross_hosts_test.sh +++ b/test/210_dns_cross_hosts_test.sh @@ -36,6 +36,31 @@ start_container_with_dns $HOST1 --name=baz assert_dns_record $HOST1 baz foo.weave.local $FOO_IPS assert_dns_record $HOST1 baz bar.weave.local $BAR_IPS +# now stop and start the containers a bunch of times +# this tests gossip dns tombstone behaviour +for i in $(seq 5); do + for host in $HOSTS; do + proxy docker_on $host kill foo 1>/dev/null + proxy docker_on $host kill bar 1>/dev/null + done + + assert_no_dns_record $HOST1 baz foo.weave.local + assert_no_dns_record $HOST1 baz bar.weave.local + + FOO_IPS= + BAR_IPS= + for host in $HOSTS; do + proxy docker_on $host start foo 1>/dev/null + proxy docker_on $host start bar 1>/dev/null + + FOO_IPS="$FOO_IPS $(container_ip $host foo)" + BAR_IPS="$BAR_IPS $(container_ip $host bar)" + done + + assert_dns_record $HOST1 baz foo.weave.local $FOO_IPS + assert_dns_record $HOST1 baz bar.weave.local $BAR_IPS +done + # resolution for names mapped to multiple addresses weave_on $HOST2 dns-add $C2a c2 -h $NAME2 weave_on $HOST2 dns-add $C2b c2 -h $NAME2 diff --git a/test/gce.sh b/test/gce.sh index 192af733..dd1cb63b 100755 --- a/test/gce.sh +++ b/test/gce.sh @@ -5,7 +5,7 @@ # ./gce.sh destroy - tear down the VMs # ./gce.sh make_template - make a fresh VM template; update TEMPLATE_NAME first! -set -ex +set -e KEY_FILE=/tmp/gce_private_key.json SSH_KEY_FILE=$HOME/.ssh/gce_ssh_key @@ -20,7 +20,7 @@ if [ -n "$CIRCLECI" ]; then fi # Setup authentication -gcloud auth activate-service-account --key-file $KEY_FILE +gcloud auth activate-service-account --key-file $KEY_FILE 1>/dev/null gcloud config set project $PROJECT function vm_names { @@ -120,9 +120,9 @@ function hosts { hosts="$hostname $hosts" args="--add-host=$hostname:$(internal_ip $name) $args" done - export SSH=ssh - export HOSTS="$hosts" - export WEAVE_DOCKER_ARGS="$args" + echo export SSH=ssh + echo export HOSTS=\"$hosts\" + echo export WEAVE_DOCKER_ARGS=\"$args\" } case "$1" in