From 07ea8a2613d294fd2468416ab3a8f3488ab4a479 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Sun, 20 Mar 2016 07:16:01 +0000 Subject: [PATCH] add 'rmpeer' test --- test/335_rmpeer_3_test.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 test/335_rmpeer_3_test.sh diff --git a/test/335_rmpeer_3_test.sh b/test/335_rmpeer_3_test.sh new file mode 100755 index 00000000..bcd7adbc --- /dev/null +++ b/test/335_rmpeer_3_test.sh @@ -0,0 +1,26 @@ +#! /bin/bash + +. ./config.sh + +start_suite "rmpeer reclaims IP addresses of lost peers" + +# launch three peers, with all space belonging to the first +weave_on $HOST1 launch +PEER1=$(weave_on $HOST1 report -f '{{.Router.Name}}') +start_container $HOST1 +weave_on $HOST2 launch $HOST1 +weave_on $HOST2 consense +weave_on $HOST3 launch $HOST1 +weave_on $HOST3 consense + +# nuke 1st peer +docker_on $HOST1 kill weave + +# transfer its space to the 2nd +weave_on $HOST2 rmpeer $PEER1 +assert_raises "timeout 5 cat <( start_container $HOST2 )" + +# ensure this is communicated promptly to the 3rd +assert_raises "timeout 5 cat <( start_container $HOST3 )" + +end_suite