This repository was archived by the owner on Jun 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 678
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1117 from weaveworks/multi_hop_tests
Multi hop tests
- Loading branch information
Showing
4 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#! /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 --ipalloc-range="" $HOST1 | ||
weave_on $HOST3 launch-router $1 $HOST2 | ||
} | ||
|
||
start_suite "Peer discovery, multi-hop routing and gossip forwarding" | ||
|
||
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 | ||
|
||
sleep 5 # give topology gossip some time to propagate | ||
|
||
assert_raises "exec_on $HOST1 c1 $PING $C3" | ||
|
||
# this stalls if gossip forwarding doesn't work. We wait for slightly | ||
# longer than the gossip interval (30s) before giving up. | ||
assert_raises "timeout 40 cat <( start_container $HOST3 )" | ||
|
||
stop_router_on $HOST2 | ||
assert_raises "exec_on $HOST1 c1 sh -c '! $PING $C3'" | ||
|
||
end_suite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters