Files
weave/test/225_dns_subdomain_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

26 lines
810 B
Bash
Executable File

#! /bin/bash
. "$(dirname "$0")/config.sh"
C1=10.2.54.34
C2=10.2.54.91
C3=10.2.54.92
DOMAIN=foo.bar
SUBDOMAIN1=sub1.$DOMAIN
SUBDOMAIN2=sub2.$DOMAIN
start_suite "Resolve names in custom domain with subdomains"
weave_on $HOST1 launch --log-level=debug --dns-domain $DOMAIN.
proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C1/24 --name=c1 -h foo.$SUBDOMAIN1
proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C2/24 --name=c2 -h foo.$SUBDOMAIN2
proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C3/24 --name=c3 -h tre.$SUBDOMAIN1 --dns-search=$SUBDOMAIN2
assert_dns_record $HOST1 c1 foo.$SUBDOMAIN2 $C2
assert_dns_a_record $HOST1 c3 foo $C2 foo.$SUBDOMAIN2
assert_dns_record $HOST1 c2 foo.$SUBDOMAIN1 $C1
assert_dns_a_record $HOST1 c1 tre $C3 tre.$SUBDOMAIN1
end_suite