never, ever use 10.0 for anything
it has a high probability of conflicting
This commit is contained in:
1 parent
95c1e226f0
commit
4ebbdabfa1
1 file changed
+16
-16
@@ -63,32 +63,32 @@ assert_bridge_cidrs() {
|
||||
}
|
||||
|
||||
# Run container with three cidrs
|
||||
CID=$(DOCKER_HOST=tcp://$HOST1:2375 $WEAVE run 10.0.1.1/24 10.0.2.1/24 10.0.3.1/24 -t --name multicidr -h multicidr.weave.local ubuntu | cut -b 1-12)
|
||||
assert_container_cidrs $HOST1 $CID 10.0.1.1/24 10.0.2.1/24 10.0.3.1/24
|
||||
assert_zone_records $HOST1 $CID multicidr.weave.local. 10.0.1.1 10.0.2.1 10.0.3.1
|
||||
CID=$(DOCKER_HOST=tcp://$HOST1:2375 $WEAVE run 10.2.1.1/24 10.2.2.1/24 10.2.3.1/24 -t --name multicidr -h multicidr.weave.local ubuntu | cut -b 1-12)
|
||||
assert_container_cidrs $HOST1 $CID 10.2.1.1/24 10.2.2.1/24 10.2.3.1/24
|
||||
assert_zone_records $HOST1 $CID multicidr.weave.local. 10.2.1.1 10.2.2.1 10.2.3.1
|
||||
|
||||
# Remove two of them
|
||||
weave_on $HOST1 detach 10.0.1.1/24 10.0.3.1/24 $CID
|
||||
assert_container_cidrs $HOST1 $CID 10.0.2.1/24
|
||||
assert_zone_records $HOST1 $CID multicidr.weave.local. 10.0.2.1
|
||||
weave_on $HOST1 detach 10.2.1.1/24 10.2.3.1/24 $CID
|
||||
assert_container_cidrs $HOST1 $CID 10.2.2.1/24
|
||||
assert_zone_records $HOST1 $CID multicidr.weave.local. 10.2.2.1
|
||||
|
||||
# Put them both back
|
||||
weave_on $HOST1 attach 10.0.1.1/24 10.0.3.1/24 $CID
|
||||
assert_container_cidrs $HOST1 $CID 10.0.2.1/24 10.0.1.1/24 10.0.3.1/24
|
||||
assert_zone_records $HOST1 $CID multicidr.weave.local. 10.0.2.1 10.0.1.1 10.0.3.1
|
||||
weave_on $HOST1 attach 10.2.1.1/24 10.2.3.1/24 $CID
|
||||
assert_container_cidrs $HOST1 $CID 10.2.2.1/24 10.2.1.1/24 10.2.3.1/24
|
||||
assert_zone_records $HOST1 $CID multicidr.weave.local. 10.2.2.1 10.2.1.1 10.2.3.1
|
||||
|
||||
# Stop the container, restart with three IPs
|
||||
docker_on $HOST1 stop $CID
|
||||
weave_on $HOST1 start 10.0.1.1/24 10.0.2.1/24 10.0.3.1/24 $CID
|
||||
assert_container_cidrs $HOST1 $CID 10.0.1.1/24 10.0.2.1/24 10.0.3.1/24
|
||||
assert_zone_records $HOST1 $CID multicidr.weave.local. 10.0.1.1 10.0.2.1 10.0.3.1
|
||||
weave_on $HOST1 start 10.2.1.1/24 10.2.2.1/24 10.2.3.1/24 $CID
|
||||
assert_container_cidrs $HOST1 $CID 10.2.1.1/24 10.2.2.1/24 10.2.3.1/24
|
||||
assert_zone_records $HOST1 $CID multicidr.weave.local. 10.2.1.1 10.2.2.1 10.2.3.1
|
||||
|
||||
# Expose some cidrs
|
||||
weave_on $HOST1 expose 10.0.1.2/24 10.0.2.2/24 10.0.3.2/24
|
||||
assert_bridge_cidrs $HOST1 weave 10.0.1.2/24 10.0.2.2/24 10.0.3.2/24
|
||||
weave_on $HOST1 expose 10.2.1.2/24 10.2.2.2/24 10.2.3.2/24
|
||||
assert_bridge_cidrs $HOST1 weave 10.2.1.2/24 10.2.2.2/24 10.2.3.2/24
|
||||
|
||||
# Hide some cidrs
|
||||
weave_on $HOST1 hide 10.0.1.2/24 10.0.3.2/24
|
||||
assert_bridge_cidrs $HOST1 weave 10.0.2.2/24
|
||||
weave_on $HOST1 hide 10.2.1.2/24 10.2.3.2/24
|
||||
assert_bridge_cidrs $HOST1 weave 10.2.2.2/24
|
||||
|
||||
end_suite
|
||||
Reference in new issue
Block a user