Merge branch '1.0'
Conflicts: test/640_proxy_restart_reattaches_test.sh
This commit is contained in:
commit
fa2aa1f791
6 files changed
+30
-32
No files matched your search
@@ -8,8 +8,8 @@ C1_NAME=c1.weave.local
|
|||||||
C2_NAME=seetwo.weave.local
|
C2_NAME=seetwo.weave.local
|
||||||
|
|
||||||
boot_containers() {
|
boot_containers() {
|
||||||
proxy docker_on $HOST1 run -e WEAVE_CIDR=$C2/24 -dt --name=c2 -h $C2_NAME $DNS_IMAGE /bin/sh
|
proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C2/24 -dt --name=c2 -h $C2_NAME
|
||||||
proxy docker_on $HOST1 run -e WEAVE_CIDR=$C1/24 -dt --name=c1 $DNS_IMAGE /bin/sh
|
proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C1/24 -dt --name=c1
|
||||||
}
|
}
|
||||||
|
|
||||||
kill_containers() {
|
kill_containers() {
|
||||||
|
|||||||
@@ -9,18 +9,14 @@ C4=10.2.0.99
|
|||||||
DOMAIN=weave.local
|
DOMAIN=weave.local
|
||||||
NAME=seeone.$DOMAIN
|
NAME=seeone.$DOMAIN
|
||||||
|
|
||||||
start_container() {
|
|
||||||
proxy docker_on $HOST1 run "$@" -dt $DNS_IMAGE /bin/sh
|
|
||||||
}
|
|
||||||
|
|
||||||
start_suite "Resolve unqualified names"
|
start_suite "Resolve unqualified names"
|
||||||
|
|
||||||
weave_on $HOST1 launch
|
weave_on $HOST1 launch
|
||||||
|
|
||||||
start_container -e WEAVE_CIDR=$C1/24 --name=c1 -h $NAME
|
proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C1/24 --name=c1 -h $NAME
|
||||||
start_container -e WEAVE_CIDR=$C2/24 --name=c2 -h seetwo.$DOMAIN
|
proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C2/24 --name=c2 -h seetwo.$DOMAIN
|
||||||
start_container -e WEAVE_CIDR=$C3/24 --name=c3 --dns-search=$DOMAIN
|
proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C3/24 --name=c3 --dns-search=$DOMAIN
|
||||||
container=$(start_container -e WEAVE_CIDR=$C4/24)
|
container=$(proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C4/24)
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
assert "proxy exec_on $HOST1 $1 getent hosts seeone | tr -s ' '" "$C1 $NAME"
|
assert "proxy exec_on $HOST1 $1 getent hosts seeone | tr -s ' '" "$C1 $NAME"
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ NAME=seetwo.weave.local
|
|||||||
start_suite "Proxy restart reattaches networking to containers"
|
start_suite "Proxy restart reattaches networking to containers"
|
||||||
|
|
||||||
weave_on $HOST1 launch
|
weave_on $HOST1 launch
|
||||||
proxy docker_on $HOST1 run -e WEAVE_CIDR=$C2/24 -dt --name=c2 -h $NAME $SMALL_IMAGE /bin/sh
|
proxy_start_container $HOST1 -e WEAVE_CIDR=$C2/24 -dt --name=c2 -h $NAME
|
||||||
proxy docker_on $HOST1 run -e WEAVE_CIDR=$C1/24 -dt --name=c1 $DNS_IMAGE /bin/sh
|
proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C1/24 -dt --name=c1
|
||||||
|
|
||||||
proxy docker_on $HOST1 restart c2
|
proxy docker_on $HOST1 restart c2
|
||||||
assert_raises "proxy exec_on $HOST1 c2 $CHECK_ETHWE_UP"
|
assert_raises "proxy exec_on $HOST1 c2 $CHECK_ETHWE_UP"
|
||||||
|
|||||||
@@ -4,12 +4,6 @@
|
|||||||
|
|
||||||
UNIVERSE=10.2.2.0/24
|
UNIVERSE=10.2.2.0/24
|
||||||
|
|
||||||
start() {
|
|
||||||
host=$1
|
|
||||||
shift
|
|
||||||
proxy docker_on "$host" run "$@" -dt $SMALL_IMAGE /bin/sh
|
|
||||||
}
|
|
||||||
|
|
||||||
assert_no_ethwe() {
|
assert_no_ethwe() {
|
||||||
assert_raises "container_ip $1 $2" 1
|
assert_raises "container_ip $1 $2" 1
|
||||||
assert_raises "proxy exec_on $1 $2 ip link show | grep -v ethwe"
|
assert_raises "proxy exec_on $1 $2 ip link show | grep -v ethwe"
|
||||||
@@ -22,13 +16,13 @@ weave_on $HOST2 launch-router --ipalloc-range $UNIVERSE $HOST1
|
|||||||
weave_on $HOST1 launch-proxy
|
weave_on $HOST1 launch-proxy
|
||||||
weave_on $HOST2 launch-proxy --no-default-ipalloc
|
weave_on $HOST2 launch-proxy --no-default-ipalloc
|
||||||
|
|
||||||
start $HOST1 --name=auto
|
proxy_start_container $HOST1 --name=auto
|
||||||
start $HOST1 --name=none -e WEAVE_CIDR=none
|
proxy_start_container $HOST1 --name=none -e WEAVE_CIDR=none
|
||||||
start $HOST2 --name=zero -e WEAVE_CIDR=
|
proxy_start_container $HOST2 --name=zero -e WEAVE_CIDR=
|
||||||
start $HOST2 --name=no-default
|
proxy_start_container $HOST2 --name=no-default
|
||||||
start $HOST1 --name=bridge --net=bridge
|
proxy_start_container $HOST1 --name=bridge --net=bridge
|
||||||
start $HOST1 --name=host --net=host
|
proxy_start_container $HOST1 --name=host --net=host
|
||||||
start $HOST1 --name=other --net=container:auto
|
proxy_start_container $HOST1 --name=other --net=container:auto
|
||||||
|
|
||||||
AUTO=$(container_ip $HOST1 auto)
|
AUTO=$(container_ip $HOST1 auto)
|
||||||
ZERO=$(container_ip $HOST2 zero)
|
ZERO=$(container_ip $HOST2 zero)
|
||||||
|
|||||||
@@ -12,18 +12,14 @@ NAME2=seetwo.weave.local
|
|||||||
CNAME3=doesnotmatchpattern
|
CNAME3=doesnotmatchpattern
|
||||||
NAME3=doesnotmatchpattern.weave.local
|
NAME3=doesnotmatchpattern.weave.local
|
||||||
|
|
||||||
start_container() {
|
|
||||||
proxy docker_on $HOST1 run "$@" -dt $DNS_IMAGE /bin/sh
|
|
||||||
}
|
|
||||||
|
|
||||||
start_suite "Hostname derivation through container name substitutions"
|
start_suite "Hostname derivation through container name substitutions"
|
||||||
|
|
||||||
weave_on $HOST1 launch-router
|
weave_on $HOST1 launch-router
|
||||||
weave_on $HOST1 launch-proxy --hostname-match '^[^-]+-(?P<appname>[^-]*)-[^-]+$' --hostname-replacement '$appname'
|
weave_on $HOST1 launch-proxy --hostname-match '^[^-]+-(?P<appname>[^-]*)-[^-]+$' --hostname-replacement '$appname'
|
||||||
|
|
||||||
start_container -e WEAVE_CIDR=$C1/24 --name=$CNAME1
|
proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C1/24 --name=$CNAME1
|
||||||
start_container -e WEAVE_CIDR=$C2/24 --name=$CNAME2
|
proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C2/24 --name=$CNAME2
|
||||||
start_container -e WEAVE_CIDR=$C3/24 --name=$CNAME3
|
proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C3/24 --name=$CNAME3
|
||||||
|
|
||||||
assert_dns_a_record $HOST1 $CNAME1 $NAME2 $C2
|
assert_dns_a_record $HOST1 $CNAME1 $NAME2 $C2
|
||||||
assert_dns_a_record $HOST1 $CNAME2 $NAME3 $C3
|
assert_dns_a_record $HOST1 $CNAME2 $NAME3 $C3
|
||||||
|
|||||||
@@ -143,6 +143,18 @@ start_container_with_dns() {
|
|||||||
weave_on $host run --with-dns "$@" -t $DNS_IMAGE /bin/sh
|
weave_on $host run --with-dns "$@" -t $DNS_IMAGE /bin/sh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proxy_start_container() {
|
||||||
|
host=$1
|
||||||
|
shift 1
|
||||||
|
proxy docker_on $host run "$@" -dt $SMALL_IMAGE /bin/sh
|
||||||
|
}
|
||||||
|
|
||||||
|
proxy_start_container_with_dns() {
|
||||||
|
host=$1
|
||||||
|
shift 1
|
||||||
|
proxy docker_on $host run "$@" -dt $DNS_IMAGE /bin/sh
|
||||||
|
}
|
||||||
|
|
||||||
rm_containers() {
|
rm_containers() {
|
||||||
host=$1
|
host=$1
|
||||||
shift
|
shift
|
||||||
|
|||||||
Reference in new issue
Block a user