Added automated test reproducing the issue.
test #4 "[ 3e52b548e6df304c61ea5bee0af4b3515e025e7e25152c65ecae3d03c71cf52d == Unable to claim: address 10.32.0.3/12 is already owned by fbe411facc8b657c5850591ab56fc40fb56160d43db0d7363a29ba3edad61134 Unable to claim: address 10.32.0.1/12 is already owned by cf16a2bcdee8dd1ef7e5f0a611127611e67ea734f45d7526678fc3b1fc0c6f5d 3e52b548e6df304c61ea5bee0af4b3515e025e7e25152c65ecae3d03c71cf52d ]" failed: program terminated with code 2 instead of 0 1 of 6 tests failed in 6.499s.
This commit is contained in:
1 parent
46eb01604c
commit
16415404c7
1 file changed
+17
-1
@@ -48,12 +48,28 @@ assert_raises "exec_on $HOST1 c2 $PING $C1IP"
|
||||
# Now remove and start a new container to see if IP address re-use breaks things
|
||||
docker_on $HOST1 rm -f c2
|
||||
|
||||
docker_on $HOST1 run --net=none --name=c3 -dt $SMALL_IMAGE /bin/sh
|
||||
C3=$(docker_on $HOST1 run --net=none --name=c3 -dt $SMALL_IMAGE /bin/sh)
|
||||
|
||||
cni_connect $HOST1 c3 <<EOF
|
||||
{ "name": "weave", "type": "weave-net" }
|
||||
EOF
|
||||
|
||||
C3IP=$(container_ip $HOST1 c3)
|
||||
|
||||
assert_raises "exec_on $HOST1 c1 $PING $C2IP"
|
||||
|
||||
|
||||
# Ensure existing containers can reclaim their IP addresses after CNI has been used -- see #2548
|
||||
stop_weave_on $HOST1
|
||||
|
||||
# Ensure no warning is printed to the standard error:
|
||||
ACTUAL_OUTPUT=$(weave_on $HOST1 launch-router 2>&1)
|
||||
EXPECTED_OUTPUT=$(docker_on $HOST1 inspect --format="{{.Id}}" weave)
|
||||
|
||||
assert_raises "[ $EXPECTED_OUTPUT == $ACTUAL_OUTPUT ]"
|
||||
|
||||
assert "$SSH $HOST1 \"curl -s -X GET 127.0.0.1:6784/ip/$C1 | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'\"" "$C1IP"
|
||||
assert "$SSH $HOST1 \"curl -s -X GET 127.0.0.1:6784/ip/$C3 | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'\"" "$C3IP"
|
||||
|
||||
|
||||
end_suite
|
||||
Reference in new issue
Block a user