[proxy] Add support for WEAVE_CIDR=none
Tells the proxy not to do anything with this container. We set it when running weaveexec/weave/etc containers, so that the weave script works through the proxy.
This commit is contained in:
1 parent
ff838a14d9
commit
ca681bce13
8 files changed
+44
-15
No files matched your search
@@ -10,4 +10,9 @@ CMD="run -e WEAVE_CIDR=10.2.1.4/24 $SMALL_IMAGE $CHECK_ETHWE_UP"
|
||||
assert_raises "eval '$(weave_on $HOST1 proxy-env)' ; docker $CMD"
|
||||
assert_raises "docker $(weave_on $HOST1 proxy-config) $CMD"
|
||||
|
||||
# Check we can use the weave script through the proxy
|
||||
assert_raises "eval '$(weave_on $HOST1 proxy-env)' ; $WEAVE version"
|
||||
assert_raises "eval '$(weave_on $HOST1 proxy-env)' ; $WEAVE ps"
|
||||
assert_raises "eval '$(weave_on $HOST1 proxy-env)' ; $WEAVE launch"
|
||||
|
||||
end_suite
|
||||
@@ -4,23 +4,35 @@
|
||||
|
||||
UNIVERSE=10.2.2.0/24
|
||||
|
||||
start() {
|
||||
host=$1
|
||||
shift
|
||||
proxy docker_on "$host" run "$@" -dt $SMALL_IMAGE /bin/sh
|
||||
}
|
||||
|
||||
assert_no_ethwe() {
|
||||
assert_raises "container_ip $1 $2" 1
|
||||
assert_raises "proxy exec_on $1 $2 ip link show | grep -v ethwe"
|
||||
}
|
||||
|
||||
start_suite "Ping proxied containers over cross-host weave network (with IPAM)"
|
||||
|
||||
weave_on $HOST1 launch -iprange $UNIVERSE
|
||||
weave_on $HOST1 launch-proxy
|
||||
start $HOST1 --name=auto
|
||||
start $HOST1 --name=none -e WEAVE_CIDR=none
|
||||
|
||||
weave_on $HOST2 launch -iprange $UNIVERSE $HOST1
|
||||
weave_on $HOST2 launch-proxy --no-default-ipam
|
||||
|
||||
proxy docker_on $HOST1 run --name=auto -dt $SMALL_IMAGE /bin/sh
|
||||
proxy docker_on $HOST2 run -e WEAVE_CIDR= --name=explicit -dt $SMALL_IMAGE /bin/sh
|
||||
proxy docker_on $HOST2 run --name=none -dt $SMALL_IMAGE /bin/sh
|
||||
start $HOST2 --name=explicit -e WEAVE_CIDR=
|
||||
start $HOST2 --name=no-default
|
||||
|
||||
AUTO=$(container_ip $HOST1 auto)
|
||||
EXPLICIT=$(container_ip $HOST2 explicit)
|
||||
assert_raises "proxy exec_on $HOST1 auto $PING $EXPLICIT"
|
||||
assert_raises "proxy exec_on $HOST2 explicit $PING $AUTO"
|
||||
|
||||
assert_raises "container_ip $HOST2 none" 1
|
||||
assert_raises "proxy exec_on $HOST2 none ip link show | grep -v ethwe"
|
||||
assert_no_ethwe $HOST1 none
|
||||
assert_no_ethwe $HOST2 no-default
|
||||
|
||||
end_suite
|
||||
Reference in new issue
Block a user