Merge pull request #1166 from weaveworks/dns-tests
Make 210_dns_cross_hosts_test.sh excercise gossip dns tombstones.
This commit is contained in:
commit
70110e483c
3 files changed
+32
-7
No files matched your search
+2
-2
@@ -41,9 +41,9 @@ test:
|
|||||||
parallel: true
|
parallel: true
|
||||||
- cd $SRCDIR/test; ./gce.sh setup:
|
- cd $SRCDIR/test; ./gce.sh setup:
|
||||||
parallel: true
|
parallel: true
|
||||||
- cd $SRCDIR/test; . ./gce.sh hosts; ./setup.sh:
|
- cd $SRCDIR/test; eval $(./gce.sh hosts); ./setup.sh:
|
||||||
parallel: true
|
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
|
parallel: true
|
||||||
timeout: 300
|
timeout: 300
|
||||||
post:
|
post:
|
||||||
|
|||||||
@@ -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 foo.weave.local $FOO_IPS
|
||||||
assert_dns_record $HOST1 baz bar.weave.local $BAR_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
|
# resolution for names mapped to multiple addresses
|
||||||
weave_on $HOST2 dns-add $C2a c2 -h $NAME2
|
weave_on $HOST2 dns-add $C2a c2 -h $NAME2
|
||||||
weave_on $HOST2 dns-add $C2b c2 -h $NAME2
|
weave_on $HOST2 dns-add $C2b c2 -h $NAME2
|
||||||
|
|||||||
+5
-5
@@ -5,7 +5,7 @@
|
|||||||
# ./gce.sh destroy - tear down the VMs
|
# ./gce.sh destroy - tear down the VMs
|
||||||
# ./gce.sh make_template - make a fresh VM template; update TEMPLATE_NAME first!
|
# ./gce.sh make_template - make a fresh VM template; update TEMPLATE_NAME first!
|
||||||
|
|
||||||
set -ex
|
set -e
|
||||||
|
|
||||||
KEY_FILE=/tmp/gce_private_key.json
|
KEY_FILE=/tmp/gce_private_key.json
|
||||||
SSH_KEY_FILE=$HOME/.ssh/gce_ssh_key
|
SSH_KEY_FILE=$HOME/.ssh/gce_ssh_key
|
||||||
@@ -20,7 +20,7 @@ if [ -n "$CIRCLECI" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Setup authentication
|
# 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
|
gcloud config set project $PROJECT
|
||||||
|
|
||||||
function vm_names {
|
function vm_names {
|
||||||
@@ -120,9 +120,9 @@ function hosts {
|
|||||||
hosts="$hostname $hosts"
|
hosts="$hostname $hosts"
|
||||||
args="--add-host=$hostname:$(internal_ip $name) $args"
|
args="--add-host=$hostname:$(internal_ip $name) $args"
|
||||||
done
|
done
|
||||||
export SSH=ssh
|
echo export SSH=ssh
|
||||||
export HOSTS="$hosts"
|
echo export HOSTS=\"$hosts\"
|
||||||
export WEAVE_DOCKER_ARGS="$args"
|
echo export WEAVE_DOCKER_ARGS=\"$args\"
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
|||||||
Reference in new issue
Block a user