From 914c88454dbb63f6c6b0941bc946a4784a1d4f31 Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Tue, 25 Aug 2015 16:53:21 +0000 Subject: [PATCH] Review feedback --- test/265_dns_reverse_test.sh | 9 +++++++-- test/config.sh | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/test/265_dns_reverse_test.sh b/test/265_dns_reverse_test.sh index 5a9e94fe..0f7c8804 100755 --- a/test/265_dns_reverse_test.sh +++ b/test/265_dns_reverse_test.sh @@ -9,9 +9,14 @@ start_suite "Reverse DNS test" weave_on $HOST1 launch start_container_with_dns $HOST1 --name=c1 -for name in bar bar black sheep have you any wool; do +# We try names in alphabetical order; this is because the +# nameserver keeps entries sorted by hostname then address, +# so by starting with acontainer then trying bcontainer, +# we're guaranteed to have to ignore a tombstone to get the +# right result. +for name in acontainer bcontainer ccontainer; do start_container $HOST1 $IP/24 --name=$name - assert "exec_on $HOST1 c1 dig +short -x $IP" $name.weave.local. + assert_dns_record $HOST1 c1 $name.weave.local $IP rm_containers $HOST1 $name done diff --git a/test/config.sh b/test/config.sh index 0189e62f..1ab62c3d 100644 --- a/test/config.sh +++ b/test/config.sh @@ -167,9 +167,9 @@ container_ip() { # assert_dns_record [ ...] assert_dns_record() { - host=$1 - container=$2 - name=$3 + local host=$1 + local container=$2 + local name=$3 shift 3 exp_ips_regex=$(echo "$@" | sed -e 's/ /\\\|/g')