This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 663
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 #2305 from /issues/2186-peer-list-persistence
Peer list persistence; Fixes #2186.
- Loading branch information
Showing
8 changed files
with
168 additions
and
172 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
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
This file was deleted.
Oops, something went wrong.
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,36 @@ | ||
#! /bin/bash | ||
|
||
. ./config.sh | ||
|
||
|
||
assert_targets() { | ||
HOST=$1 | ||
shift | ||
EXPECTED=$(for TARGET in $@; do echo $TARGET; done | sort) | ||
assert "weave_on $HOST report | jq -r '.Router.Targets[] | tostring' | sort" "$EXPECTED" | ||
} | ||
|
||
start_suite "Check Docker restart uses persisted peer list" | ||
|
||
# Launch router and modify initial peer list | ||
weave_on $HOST1 launch $HOST1 $HOST2 | ||
weave_on $HOST1 forget $HOST1 | ||
weave_on $HOST1 connect $HOST3 | ||
|
||
# Ensure modified peer list is still in effect after restart | ||
check_restart $HOST1 weave | ||
assert_targets $HOST1 $HOST2 $HOST3 | ||
|
||
# Ensure persisted peer changes are still in effect after --resume | ||
weave_on $HOST1 stop | ||
weave_on $HOST1 launch --resume | ||
assert_targets $HOST1 $HOST2 $HOST3 | ||
|
||
# Ensure persisted peer changes are ignored after stop and subsequent restart | ||
weave_on $HOST1 stop | ||
weave_on $HOST1 launch $HOST1 $HOST2 | ||
assert_targets $HOST1 $HOST1 $HOST2 | ||
check_restart $HOST1 weave | ||
assert_targets $HOST1 $HOST1 $HOST2 | ||
|
||
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
Oops, something went wrong.