Files
weave/test/280_with_or_without_dns_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

42 lines
922 B
Bash
Executable File

#! /bin/bash
. "$(dirname "$0")/config.sh"
IP=10.2.0.34
TARGET=seetwo.weave.local
TARGET_IP=10.2.0.78
STATIC=static.name
STATIC_IP=10.9.9.9
ATTACH_ARGS="--rewrite-hosts --add-host=$STATIC:$STATIC_IP"
check_dns() {
chk=$1
shift
container=$(start_container_with_dns $HOST1 "$@" $IP/24)
$chk $HOST1 $container $TARGET
# --add-host adds to /etc/hosts so should work even when DNS is off.
assert_dns_record $HOST1 $container $STATIC $STATIC_IP
rm_containers $HOST1 $container
}
start_suite "With or without DNS test"
# Assert behaviour without weaveDNS running
weave_on $HOST1 launch --no-dns
start_container $HOST1 $TARGET_IP/24 --name c2 -h $TARGET
check_dns assert_no_dns_record --without-dns
check_dns assert_no_dns_record
weave_on $HOST1 stop
# Assert behaviour with weaveDNS
weave_on $HOST1 launch
check_dns assert_no_dns_record --without-dns
check_dns assert_dns_record
end_suite