Get the proxy to re-attach the weave router if it sees it restart

This commit is contained in:
Bryan Boreham committed 2015-10-19 15:46:47 +00:00
1 parent 5ff740cddc
commit a87cc5c3b1
3 files changed
+49 -2

No files matched your search

+6 -2
View File
@@ -13,13 +13,18 @@ check_attached() {
start_suite "Proxy restart reattaches networking to containers"
weave_on $HOST1 launch
WEAVE_DOCKER_ARGS=--restart=always WEAVEPROXY_DOCKER_ARGS=--restart=always weave_on $HOST1 launch
proxy_start_container $HOST1 -e WEAVE_CIDR=$C2/24 -di --name=c2 --restart=always -h $NAME
proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C1/24 -di --name=c1 --restart=always
proxy docker_on $HOST1 restart -t=1 c2
check_attached
# Restart weave router
docker_on $HOST1 restart weave
sleep 1
check_attached
# Kill outside of Docker so Docker will restart it
run_on $HOST1 sudo kill -KILL $(docker_on $HOST1 inspect --format='{{.State.Pid}}' c2)
sleep 1
@@ -34,7 +39,6 @@ assert_raises "proxy exec_on $HOST1 c3 $CHECK_ETHWE_UP"
# Restart docker itself, using different commands for systemd- and upstart-managed.
run_on $HOST1 sh -c "command -v systemctl >/dev/null && sudo systemctl restart docker || sudo service docker restart"
sleep 1
weave_on $HOST1 launch
check_attached
end_suite