Merge pull request #1943 from weaveworks/1942-mcast-iface-up
don't set the interface 'up' before it is fully configured
This commit is contained in:
commit
955fbca44a
2 files changed
+17
-6
No files matched your search
@@ -6,15 +6,26 @@ entrypoint() {
|
|||||||
docker_on $HOST1 inspect --format="{{.Config.Entrypoint}}" "$@"
|
docker_on $HOST1 inspect --format="{{.Config.Entrypoint}}" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_iface_ready() {
|
||||||
|
assert_raises "proxy docker_on $HOST1 run -e 'WEAVE_CIDR=$1' $BASE_IMAGE $CHECK_ETHWE_UP"
|
||||||
|
assert_raises "proxy docker_on $HOST1 run -e 'WEAVE_CIDR=$1' $BASE_IMAGE ip -4 -o addr show ethwe | grep -q '$1'"
|
||||||
|
}
|
||||||
|
|
||||||
start_suite "Proxy waits for weave to be ready before running container commands"
|
start_suite "Proxy waits for weave to be ready before running container commands"
|
||||||
weave_on $HOST1 launch-proxy
|
|
||||||
BASE_IMAGE=busybox
|
BASE_IMAGE=busybox
|
||||||
# Ensure the base image does not exist, so that it will be pulled
|
# Ensure the base image does not exist, so that it will be pulled
|
||||||
! docker_on $HOST1 inspect --format=" " $BASE_IMAGE >/dev/null 2>&1 || docker_on $HOST1 rmi $BASE_IMAGE
|
! docker_on $HOST1 inspect --format=" " $BASE_IMAGE >/dev/null 2>&1 || docker_on $HOST1 rmi $BASE_IMAGE
|
||||||
|
|
||||||
assert_raises "proxy docker_on $HOST1 run --name c1 -e 'WEAVE_CIDR=10.2.1.1/24' $BASE_IMAGE $CHECK_ETHWE_UP"
|
# check that interface is ready, with and without --no-multicast-route
|
||||||
|
weave_on $HOST1 launch-proxy --no-multicast-route
|
||||||
|
check_iface_ready 10.2.1.1/24
|
||||||
|
weave_on $HOST1 stop-proxy
|
||||||
|
weave_on $HOST1 launch-proxy
|
||||||
|
check_iface_ready 10.2.1.1/24
|
||||||
|
|
||||||
# Check committed containers only have one weavewait prepended
|
# Check committed containers only have one weavewait prepended
|
||||||
|
proxy_start_container $HOST1 --name c1 -e 'WEAVE_CIDR=10.2.1.1/24'
|
||||||
COMMITTED_IMAGE=$(proxy docker_on $HOST1 commit c1)
|
COMMITTED_IMAGE=$(proxy docker_on $HOST1 commit c1)
|
||||||
assert_raises "proxy docker_on $HOST1 run --name c2 $COMMITTED_IMAGE"
|
assert_raises "proxy docker_on $HOST1 run --name c2 $COMMITTED_IMAGE"
|
||||||
assert "entrypoint c2" "$(entrypoint $COMMITTED_IMAGE)"
|
assert "entrypoint c2" "$(entrypoint $COMMITTED_IMAGE)"
|
||||||
|
|||||||
@@ -763,11 +763,11 @@ connect_container_to_bridge() {
|
|||||||
# veth pair in the 'up' or 'down' state. Furthermore, moving one
|
# veth pair in the 'up' or 'down' state. Furthermore, moving one
|
||||||
# end into a netns normally sets them to 'down'. But, moving an
|
# end into a netns normally sets them to 'down'. But, moving an
|
||||||
# end into the default netns is a null operation, so they stay up,
|
# end into the default netns is a null operation, so they stay up,
|
||||||
# which leads to errors later on. So to get a consistent result,
|
# which leads to errors in 'set name' since that requires the
|
||||||
# we have to be explicit in setting them 'up' or 'down' as
|
# interface to be down. So to get a consistent result, we set the
|
||||||
# necessary.
|
# interface 'down' to begin with.
|
||||||
if ! netnsenter ip link set $GUEST_IFNAME down ||
|
if ! netnsenter ip link set $GUEST_IFNAME down ||
|
||||||
! netnsenter ip link set $GUEST_IFNAME name $1 up ||
|
! netnsenter ip link set $GUEST_IFNAME name $1 ||
|
||||||
! ip link set $LOCAL_IFNAME up ||
|
! ip link set $LOCAL_IFNAME up ||
|
||||||
! add_iface_$BRIDGE_TYPE $LOCAL_IFNAME ||
|
! add_iface_$BRIDGE_TYPE $LOCAL_IFNAME ||
|
||||||
! configure_arp_cache $1 "netnsenter" ; then
|
! configure_arp_cache $1 "netnsenter" ; then
|
||||||
|
|||||||
Reference in new issue
Block a user