don't allocate IPs on 'detach' and 'hide'

Instead of POSTing to IPAM in order to obtain IPs, we GET existing
IPs. We ignore 404s, so detaching/hiding remains idempotent.

Fixes #860
This commit is contained in:
Matthias Radestock committed 2015-10-06 12:35:55 +01:00
1 parent 3d3b7a5672
commit 1da24c68ca
2 files changed
+71 -27

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
#! /bin/bash
UNIVERSE=10.2.3.0/24
check() {
CMD="weave_on $HOST1 $@"
assert_raises "timeout 10 cat <( $CMD )"
}
. ./config.sh
start_suite "'detach' and 'hide' do not require IP allocation"
weave_on $HOST1 launch --ipalloc-range $UNIVERSE --init-peer-count=2
start_container $HOST1 10.2.1.1/24 --name=c1
check detach 10.2.1.1/24 c1
check detach net:10.2.3.0/24 c1
check detach c1
weave_on $HOST1 expose 10.2.1.2/24
check hide 10.2.1.2/24
check hide net:10.2.3.0/24
check hide
end_suite