Files
weave/test/380_ipam_seed_2_test.sh
Bryan Boreham 4da2501d7a Add sleeps in tests for topology gossip to propagate
The new weaveworks/mesh version defers topology updates by up to 1
second, so we can't expect to connect two nodes and immediately ping
between them.
2019-10-15 09:01:00 +00:00

34 lines
899 B
Bash
Executable File

#! /bin/bash
. "$(dirname "$0")/config.sh"
start_suite "Specify initial IPAM seed"
# Launch two disconnected routers
weave_on $HOST1 launch --name ::1 --ipalloc-init seed=::1,::2
weave_on $HOST2 launch --name ::2 --ipalloc-init seed=::1,::2
# Ensure allocations can proceed
assert_raises "timeout 10 cat <( start_container $HOST1 --name c1)"
assert_raises "timeout 10 cat <( start_container $HOST2 --name c2)"
# Connect routers
weave_on $HOST2 connect $HOST1
# Allow topology to propagate
sleep 2
# Check connectivity
assert_raises "exec_on $HOST1 c1 $PING c2"
assert_raises "exec_on $HOST2 c2 $PING c1"
# Now restart one router with a different peername
docker_on $HOST2 rm -f c2 >/dev/null
weave_on $HOST2 forget $HOST1
weave_on $HOST2 stop
weave_on $HOST2 launch --name ::3
# Check that this host has not retained the previous IPAM data
assert "weave_on $HOST2 status ipam" ""
end_suite