Add integration test for the proxy, using docker-py client
This commit is contained in:
1 parent
6c4271f15d
commit
5a6a67f632
3 files changed
+38
No files matched your search
Executable
+16
@@ -0,0 +1,16 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
. ./config.sh
|
||||||
|
|
||||||
|
start_suite "Run docker-py test suite against the proxy"
|
||||||
|
|
||||||
|
weave_on $HOST1 launch-proxy
|
||||||
|
assert_raises "docker_on $HOST1 ps | grep weaveproxy"
|
||||||
|
assert_raises "docker_on $HOST1 run \
|
||||||
|
-e NOT_ON_HOST=true \
|
||||||
|
-e DOCKER_HOST=tcp://172.17.42.1:12375 \
|
||||||
|
-v /tmp:/tmp \
|
||||||
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
|
joffrey/docker-py python tests/integration_test.py"
|
||||||
|
|
||||||
|
end_suite
|
||||||
Executable
+15
@@ -0,0 +1,15 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
. ./config.sh
|
||||||
|
|
||||||
|
start_suite "Proxy waits for weave to be ready before running container commands"
|
||||||
|
weave_on $HOST1 launch-proxy
|
||||||
|
BASE_IMAGE=ubuntu
|
||||||
|
# Ensure the base image does not exist, so that it will be pulled
|
||||||
|
if (docker_on $HOST1 images $BASE_IMAGE | grep $BASE_IMAGE); then
|
||||||
|
docker_on $HOST1 rmi $BASE_IMAGE
|
||||||
|
fi
|
||||||
|
|
||||||
|
assert_raises "docker_proxy_on $HOST1 run -e 'WEAVE_CIDR=10.2.1.1/24' $BASE_IMAGE ip link show ethwe | grep 'state UP'"
|
||||||
|
|
||||||
|
end_suite
|
||||||
@@ -76,6 +76,13 @@ docker_on() {
|
|||||||
docker -H tcp://$host:2375 "$@"
|
docker -H tcp://$host:2375 "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
docker_proxy_on() {
|
||||||
|
host=$1
|
||||||
|
shift 1
|
||||||
|
greyly echo "Docker (with proxy) on $host: $@" >&2
|
||||||
|
docker -H tcp://$host:12375 "$@"
|
||||||
|
}
|
||||||
|
|
||||||
weave_on() {
|
weave_on() {
|
||||||
host=$1
|
host=$1
|
||||||
shift 1
|
shift 1
|
||||||
|
|||||||
Reference in new issue
Block a user