diff --git a/test/200_dns_test.sh b/test/200_dns_test.sh index 49fa215a77..870f735856 100755 --- a/test/200_dns_test.sh +++ b/test/200_dns_test.sh @@ -5,15 +5,17 @@ C1=10.2.0.78 C2=10.2.0.34 NAME=seetwo.weave.local +DNS1=10.2.254.1 start_suite "Resolve names on a single host" -launch_dns_on $HOST1 10.2.254.1/24 +launch_dns_on $HOST1 $DNS1/24 start_container $HOST1 $C2/24 --name=c2 -h $NAME start_container_with_dns $HOST1 $C1/24 --name=c1 assert_dns_record $HOST1 c1 $NAME $C2 +assert_dns_record $HOST1 c1 "dns.weave.local" $DNS1 assert_raises "exec_on $HOST1 c1 dig MX $NAME | grep -q 'status: NXDOMAIN'" diff --git a/test/210_dns_multicast_test.sh b/test/210_dns_multicast_test.sh index fb47f33405..3ca936bd59 100755 --- a/test/210_dns_multicast_test.sh +++ b/test/210_dns_multicast_test.sh @@ -9,6 +9,8 @@ C2b=10.2.3.36 UNIVERSE=10.2.4.0/24 NAME2=seetwo.weave.local NAME4=seefour.weave.local +DNS1=10.2.254.1 +DNS2=10.2.254.2 start() { launch_dns_on $HOST1 $1 >/dev/null @@ -37,12 +39,12 @@ start_container_with_dns $HOST1 $C1/24 --name=c1 # resolution when DNS is launched with various ways of obtaining an IP # NB: this also tests re-population on DNS restart -check ip:10.2.254.1/24 ip:10.2.254.2/24 +check ip:$DNS1/24 ip:$DNS2/24 check net:10.2.4.128/25 net:10.2.4.128/25 check net:default net:default check -start 10.2.254.1/24 10.2.254.2/24 +start $DNS1/24 $DNS2/24 # resolution for names mapped to multiple addresses weave_on $HOST2 dns-add $C2a c2 -h $NAME2 @@ -56,6 +58,11 @@ C4=$(container_ip $HOST2 c4) assert_dns_record $HOST1 c3 $NAME4 $C4 assert_raises "exec_on $HOST1 c3 getent hosts 8.8.8.8 | grep google" +# check that dns.weave.local returns the local WeaveDNS (and not remote instances) +start_container_with_dns $HOST2 --name=c5 +assert_dns_record $HOST1 c1 "dns.weave.local" $DNS1 +assert_dns_record $HOST2 c5 "dns.weave.local" $DNS2 + stop end_suite