Add tests for resolving names across hosts
It's more precise to use dig rather than ping. The stock ubuntu image doesn't come with dig (in package dnsutils), but luckily Aanand made an image which is exactly ubuntu+dnsutils.
This commit is contained in:
1 parent
937d9c3ef8
commit
437b9d0ba2
2 files changed
+38
-4
No files matched your search
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#! /bin/bash
|
||||
|
||||
. ./config.sh
|
||||
|
||||
C1=10.2.3.78
|
||||
C2=10.2.3.34
|
||||
|
||||
start_suite "Resolve names across hosts"
|
||||
|
||||
for host in $HOST1 $HOST2; do
|
||||
run_on $host sudo $WEAVE stop || true
|
||||
run_on $host sudo $WEAVE stop-dns || true
|
||||
docker_on $host rm -f c1 c2 || true
|
||||
done
|
||||
|
||||
run_on $HOST1 sudo $WEAVE launch
|
||||
run_on $HOST2 sudo $WEAVE launch $HOST1
|
||||
|
||||
run_on $HOST1 sudo $WEAVE launch-dns 10.0.0.2/8
|
||||
run_on $HOST2 sudo $WEAVE launch-dns 10.0.0.3/8
|
||||
|
||||
run_on $HOST2 sudo $WEAVE run $C2/24 -t --name=c2 -h seetwo.weave.local ubuntu
|
||||
run_on $HOST1 sudo $WEAVE run --with-dns $C1/24 --name=c1 -t aanand/docker-dnsutils /bin/sh
|
||||
|
||||
ok=$(docker -H tcp://$HOST1:2375 exec -i c1 dig +short seetwo.weave.local)
|
||||
assert "echo $ok" "$C2"
|
||||
|
||||
ok=$(docker -H tcp://$HOST1:2375 exec -i c1 dig +short -x $C2)
|
||||
assert "echo $ok" "seetwo.weave.local."
|
||||
|
||||
end_suite
|
||||
Reference in new issue
Block a user