diff --git a/test/810_plugin_router_restart.sh b/test/810_plugin_router_restart.sh new file mode 100755 index 00000000..68ca1a44 --- /dev/null +++ b/test/810_plugin_router_restart.sh @@ -0,0 +1,24 @@ +#! /bin/bash + +. ./config.sh + +C1_NAME=c1.weave.local + +start_suite "Recovery of container details on router restart (via 'local' plugin)" + +weave_on $HOST1 launch +start_container_local_plugin $HOST1 --name=c1 --hostname=$C1_NAME +c1ip=$(container_ip $HOST1 c1) + +weave_on $HOST1 stop-router +weave_on $HOST1 launch-router + +assert "container_ip $HOST1 c1" "$c1ip" +assert "weave_on $HOST1 dns-lookup $C1_NAME" "$c1ip" + +# check that c1 IP has been reclaimed and doesn't get assigned to a +# fresh container +start_container $HOST1 --name=c2 +assert_raises "container_ip $HOST1 c2 | grep -v $c1ip" + +end_suite