Change command-line syntax to net: prefix instead of --subnet

This commit is contained in:
Bryan Boreham committed 2015-06-10 17:28:06 +01:00
1 parent 91ad3ef684
commit a89b549c40
4 files changed
+22 -29

No files matched your search

+4 -4
View File
@@ -14,16 +14,16 @@ weave_on $HOST1 launch -iprange $UNIVERSE -ipsubnet $SUBNET_1
weave_on $HOST2 launch -iprange $UNIVERSE -ipsubnet $SUBNET_1 $HOST1
start_container $HOST1 $C1/24 --name=c1
start_container $HOST2 $C2/24 --name=c2
start_container $HOST2 ip:$C2/24 --name=c2
assert_raises "exec_on $HOST1 c1 $PING $C2"
start_container $HOST1 --name=c3
start_container $HOST2 --subnet default --name=c4
start_container $HOST2 net:default --name=c4
C4=$(container_ip $HOST2 c4)
assert_raises "exec_on $HOST1 c3 $PING $C4"
start_container $HOST1 --subnet $SUBNET_2 --name=c5
start_container $HOST2 --subnet $SUBNET_2 --name=c6
start_container $HOST1 net:$SUBNET_2 --name=c5
start_container $HOST2 net:$SUBNET_2 --name=c6
C6=$(container_ip $HOST2 c6)
assert_raises "exec_on $HOST1 c5 $PING $C6"
+8 -8
View File
@@ -42,7 +42,7 @@ assert_bridge_cidrs() {
start_suite "Weave run/start/attach/detach with multiple cidr arguments"
# NOTE: in these tests, --subnet arguments are checked against a
# NOTE: in these tests, net: arguments are checked against a
# specific address, i.e. we are assuming that IPAM always returns the
# lowest available address in the subnet
@@ -50,37 +50,37 @@ weave_on $HOST1 launch -debug -iprange 10.2.3.0/24
weave_on $HOST1 launch-dns 10.254.254.254/24
# Run container with three cidrs
CID=$(start_container $HOST1 10.2.1.1/24 10.2.2.1/24 --subnet 10.2.3.0/24 --name=multicidr -h $NAME | cut -b 1-12)
CID=$(start_container $HOST1 ip:10.2.1.1/24 10.2.2.1/24 net:10.2.3.0/24 --name=multicidr -h $NAME | 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 $NAME. 10.2.1.1 10.2.2.1 10.2.3.1
# Remove two of them
weave_on $HOST1 detach 10.2.1.1/24 --subnet 10.2.3.0/24 $CID
weave_on $HOST1 detach 10.2.1.1/24 net:10.2.3.0/24 $CID
assert_container_cidrs $HOST1 $CID 10.2.2.1/24
assert_zone_records $HOST1 $CID $NAME. 10.2.2.1
# Put them both back
weave_on $HOST1 attach 10.2.1.1/24 --subnet 10.2.3.0/24 $CID
weave_on $HOST1 attach ip:10.2.1.1/24 net:10.2.3.0/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 $NAME. 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.2.1.1/24 10.2.2.1/24 --subnet 10.2.3.0/24 $CID
weave_on $HOST1 start 10.2.1.1/24 ip:10.2.2.1/24 net:10.2.3.0/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 $NAME. 10.2.1.1 10.2.2.1 10.2.3.1
# Expose some cidrs
weave_on $HOST1 expose 10.2.1.2/24 10.2.2.2/24 --subnet 10.2.3.0/24
weave_on $HOST1 expose 10.2.1.2/24 10.2.2.2/24 net:10.2.3.0/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.2.1.2/24 --subnet 10.2.3.0/24
weave_on $HOST1 hide 10.2.1.2/24 net:10.2.3.0/24
assert_bridge_cidrs $HOST1 weave 10.2.2.2/24
# Now detach and run another container to check we have released IPs in IPAM
weave_on $HOST1 detach $CID
CID2=$(start_container $HOST1 --subnet 10.2.3.0/24)
CID2=$(start_container $HOST1 net:10.2.3.0/24)
assert_container_cidrs $HOST1 $CID2 10.2.3.1/24
end_suite