simplify dns tests
- use 'host' to lookup MX record. It's shorter - use getent everywhere else for dns lookups, instead of dig; this tests more of the o/s name resolution machinery and is generally shorter. - introduce assert_dns_record helper that performs forward and reverse - lookup introduce some vars for holding constants, so we don't have to repeat them
This commit is contained in:
1 parent
5749d19fee
commit
eebb674232
5 files changed
+25
-25
No files matched your search
@@ -4,22 +4,20 @@
|
||||
|
||||
C1=10.2.56.34
|
||||
C2=10.2.54.91
|
||||
DOMAIN=foo.bar
|
||||
NAME=seetwo.$DOMAIN
|
||||
|
||||
start_suite "Resolve names in custom domain"
|
||||
|
||||
weave_on $HOST1 stop || true
|
||||
weave_on $HOST1 stop-dns || true
|
||||
weave_on $HOST1 launch-dns 10.2.254.1/24 --domain foo.bar.
|
||||
weave_on $HOST1 launch-dns 10.2.254.1/24 --domain $DOMAIN.
|
||||
|
||||
docker_on $HOST1 rm -f c1 c2 || true
|
||||
|
||||
weave_on $HOST1 run $C2/24 -t --name=c2 -h seetwo.foo.bar ubuntu
|
||||
weave_on $HOST1 run $C2/24 -t --name=c2 -h $NAME ubuntu
|
||||
weave_on $HOST1 run --with-dns $C1/24 -t --name=c1 aanand/docker-dnsutils /bin/sh
|
||||
|
||||
ok=$(exec_on $HOST1 c1 dig +short seetwo.foo.bar.)
|
||||
assert "echo $ok" "$C2"
|
||||
|
||||
ok=$(exec_on $HOST1 c1 dig +short -x $C2)
|
||||
assert "echo $ok" "seetwo.foo.bar."
|
||||
assert_dns_record $HOST1 c1 $NAME $C2
|
||||
|
||||
end_suite
|
||||
Reference in new issue
Block a user