Skip to content

Commit

Permalink
Smoke tests
Browse files Browse the repository at this point in the history
  • Loading branch information
inercia committed Jul 7, 2015
1 parent 1da5d97 commit 9a6e773
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion test/200_dns_test.sh
Expand Up @@ -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'"

Expand Down
11 changes: 9 additions & 2 deletions test/210_dns_multicast_test.sh
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit 9a6e773

Please sign in to comment.