Change all launch-*/stop-* commands to launch/stop.
Given `proxy` & `router` processes have been merged, `launch-proxy`, `launch-router`, `stop-proxy`, `stop-router` do not make sense any more, and should just be `launch` and `stop` with the appropriate flags.
This commit is contained in:
1 parent
b654ac178c
commit
43249a8d39
31 files changed
+91
-102
No files matched your search
+2
-2
@@ -41,7 +41,7 @@ case "$1" in
|
||||
for i in $(seq $START $FINISH); do
|
||||
IP=$SUBNET.$i
|
||||
sudo ip addr add $IP/24 dev multiweave
|
||||
weave $i launch-router --datapath '' --iface '' --no-dns --host $IP \
|
||||
weave $i launch --datapath '' --iface '' --no-dns --host $IP \
|
||||
--name $(random_mac) --nickname weave$i "$@"
|
||||
done
|
||||
echo $(date -R) connecting
|
||||
@@ -57,7 +57,7 @@ case "$1" in
|
||||
for i in $(seq $FINISH -1 $START); do
|
||||
IP=$SUBNET.$i
|
||||
echo Stopping weave$i
|
||||
weave $i stop-router
|
||||
weave $i stop
|
||||
sudo ip addr del $IP/24 dev multiweave || true
|
||||
done
|
||||
[ -z "$(ip -4 -o addr show multiweave)" ] && sudo ip link del multiweave
|
||||
|
||||
@@ -6,9 +6,9 @@ C1=10.2.1.41
|
||||
C3=10.2.1.71
|
||||
|
||||
launch_all() {
|
||||
weave_on $HOST1 launch-router $1
|
||||
weave_on $HOST2 launch-router $1 --ipalloc-range="" $HOST1
|
||||
weave_on $HOST3 launch-router $1 $HOST2
|
||||
weave_on $HOST1 launch $1
|
||||
weave_on $HOST2 launch $1 --ipalloc-range="" $HOST1
|
||||
weave_on $HOST3 launch $1 $HOST2
|
||||
}
|
||||
|
||||
start_suite "Peer discovery, multi-hop routing and gossip forwarding"
|
||||
|
||||
@@ -16,8 +16,8 @@ assert_peers() {
|
||||
|
||||
start_suite "Connecting and forgetting routers after launch"
|
||||
|
||||
weave_on $HOST1 launch-router
|
||||
weave_on $HOST2 launch-router
|
||||
weave_on $HOST1 launch
|
||||
weave_on $HOST2 launch
|
||||
|
||||
start_container $HOST1 $C1/24 --name=c1
|
||||
start_container $HOST2 $C2/24 --name=c2
|
||||
@@ -35,7 +35,7 @@ assert_raises "exec_on $HOST1 c1 $PING $C2"
|
||||
# Forget everyone and disconnect
|
||||
assert_raises "weave_on $HOST2 forget $HOST1 $HOST2"
|
||||
assert_raises "stop_weave_on $HOST1"
|
||||
assert_raises "weave_on $HOST1 launch-router"
|
||||
assert_raises "weave_on $HOST1 launch"
|
||||
assert_peers $HOST2 ""
|
||||
assert_raises "exec_on $HOST1 c1 sh -c '! $PING $C2'"
|
||||
|
||||
|
||||
@@ -12,8 +12,7 @@ start_suite "--no-multicast-route operation"
|
||||
$SSH $HOST1 docker network rm testmcasttrue testmcastfalse >/dev/null 2>&1 || true
|
||||
|
||||
# Ensure containers run either way have no multicast route
|
||||
weave_on $HOST1 launch-router --plugin
|
||||
weave_on $HOST1 launch-proxy --no-multicast-route
|
||||
weave_on $HOST1 launch --no-multicast-route
|
||||
|
||||
docker_on $HOST1 run --name c1 -dt $SMALL_IMAGE /bin/sh
|
||||
weave_on $HOST1 attach --no-multicast-route c1
|
||||
@@ -35,8 +34,8 @@ assert "show_multicast_route_on $HOST1 c5" "224.0.0.0/4 dev ethwe0 "
|
||||
|
||||
# Ensure current proxy options are obeyed on container start
|
||||
docker_on $HOST1 stop -t 1 c2
|
||||
weave_on $HOST1 stop-proxy
|
||||
weave_on $HOST1 launch-proxy
|
||||
weave_on $HOST1 stop
|
||||
weave_on $HOST1 launch
|
||||
|
||||
proxy docker_on $HOST1 start c2
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
start_suite "Check propagation of DNS entries when gossip is delayed"
|
||||
|
||||
weave_on $HOST1 launch-router --no-discovery
|
||||
weave_on $HOST2 launch-router --no-discovery $HOST1
|
||||
weave_on $HOST3 launch-router --no-discovery $HOST2
|
||||
weave_on $HOST1 launch --no-discovery
|
||||
weave_on $HOST2 launch --no-discovery $HOST1
|
||||
weave_on $HOST3 launch --no-discovery $HOST2
|
||||
|
||||
start_container $HOST1 --name=c1
|
||||
C1=$(container_ip $HOST1 c1)
|
||||
@@ -17,10 +17,10 @@ assert_dns_record $HOST3 c3 c1.weave.local $C1
|
||||
# Stall the propagation of gossip, stop weave and kill the container
|
||||
run_on $HOST3 "sudo iptables -A INPUT -s $HOST2 -j DROP"
|
||||
|
||||
weave_on $HOST1 stop-router
|
||||
weave_on $HOST1 stop
|
||||
docker_on $HOST1 rm -f c1
|
||||
|
||||
weave_on $HOST1 launch-router --no-discovery $HOST3
|
||||
weave_on $HOST1 launch --no-discovery $HOST3
|
||||
|
||||
# Now re-enable gossip from host2 to host3
|
||||
run_on $HOST3 "sudo iptables -D INPUT -s $HOST2 -j DROP"
|
||||
|
||||
@@ -22,7 +22,7 @@ check_dns() {
|
||||
start_suite "With or without DNS test"
|
||||
|
||||
# Assert behaviour without weaveDNS running
|
||||
weave_on $HOST1 launch-router
|
||||
weave_on $HOST1 launch
|
||||
|
||||
start_container $HOST1 $TARGET_IP/24 --name c2 -h $TARGET
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
start_suite "Resolve a non-weave address"
|
||||
|
||||
weave_on $HOST1 launch-router
|
||||
weave_on $HOST1 launch
|
||||
|
||||
start_container_with_dns $HOST1 10.2.1.5/24 --name=c1
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
|
||||
start_suite "Containers get same IP address on restart"
|
||||
|
||||
weave_on $HOST1 launch-router
|
||||
weave_on $HOST1 launch-proxy
|
||||
weave_on $HOST1 launch
|
||||
|
||||
# Use up first address with throwaway container
|
||||
start_container $HOST1 --name=c1
|
||||
|
||||
@@ -15,8 +15,8 @@ delete_persistence() {
|
||||
|
||||
start_suite "Claiming addresses"
|
||||
|
||||
weave_on $HOST1 launch-router --ipalloc-range $UNIVERSE $HOST2
|
||||
weave_on $HOST2 launch-router --ipalloc-range $UNIVERSE $HOST1
|
||||
weave_on $HOST1 launch --ipalloc-range $UNIVERSE $HOST2
|
||||
weave_on $HOST2 launch --ipalloc-range $UNIVERSE $HOST1
|
||||
|
||||
start_container $HOST1 $C1/12 --name=c1
|
||||
start_container $HOST2 --name=c2
|
||||
@@ -29,8 +29,8 @@ stop_weave_on $HOST2
|
||||
delete_persistence $HOST1 $HOST2
|
||||
|
||||
# Start hosts in reverse order so c1's address has to be claimed from host2
|
||||
weave_on $HOST2 launch-router --ipalloc-range $UNIVERSE
|
||||
weave_on $HOST1 launch-router --ipalloc-range $UNIVERSE $HOST2
|
||||
weave_on $HOST2 launch --ipalloc-range $UNIVERSE
|
||||
weave_on $HOST1 launch --ipalloc-range $UNIVERSE $HOST2
|
||||
|
||||
# Start another container on host2, so if it hasn't relinquished c1's
|
||||
# address it would give that out as the first available.
|
||||
@@ -48,13 +48,13 @@ delete_persistence $HOST1 $HOST2
|
||||
|
||||
# Now make host1 attempt to claim from host2, when host2 is stopped
|
||||
# the point being to check whether host1 will hang trying to talk to host2
|
||||
weave_on $HOST2 launch-router --ipalloc-range $UNIVERSE
|
||||
weave_on $HOST2 launch --ipalloc-range $UNIVERSE
|
||||
weave_on $HOST2 prime
|
||||
# Introduce host3 to remember the IPAM CRDT when we stop host2
|
||||
weave_on $HOST3 launch-router --ipalloc-range $UNIVERSE $HOST2
|
||||
weave_on $HOST3 launch --ipalloc-range $UNIVERSE $HOST2
|
||||
weave_on $HOST3 prime
|
||||
stop_weave_on $HOST2
|
||||
weave_on $HOST1 launch-router --ipalloc-range $UNIVERSE $HOST3
|
||||
weave_on $HOST1 launch --ipalloc-range $UNIVERSE $HOST3
|
||||
|
||||
stop_weave_on $HOST1
|
||||
stop_weave_on $HOST3
|
||||
|
||||
@@ -4,17 +4,17 @@
|
||||
|
||||
start_suite "Rolling restart with reset"
|
||||
|
||||
weave_on $HOST1 launch-router
|
||||
weave_on $HOST2 launch-router $HOST1
|
||||
weave_on $HOST1 launch
|
||||
weave_on $HOST2 launch $HOST1
|
||||
|
||||
start_container $HOST1 --name=c1
|
||||
start_container $HOST2 --name=c2
|
||||
|
||||
# Now reset the routers so they should give their space away, and restart
|
||||
weave_on $HOST1 reset
|
||||
weave_on $HOST1 launch-router $HOST2
|
||||
weave_on $HOST1 launch $HOST2
|
||||
weave_on $HOST2 reset
|
||||
weave_on $HOST2 launch-router $HOST1
|
||||
weave_on $HOST2 launch $HOST1
|
||||
|
||||
# And try to start a container
|
||||
assert_raises "timeout 10 cat <( start_container $HOST1 )"
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
start_suite "IPAM ring seed mismatch"
|
||||
|
||||
weave_on $HOST1 launch-router --no-discovery
|
||||
weave_on $HOST2 launch-router --no-discovery
|
||||
weave_on $HOST3 launch-router --no-discovery
|
||||
weave_on $HOST1 launch --no-discovery
|
||||
weave_on $HOST2 launch --no-discovery
|
||||
weave_on $HOST3 launch --no-discovery
|
||||
|
||||
# Do some allocations to get the ring initialized on two hosts
|
||||
start_container $HOST1
|
||||
|
||||
@@ -7,7 +7,7 @@ start_suite "Checking persistence of IPAM"
|
||||
launch_router_with_db() {
|
||||
host=$1
|
||||
shift
|
||||
weave_on $host launch-router "$@"
|
||||
weave_on $host launch "$@"
|
||||
}
|
||||
|
||||
launch_router_with_db $HOST1 $HOST2
|
||||
|
||||
@@ -26,7 +26,7 @@ ORIG_MACHINE_ID=$($SSH $HOST1 cat /etc/machine-id)
|
||||
# Blank machine-id to begin, so peername will work the same as pre-1.9
|
||||
$SSH $HOST1 sudo cp /dev/null /etc/machine-id
|
||||
|
||||
weave_on $HOST1 launch-router
|
||||
weave_on $HOST1 launch
|
||||
weave_on $HOST1 prime
|
||||
PEERNAME1=$(get_peername)
|
||||
|
||||
@@ -34,21 +34,21 @@ PEERNAME1=$(get_peername)
|
||||
echo $ORIG_MACHINE_ID | $SSH $HOST1 sudo tee /etc/machine-id >/dev/null
|
||||
|
||||
# Stop and restart; it should take the ID from the bridge
|
||||
weave_on $HOST1 stop-router
|
||||
weave_on $HOST1 launch-router
|
||||
weave_on $HOST1 stop
|
||||
weave_on $HOST1 launch
|
||||
|
||||
assert "get_peername" "$PEERNAME1"
|
||||
|
||||
# Stop and remove the bridge, then restart; it should take the ID from persistence
|
||||
weave_on $HOST1 stop-router
|
||||
weave_on $HOST1 stop
|
||||
remove_bridge
|
||||
weave_on $HOST1 launch-router
|
||||
weave_on $HOST1 launch
|
||||
|
||||
assert "get_peername" "$PEERNAME1"
|
||||
|
||||
# Now remove everything and restart: should get a different peer name
|
||||
weave_on $HOST1 reset
|
||||
weave_on $HOST1 launch-router
|
||||
weave_on $HOST1 launch
|
||||
|
||||
PEERNAME3=$(get_peername)
|
||||
assert_raises "[ $PEERNAME3 != $PEERNAME1 ]"
|
||||
@@ -57,9 +57,9 @@ assert_raises "[ $PEERNAME3 != $PEERNAME1 ]"
|
||||
echo $ORIG_MACHINE_ID | rot8 | $SSH $HOST1 sudo tee /etc/machine-id >/dev/null
|
||||
|
||||
# Remove bridge and restart; it should get a different ID
|
||||
weave_on $HOST1 stop-router
|
||||
weave_on $HOST1 stop
|
||||
remove_bridge
|
||||
weave_on $HOST1 launch-router
|
||||
weave_on $HOST1 launch
|
||||
|
||||
assert_raises "[ $(get_peername) != $PEERNAME3 ]"
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ start_suite "Weave attach/detach/expose/hide with multiple cidr arguments"
|
||||
# specific address, i.e. we are assuming that IPAM always returns the
|
||||
# lowest available address in the subnet
|
||||
|
||||
weave_on $HOST1 launch-router --ipalloc-range 10.2.3.0/24
|
||||
weave_on $HOST1 launch --ipalloc-range 10.2.3.0/24
|
||||
|
||||
# Run container with three cidrs
|
||||
CID=$(docker_on $HOST1 run --name=multicidr -h $NAME -dt $SMALL_IMAGE /bin/sh)
|
||||
|
||||
@@ -29,7 +29,7 @@ docker_py_test() {
|
||||
i=$(($i + 1))
|
||||
done
|
||||
|
||||
weave_on $HOST1 launch-proxy --no-default-ipalloc
|
||||
weave_on $HOST1 launch --no-default-ipalloc
|
||||
|
||||
DOCKER_BRIDGE_IP=$(weave_on $HOST1 docker-bridge-ip)
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
|
||||
start_suite "Check that docker inspect returns the weave IP"
|
||||
|
||||
weave_on $HOST1 launch-router
|
||||
weave_on $HOST1 launch-proxy --rewrite-inspect
|
||||
weave_on $HOST1 launch --rewrite-inspect
|
||||
|
||||
proxy docker_on $HOST1 run -dt --name c1 $SMALL_IMAGE /bin/sh
|
||||
inspect_format="{{.Name}} {{.NetworkSettings.MacAddress}} {{.NetworkSettings.IPAddress}}/{{.NetworkSettings.IPPrefixLen}}"
|
||||
|
||||
@@ -18,10 +18,10 @@ BASE_IMAGE=busybox
|
||||
! docker_on $HOST1 inspect --format=" " $BASE_IMAGE >/dev/null 2>&1 || docker_on $HOST1 rmi $BASE_IMAGE
|
||||
|
||||
# check that interface is ready, with and without --no-multicast-route
|
||||
weave_on $HOST1 launch-proxy --no-multicast-route
|
||||
weave_on $HOST1 launch --no-multicast-route
|
||||
check_iface_ready 10.2.1.1/24
|
||||
weave_on $HOST1 stop-proxy
|
||||
weave_on $HOST1 launch-proxy
|
||||
weave_on $HOST1 stop
|
||||
weave_on $HOST1 launch
|
||||
check_iface_ready 10.2.1.1/24
|
||||
|
||||
# Check committed containers only have one weavewait prepended
|
||||
|
||||
@@ -11,7 +11,7 @@ image_ip() {
|
||||
start_suite "Proxy rewrites hosts file"
|
||||
|
||||
# Default rewrites the host file
|
||||
weave_on $HOST1 launch-proxy
|
||||
weave_on $HOST1 launch
|
||||
assert "image_ip $SMALL_IMAGE" $expected_ip
|
||||
|
||||
# When container user is non-root
|
||||
@@ -25,8 +25,8 @@ EOF
|
||||
assert "image_ip non-root" $expected_ip
|
||||
|
||||
# When rewrite hosts is disabled
|
||||
weave_on $HOST1 stop-proxy
|
||||
weave_on $HOST1 launch-proxy --no-rewrite-hosts
|
||||
weave_on $HOST1 stop
|
||||
weave_on $HOST1 launch --no-rewrite-hosts
|
||||
assert_raises "image_ip $SMALL_IMAGE | grep -v $expected_ip"
|
||||
|
||||
end_suite
|
||||
@@ -15,7 +15,7 @@ run_container() {
|
||||
}
|
||||
|
||||
start_suite "Proxy uses correct entrypoint and command with weavewait"
|
||||
weave_on $HOST1 launch-proxy --no-restart
|
||||
weave_on $HOST1 launch --no-restart
|
||||
|
||||
build_image check-ethwe-up '["grep"]' '["^1$", "/sys/class/net/ethwe/carrier"]'
|
||||
run_container "check-ethwe-up"
|
||||
@@ -26,13 +26,13 @@ run_container "grep ^1$ /sys/class/net/ethwe/carrier"
|
||||
build_image false '["/bin/false"]' ''
|
||||
run_container "--entrypoint='grep' false ^1$ /sys/class/net/ethwe/carrier"
|
||||
|
||||
weave_on $HOST1 launch-router --ipalloc-range 10.2.2.0/24
|
||||
weave_on $HOST1 launch --ipalloc-range 10.2.2.0/24
|
||||
# NOTE: docker-kill hangs (https://github.com/docker/docker/issues/31447), so we
|
||||
# kill directly the weaveproxy process instead.
|
||||
WEAVEPROXY_PID=$(container_pid $HOST1 weaveproxy)
|
||||
$SSH $HOST1 "ps aux | grep weaveproxy"
|
||||
run_on $HOST1 "sudo kill -9 $WEAVEPROXY_PID"
|
||||
weave_on $HOST1 launch-proxy
|
||||
weave_on $HOST1 launch
|
||||
|
||||
assert_raises "proxy docker_on $HOST1 run check-ethwe-up"
|
||||
|
||||
|
||||
@@ -24,16 +24,16 @@ start_suite "Proxy registers containers with dns"
|
||||
bridge_ip=$(weave_on $HOST1 docker-bridge-ip)
|
||||
|
||||
# Assert behaviour without weaveDNS
|
||||
weave_on $HOST1 launch-proxy
|
||||
weave_on $HOST1 launch
|
||||
do_assert_resolution assert_no_dns_record
|
||||
|
||||
# Assert behaviour with weaveDNS running
|
||||
weave_on $HOST1 launch-router
|
||||
weave_on $HOST1 launch
|
||||
do_assert_resolution assert_dns_record
|
||||
weave_on $HOST1 stop-proxy
|
||||
weave_on $HOST1 stop
|
||||
|
||||
# Assert behaviour with weaveDNS running, but dns forced off
|
||||
weave_on $HOST1 launch-proxy --without-dns
|
||||
weave_on $HOST1 launch --without-dns
|
||||
do_assert_resolution assert_no_dns_record
|
||||
|
||||
end_suite
|
||||
@@ -49,14 +49,9 @@ assert_raises "timeout 90 cat <( run_many )"
|
||||
# Start a container that needs IPAM, then restart it when the router is stopped
|
||||
proxy_start_container $HOST1 -di --name=c3 --restart=always
|
||||
wait_for_attached $HOST1 c3
|
||||
weave_on $HOST1 stop-router
|
||||
docker_on $HOST1 restart c3
|
||||
weave_on $HOST1 launch-router
|
||||
wait_for_attached $HOST1 c3
|
||||
|
||||
# Restarting proxy shouldn't kill unattachable containers
|
||||
weave_on $HOST1 stop
|
||||
weave_on $HOST1 launch-proxy
|
||||
docker_on $HOST1 restart c3
|
||||
weave_on $HOST1 launch
|
||||
wait_for_attached $HOST1 c3
|
||||
|
||||
end_suite
|
||||
@@ -15,22 +15,22 @@ start_suite "Configure the docker daemon for the proxy"
|
||||
assert "weave_on $HOST1 env" ""
|
||||
assert "weave_on $HOST1 config" ""
|
||||
|
||||
weave_on $HOST1 launch-proxy
|
||||
weave_on $HOST1 launch
|
||||
check
|
||||
|
||||
# Check we can use the weave script through the proxy
|
||||
assert_raises "eval '$(weave_on $HOST1 env)' ; $WEAVE version"
|
||||
assert_raises "eval '$(weave_on $HOST1 env)' ; $WEAVE ps"
|
||||
assert_raises "eval '$(weave_on $HOST1 env)' ; $WEAVE launch-router"
|
||||
assert_raises "eval '$(weave_on $HOST1 env)' ; $WEAVE launch"
|
||||
|
||||
# Check we can use weave env/config with multiple -Hs specified
|
||||
weave_on $HOST1 stop
|
||||
weave_on $HOST1 launch-proxy -H tcp://0.0.0.0:12375 -H unix:///var/run/weave/weave.sock
|
||||
weave_on $HOST1 launch -H tcp://0.0.0.0:12375 -H unix:///var/run/weave/weave.sock
|
||||
check
|
||||
|
||||
# Check we can use weave env/config with unix -Hs specified
|
||||
weave_on $HOST1 stop
|
||||
weave_on $HOST1 launch-proxy -H unix:///var/run/weave/weave.sock
|
||||
weave_on $HOST1 launch -H unix:///var/run/weave/weave.sock
|
||||
assert_raises "run_on $HOST1 'eval \$(weave env) ; docker $CMD'"
|
||||
assert_raises "run_on $HOST1 'docker \$(weave config) $CMD'"
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ done
|
||||
# Sanity-check that it's big enough to cause issues.
|
||||
assert_raises "test $(curl -s http://$HOST1:$DOCKER_PORT/v1.19/images/json?all=true | wc -c) -gt 65536"
|
||||
|
||||
weave_on $HOST1 launch-proxy
|
||||
weave_on $HOST1 launch
|
||||
|
||||
assert_raises "proxy docker_on $HOST1 images -a"
|
||||
|
||||
|
||||
@@ -11,10 +11,8 @@ assert_no_ethwe() {
|
||||
|
||||
start_suite "Ping proxied containers over cross-host weave network (with IPAM)"
|
||||
|
||||
weave_on $HOST1 launch-router --ipalloc-range $UNIVERSE
|
||||
weave_on $HOST2 launch-router --ipalloc-range $UNIVERSE $HOST1
|
||||
weave_on $HOST1 launch-proxy
|
||||
weave_on $HOST2 launch-proxy --no-default-ipalloc
|
||||
weave_on $HOST1 launch --ipalloc-range $UNIVERSE
|
||||
weave_on $HOST2 launch --ipalloc-range --no-default-ipalloc $UNIVERSE $HOST1
|
||||
|
||||
proxy_start_container $HOST1 --name=auto
|
||||
proxy_start_container $HOST1 --name=none -e WEAVE_CIDR=none
|
||||
|
||||
@@ -6,8 +6,7 @@ start_suite "Boot the proxy with TLS-enabled Docker support"
|
||||
|
||||
PWD=$($SSH $HOST1 pwd)
|
||||
|
||||
weave_on $HOST1 launch-router
|
||||
weave_on $HOST1 launch-proxy \
|
||||
weave_on $HOST1 launch \
|
||||
--tlsverify \
|
||||
--tlscacert $PWD/tls/ca.pem \
|
||||
--tlscert $PWD/tls/$HOST1.pem \
|
||||
|
||||
@@ -33,17 +33,17 @@ check_dns_records() {
|
||||
}
|
||||
|
||||
test_setup() {
|
||||
weave_on $HOST1 launch-proxy $@
|
||||
weave_on $HOST1 launch $@
|
||||
}
|
||||
|
||||
test_cleanup() {
|
||||
weave_on $HOST1 stop-proxy
|
||||
weave_on $HOST1 stop
|
||||
}
|
||||
|
||||
|
||||
start_suite "Hostname derivation"
|
||||
|
||||
weave_on $HOST1 launch-router
|
||||
weave_on $HOST1 launch
|
||||
|
||||
# Hostname derivation through container name substitutions
|
||||
test_setup --hostname-match '^[^-]+-(?P<appname>[^-]*)-[^-]+$' --hostname-replacement '$appname'
|
||||
|
||||
@@ -2,45 +2,45 @@
|
||||
|
||||
. "$(dirname "$0")/config.sh"
|
||||
|
||||
start_suite "Various launch-proxy configurations"
|
||||
start_suite "Various proxy configurations"
|
||||
|
||||
# Booting it over unix socket listens on unix socket
|
||||
run_on $HOST1 COVERAGE=$COVERAGE weave launch-proxy
|
||||
run_on $HOST1 COVERAGE=$COVERAGE weave launch
|
||||
assert_raises "run_on $HOST1 sudo docker -H unix:///var/run/weave/weave.sock ps"
|
||||
assert_raises "proxy docker_on $HOST1 ps" 1
|
||||
weave_on $HOST1 stop-proxy
|
||||
weave_on $HOST1 stop
|
||||
|
||||
# Booting it over tcp listens on tcp
|
||||
weave_on $HOST1 launch-proxy
|
||||
weave_on $HOST1 launch
|
||||
assert_raises "run_on $HOST1 sudo docker -H unix:///var/run/weave/weave.sock ps" 1
|
||||
assert_raises "proxy docker_on $HOST1 ps"
|
||||
weave_on $HOST1 stop-proxy
|
||||
weave_on $HOST1 stop
|
||||
|
||||
# Booting it over tcp (no prefix) listens on tcp
|
||||
DOCKER_HOST=tcp://$HOST1:$DOCKER_PORT $WEAVE launch-proxy
|
||||
DOCKER_HOST=tcp://$HOST1:$DOCKER_PORT $WEAVE launch
|
||||
assert_raises "run_on $HOST1 sudo docker -H unix:///var/run/weave/weave.sock ps" 1
|
||||
assert_raises "proxy docker_on $HOST1 ps"
|
||||
weave_on $HOST1 stop-proxy
|
||||
weave_on $HOST1 stop
|
||||
|
||||
# Booting it with -H outside /var/run/weave, still works
|
||||
socket="$($SSH $HOST1 mktemp -d)/weave.sock"
|
||||
weave_on $HOST1 launch-proxy -H unix://$socket
|
||||
weave_on $HOST1 launch -H unix://$socket
|
||||
assert_raises "run_on $HOST1 sudo docker -H unix:///$socket ps" 0
|
||||
weave_on $HOST1 stop-proxy
|
||||
weave_on $HOST1 stop
|
||||
|
||||
# Booting it against non-standard docker unix sock
|
||||
run_on $HOST1 "DOCKER_HOST=unix:///var/run/alt-docker.sock COVERAGE=$COVERAGE weave launch-proxy -H tcp://0.0.0.0:12375"
|
||||
run_on $HOST1 "DOCKER_HOST=unix:///var/run/alt-docker.sock COVERAGE=$COVERAGE weave launch -H tcp://0.0.0.0:12375"
|
||||
assert_raises "proxy docker_on $HOST1 ps"
|
||||
weave_on $HOST1 stop-proxy
|
||||
weave_on $HOST1 stop
|
||||
|
||||
# Booting it over tls errors
|
||||
assert_raises "! DOCKER_CLIENT_ARGS='--tls' weave_on $HOST1 launch-proxy"
|
||||
assert_raises "! DOCKER_CERT_PATH='./tls' DOCKER_TLS_VERIFY=1 weave_on $HOST1 launch-proxy"
|
||||
assert_raises "! DOCKER_CLIENT_ARGS='--tls' weave_on $HOST1 launch"
|
||||
assert_raises "! DOCKER_CERT_PATH='./tls' DOCKER_TLS_VERIFY=1 weave_on $HOST1 launch"
|
||||
|
||||
# Booting it with a specific -H overrides defaults
|
||||
weave_on $HOST1 launch-proxy -H tcp://0.0.0.0:12345
|
||||
weave_on $HOST1 launch -H tcp://0.0.0.0:12345
|
||||
assert_raises "run_on $HOST1 sudo docker -H tcp://$HOST1:12345 ps"
|
||||
assert_raises "proxy docker_on $HOST1 ps" 1
|
||||
weave_on $HOST1 stop-proxy
|
||||
weave_on $HOST1 stop
|
||||
|
||||
end_suite
|
||||
@@ -5,7 +5,7 @@
|
||||
start_suite "Proxy failure modes"
|
||||
|
||||
# docker run should fail when weave router is not running
|
||||
weave_on $HOST1 launch-proxy
|
||||
weave_on $HOST1 launch
|
||||
assert_raises "! proxy docker_on $HOST1 run --rm $SMALL_IMAGE true"
|
||||
assert_raises "proxy docker_on $HOST1 run --rm $SMALL_IMAGE true 2>&1 1>/dev/null | grep 'Error response from daemon: weave container is not present. Have you launched it?'"
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ weave_on $HOST1 launch
|
||||
start_container_local_plugin $HOST1 --name=c1 --hostname=$C1_NAME
|
||||
c1ip=$(container_ip $HOST1 c1)
|
||||
|
||||
weave_on $HOST1 stop-router
|
||||
weave_on $HOST1 launch-router
|
||||
weave_on $HOST1 stop
|
||||
weave_on $HOST1 launch
|
||||
|
||||
assert "container_ip $HOST1 c1" "$c1ip"
|
||||
assert "weave_on $HOST1 dns-lookup $C1_NAME" "$c1ip"
|
||||
|
||||
@@ -90,7 +90,7 @@ assert_raises "exec_on $HOST1 c1 $PING $C3IP"
|
||||
stop_weave_on $HOST1
|
||||
|
||||
# Ensure no warning is printed to the standard error:
|
||||
ACTUAL_OUTPUT=$(CHECKPOINT_DISABLE="$CHECKPOINT_DISABLE" DOCKER_HOST=tcp://$HOST1:$DOCKER_PORT $WEAVE launch-router 2>&1)
|
||||
ACTUAL_OUTPUT=$(CHECKPOINT_DISABLE="$CHECKPOINT_DISABLE" DOCKER_HOST=tcp://$HOST1:$DOCKER_PORT $WEAVE launch 2>&1)
|
||||
EXPECTED_OUTPUT=$($SSH $HOST1 docker inspect --format="{{.Id}}" weave)
|
||||
|
||||
assert_raises "[ $EXPECTED_OUTPUT == $ACTUAL_OUTPUT ]"
|
||||
|
||||
Reference in new issue
Block a user