From 3137e4acddb0ef563816e49037fa0893fdbd08c5 Mon Sep 17 00:00:00 2001 From: Michael Bridgen Date: Fri, 27 Feb 2015 15:29:59 +0000 Subject: [PATCH] Smoke test for custom localDomain --- test/220_dns_custom_test.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 test/220_dns_custom_test.sh diff --git a/test/220_dns_custom_test.sh b/test/220_dns_custom_test.sh new file mode 100755 index 00000000..29f27dfd --- /dev/null +++ b/test/220_dns_custom_test.sh @@ -0,0 +1,25 @@ +#! /bin/bash + +. ./config.sh + +C1=10.2.56.34 +C2=10.2.54.91 + +start_suite "Resolve names in custom domain" + +run_on $HOST1 sudo $WEAVE stop || true +run_on $HOST1 sudo $WEAVE stop-dns || true +run_on $HOST1 sudo $WEAVE launch-dns 10.0.0.2/8 --localDomain foo.bar. + +docker_on $HOST1 rm -f c1 c2 || true + +run_on $HOST1 sudo $WEAVE run $C2/24 -t --name=c2 -h seetwo.foo.bar ubuntu +run_on $HOST1 sudo $WEAVE run --with-dns $C1/24 -t --name=c1 aanand/docker-dnsutils /bin/sh + +ok=$(docker -H tcp://$HOST1:2375 exec -i c1 sh -c "dig +short seetwo.foo.bar.") +assert "echo $ok" "$C2" + +ok=$(docker -H tcp://$HOST1:2375 exec -i c1 sh -c "dig +short -x $C2") +assert "echo $ok" "seetwo.foo.bar." + +end_suite