use weavedns search-domain by default

iff no hostname/dns-search specified
This commit is contained in:
Paul Bellamy committed 2015-06-16 15:13:19 +01:00
1 parent 8b5d0e3fbd
commit 2c3baa9119
4 files changed
+70 -12

No files matched your search

+9 -2
View File
@@ -5,6 +5,7 @@
C1=10.2.0.78
C2=10.2.0.34
C3=10.2.0.57
C4=10.2.0.99
DOMAIN=weave.local
NAME=seeone.$DOMAIN
@@ -15,8 +16,14 @@ weave_on $HOST1 launch-dns 10.2.254.1/24 $WEAVEDNS_ARGS
start_container $HOST1 $C1/24 --name=c1 -h $NAME
start_container_with_dns $HOST1 $C2/24 --name=c2 -h seetwo.$DOMAIN
start_container_with_dns $HOST1 $C3/24 --name=c3 --dns-search=$DOMAIN
container=$(start_container_with_dns $HOST1 $C4/24)
assert "exec_on $HOST1 c2 getent hosts seeone | tr -s ' '" "$C1 $NAME"
assert "exec_on $HOST1 c3 getent hosts seeone | tr -s ' '" "$C1 $NAME"
check() {
assert "exec_on $HOST1 $1 getent hosts seeone | tr -s ' '" "$C1 $NAME"
}
check c2
check c3
check "$container"
end_suite
+34
View File
@@ -0,0 +1,34 @@
#! /bin/bash
. ./config.sh
C1=10.2.0.78
C2=10.2.0.34
C3=10.2.0.57
C4=10.2.0.99
DOMAIN=weave.local
NAME=seeone.$DOMAIN
start_container() {
proxy docker_on $HOST1 run "$@" -dt $DNS_IMAGE /bin/sh
}
start_suite "Resolve unqualified names"
weave_on $HOST1 launch-dns 10.2.254.1/24
weave_on $HOST1 launch-proxy
start_container -e WEAVE_CIDR=$C1/24 --name=c1 -h $NAME
start_container -e WEAVE_CIDR=$C2/24 --name=c2 -h seetwo.$DOMAIN
start_container -e WEAVE_CIDR=$C3/24 --name=c3 --dns-search=$DOMAIN
container=$(start_container -e WEAVE_CIDR=$C4/24)
check() {
assert "proxy exec_on $HOST1 $1 getent hosts seeone | tr -s ' '" "$C1 $NAME"
}
check c2
check c3
check "$container"
end_suite