mirror of
https://github.com/tonarino/innernet.git
synced 2024-11-10 17:04:53 +08:00
docker-tests: add test for server expiration cleanup
This commit is contained in:
parent
fb1de8e210
commit
8f12583c8c
1 changed files with 30 additions and 2 deletions
|
@ -77,7 +77,7 @@ cmd docker exec "$PEER1_CONTAINER" innernet \
|
|||
--admin false \
|
||||
--auto-ip \
|
||||
--save-config "/app/peer2.toml" \
|
||||
--invite-expires "30d" \
|
||||
--invite-expires "30s" \
|
||||
--yes
|
||||
cmd docker cp "$PEER1_CONTAINER:/app/peer2.toml" "$tmp_dir"
|
||||
|
||||
|
@ -93,7 +93,35 @@ cmd docker cp "$tmp_dir/peer2.toml" "$PEER2_CONTAINER:/app/invite.toml"
|
|||
cmd docker start "$PEER2_CONTAINER"
|
||||
sleep 10
|
||||
|
||||
# read -p "Press enter to continue. " -n 1 -r
|
||||
info "Creating short-lived invitation for third peer."
|
||||
cmd docker exec "$PEER1_CONTAINER" innernet \
|
||||
add-peer evilcorp \
|
||||
--name "peer3" \
|
||||
--cidr "robots" \
|
||||
--admin false \
|
||||
--ip "10.66.2.100" \
|
||||
--save-config "/app/peer3.toml" \
|
||||
--invite-expires "5s" \
|
||||
--yes
|
||||
|
||||
info "waiting 15 seconds to see if the server clears out the IP address."
|
||||
sleep 15
|
||||
|
||||
info "Re-requesting invite after expiration with the same parameters."
|
||||
cmd docker exec "$PEER1_CONTAINER" innernet \
|
||||
add-peer evilcorp \
|
||||
--name "peer3" \
|
||||
--cidr "robots" \
|
||||
--admin false \
|
||||
--ip "10.66.2.100" \
|
||||
--save-config "/app/peer3_2.toml" \
|
||||
--invite-expires "30m" \
|
||||
--yes
|
||||
|
||||
info "peer2 started as $PEER2_CONTAINER"
|
||||
cmd docker cp "$tmp_dir/peer2.toml" "$PEER2_CONTAINER:/app/invite.toml"
|
||||
cmd docker start "$PEER2_CONTAINER"
|
||||
sleep 10
|
||||
|
||||
info "Checking connectivity betweeen peers."
|
||||
cmd docker exec "$PEER2_CONTAINER" ping -c3 10.66.0.1
|
||||
|
|
Loading…
Reference in a new issue