From 2a0bc91f86f8d5485a3487f16902f80ef547f6fc Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Sat, 11 Jul 2015 12:33:25 +0100 Subject: [PATCH] add test for peer discovery and multi-hop routing --- test/120_discovery_test.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 test/120_discovery_test.sh diff --git a/test/120_discovery_test.sh b/test/120_discovery_test.sh new file mode 100755 index 00000000..2d6e313f --- /dev/null +++ b/test/120_discovery_test.sh @@ -0,0 +1,34 @@ +#! /bin/bash + +. ./config.sh + +C1=10.2.1.41 +C3=10.2.1.71 + +launch_all() { + weave_on $HOST1 launch-router $1 + weave_on $HOST2 launch-router $1 $HOST1 + weave_on $HOST3 launch-router $1 $HOST2 +} + +start_suite "Peer discovery and multi-hop routing" + +launch_all + +start_container $HOST1 $C1/24 --name=c1 +start_container $HOST3 $C3/24 --name=c3 + +assert_raises "exec_on $HOST1 c1 $PING $C3" +stop_router_on $HOST2 +assert_raises "exec_on $HOST1 c1 $PING $C3" + +stop_router_on $HOST1 +stop_router_on $HOST3 + +launch_all --no-discovery + +assert_raises "exec_on $HOST1 c1 $PING $C3" +stop_router_on $HOST2 +assert_raises "exec_on $HOST1 c1 sh -c '! $PING $C3'" + +end_suite