From 0e655a2bbdb64359637c2d0da401c57bd3ddab5f Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Tue, 26 Apr 2016 15:27:21 +0100 Subject: [PATCH] Remove plugin-connected containers before end of test, to avoid delaying later cleanup. Also use a shorter sequence to exclude the plugin when removing other containers. --- test/195_no_multicast_route_1_test.sh | 2 ++ test/800_plugin_cross_hosts_2_test.sh | 3 +++ test/810_plugin_router_restart.sh | 2 ++ test/config.sh | 4 +--- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/test/195_no_multicast_route_1_test.sh b/test/195_no_multicast_route_1_test.sh index 0b5cd457..3dcf8d21 100755 --- a/test/195_no_multicast_route_1_test.sh +++ b/test/195_no_multicast_route_1_test.sh @@ -30,4 +30,6 @@ proxy docker_on $HOST1 start c2 assert "show_multicast_route_on $HOST1 c2" "224.0.0.0/4 dev ethwe " +docker_on $HOST1 rm -f c3 + end_suite diff --git a/test/800_plugin_cross_hosts_2_test.sh b/test/800_plugin_cross_hosts_2_test.sh index 47f82d50..477c0de8 100755 --- a/test/800_plugin_cross_hosts_2_test.sh +++ b/test/800_plugin_cross_hosts_2_test.sh @@ -18,4 +18,7 @@ start_container_local_plugin $HOST2 --name=c2 --hostname=$C2_NAME --dns=$DNS_IP assert_raises "exec_on $HOST1 c1 $PING $C2_NAME" assert_raises "exec_on $HOST2 c2 $PING $C1_NAME" +docker_on $HOST1 rm -f c1 +docker_on $HOST2 rm -f c2 + end_suite diff --git a/test/810_plugin_router_restart.sh b/test/810_plugin_router_restart.sh index 68ca1a44..32e6fcc9 100755 --- a/test/810_plugin_router_restart.sh +++ b/test/810_plugin_router_restart.sh @@ -21,4 +21,6 @@ assert "weave_on $HOST1 dns-lookup $C1_NAME" "$c1ip" start_container $HOST1 --name=c2 assert_raises "container_ip $HOST1 c2 | grep -v $c1ip" +docker_on $HOST1 rm -f c1 c2 + end_suite diff --git a/test/config.sh b/test/config.sh index 52681674..02ba5630 100644 --- a/test/config.sh +++ b/test/config.sh @@ -226,9 +226,7 @@ assert_dns_ptr_record() { start_suite() { for host in $HOSTS; do [ -z "$DEBUG" ] || echo "Cleaning up on $host: removing all containers and resetting weave" - PLUGIN_ID=$(docker_on $host ps -aq --filter=name=weaveplugin) - PLUGIN_FILTER="cat" - [ -n "$PLUGIN_ID" ] && PLUGIN_FILTER="grep -v $PLUGIN_ID" + PLUGIN_FILTER=$(docker_on $host inspect -f 'grep -v {{.Id}}' weaveplugin 2>/dev/null) || PLUGIN_FILTER=cat rm_containers $host $(docker_on $host ps -aq 2>/dev/null | $PLUGIN_FILTER) weave_on $host reset 2>/dev/null done