Files
weave/test/230_dns_unqualified_test.sh
Bryan Boreham 9ffd0e3450 Fix up tests for DNS changes
Now that `weave dns-args` doesn't parse any flags we need to
call it or not call it, which `start_container` will do for us.

Also add back the part of the test where we run weaver with and
without DNS, which had become lost in 8b061fd555

Also change a couple of tests to use proxy to start containers,
again to avoid needing `dns-args` to parse flags.
2020-07-31 11:59:20 +00:00

30 lines
877 B
Bash
Executable File

#! /bin/bash
. "$(dirname "$0")/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_suite "Resolve unqualified names"
weave_on $HOST1 launch
proxy_start_container $HOST1 -e WEAVE_CIDR=$C1/24 --name=c1 -h $NAME
proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C2/24 --name=c2 -h seetwo.$DOMAIN
proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C3/24 --name=c3 --dns-search=$DOMAIN
container=$(start_container_with_dns $HOST1 $C4/24)
assert_dns_a_record $HOST1 c2 seeone $C1 $NAME
assert_dns_a_record $HOST1 c3 seeone $C1 $NAME
assert_dns_a_record $HOST1 "$container" seeone $C1 $NAME
# check that unqualified names are automatically qualified for broken resolvers
weave_on $HOST1 dns-add $C1 c1 -h mysql.weave.local
assert_dns_a_record $HOST1 c1 mysql $C1
end_suite