From 5c9a13d3435fcd32a1bfb620bdbb72988b4f975e Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Thu, 30 Jul 2015 10:38:02 +0000 Subject: [PATCH] Shard 600_proxy_docker_py into 4. --- test/600_proxy_docker_py.sh | 45 ++++++++++++++++++++++++++++++++ test/600_proxy_docker_py_test.sh | 22 ---------------- test/601_proxy_docker_py_test.sh | 6 +++++ test/602_proxy_docker_py_test.sh | 6 +++++ test/603_proxy_docker_py_test.sh | 6 +++++ test/604_proxy_docker_py_test.sh | 6 +++++ 6 files changed, 69 insertions(+), 22 deletions(-) create mode 100755 test/600_proxy_docker_py.sh delete mode 100755 test/600_proxy_docker_py_test.sh create mode 100755 test/601_proxy_docker_py_test.sh create mode 100755 test/602_proxy_docker_py_test.sh create mode 100755 test/603_proxy_docker_py_test.sh create mode 100755 test/604_proxy_docker_py_test.sh diff --git a/test/600_proxy_docker_py.sh b/test/600_proxy_docker_py.sh new file mode 100755 index 00000000..32c8bacc --- /dev/null +++ b/test/600_proxy_docker_py.sh @@ -0,0 +1,45 @@ +#! /bin/bash +# Explicitly not called _test.sh - this isn't run, but imported by other tests. + +. ./config.sh + +docker_py_test() { + SHARD=$1 + TOTAL_SHARDS=$2 + + start_suite "Run docker-py test suite against the proxy" + + # Get a list of the tests for use to shard + docker_on $HOST1 pull joffrey/docker-py >/dev/null + C=$(docker_on $HOST1 create \ + -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) + docker cp $C:/home/docker-py/tests/integration_test.py . + CANDIDATES=$(sed -En 's/^class (Test[[:alpha:]]+).*/\1/p' integration_test.py) + + TESTS= + for test in $CANDIDATES; do + if [ $(($i % $TOTAL_SHARDS)) -eq $SHARD ]; then + TESTS="$TESTS $test" + fi + i=$(($i + 1)) + done + + weave_on $HOST1 launch-proxy --no-default-ipalloc + + if 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 "$TESTS" ; then + assert_raises "true" + else + assert_raises "false" + fi + + end_suite +} diff --git a/test/600_proxy_docker_py_test.sh b/test/600_proxy_docker_py_test.sh deleted file mode 100755 index f016572f..00000000 --- a/test/600_proxy_docker_py_test.sh +++ /dev/null @@ -1,22 +0,0 @@ -#! /bin/bash - -. ./config.sh - -start_suite "Run docker-py test suite against the proxy" - -docker_on $HOST1 pull joffrey/docker-py >/dev/null - -weave_on $HOST1 launch-proxy --no-default-ipalloc - -if 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 ; then - assert_raises "true" -else - assert_raises "false" -fi - -end_suite diff --git a/test/601_proxy_docker_py_test.sh b/test/601_proxy_docker_py_test.sh new file mode 100755 index 00000000..030d29ca --- /dev/null +++ b/test/601_proxy_docker_py_test.sh @@ -0,0 +1,6 @@ +#! /bin/bash +# Explicitly not called _test.sh - this isn't run, but imported by other tests. + +. ./600_proxy_docker_py.sh + +docker_py_test 0 4 diff --git a/test/602_proxy_docker_py_test.sh b/test/602_proxy_docker_py_test.sh new file mode 100755 index 00000000..c73da5dc --- /dev/null +++ b/test/602_proxy_docker_py_test.sh @@ -0,0 +1,6 @@ +#! /bin/bash +# Explicitly not called _test.sh - this isn't run, but imported by other tests. + +. ./600_proxy_docker_py.sh + +docker_py_test 1 4 diff --git a/test/603_proxy_docker_py_test.sh b/test/603_proxy_docker_py_test.sh new file mode 100755 index 00000000..c48a4b07 --- /dev/null +++ b/test/603_proxy_docker_py_test.sh @@ -0,0 +1,6 @@ +#! /bin/bash +# Explicitly not called _test.sh - this isn't run, but imported by other tests. + +. ./600_proxy_docker_py.sh + +docker_py_test 2 4 diff --git a/test/604_proxy_docker_py_test.sh b/test/604_proxy_docker_py_test.sh new file mode 100755 index 00000000..fc7d9994 --- /dev/null +++ b/test/604_proxy_docker_py_test.sh @@ -0,0 +1,6 @@ +#! /bin/bash +# Explicitly not called _test.sh - this isn't run, but imported by other tests. + +. ./600_proxy_docker_py.sh + +docker_py_test 3 4