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.
47 lines
1.6 KiB
Bash
Executable File
47 lines
1.6 KiB
Bash
Executable File
#! /bin/bash
|
|
|
|
. "$(dirname "$0")/config.sh"
|
|
|
|
start_suite "Various proxy configurations"
|
|
|
|
# Booting it over unix socket listens on unix socket
|
|
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
|
|
|
|
# Booting it over tcp listens on tcp
|
|
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
|
|
|
|
# Booting it over tcp (no prefix) listens on tcp
|
|
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
|
|
|
|
# Booting it with -H outside /var/run/weave, still works
|
|
socket="$($SSH $HOST1 mktemp -d)/weave.sock"
|
|
weave_on $HOST1 launch -H unix://$socket
|
|
assert_raises "run_on $HOST1 sudo docker -H unix:///$socket ps" 0
|
|
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 -H tcp://0.0.0.0:12375"
|
|
assert_raises "proxy docker_on $HOST1 ps"
|
|
weave_on $HOST1 stop
|
|
|
|
# Booting it over tls errors
|
|
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 -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
|
|
|
|
end_suite
|