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:
Matthias Radestock committed 2015-04-22 19:38:04 +01:00
1 parent 5749d19fee
commit eebb674232
5 files changed
+25 -25

No files matched your search

+4 -4
View File
@@ -10,10 +10,10 @@ docker_on $HOST1 rm -f c1 || true
weave_on $HOST1 run --with-dns 10.2.1.5/24 --name=c1 -t aanand/docker-dnsutils /bin/sh
ok=$(exec_on $HOST1 c1 dig +short -t MX weave.works)
assert "test -n \"$ok\" && echo pass" "pass"
ok=$(exec_on $HOST1 c1 host -t mx weave.works)
assert_raises "echo $ok | grep google"
ok=$(exec_on $HOST1 c1 dig +short -x 8.8.8.8)
assert "test -n \"$ok\" && echo pass" "pass"
ok=$(exec_on $HOST1 c1 getent hosts 8.8.8.8)
assert_raises "echo $ok | grep google"
end_suite