From 29249db5d295b72cd28f73550ff7727b34fd5c9a Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 2 Nov 2015 11:37:32 -0800 Subject: Big test stuff. --- tests/http/big-test-hosts | 4 ++++ tests/http/big-test-kill.sh | 30 ++++++++++++++++++++++++++++++ tests/http/big-test-start.sh | 30 ++++++++++++++++++++++++++++++ tests/http/run-a-big-test.sh | 28 ---------------------------- 4 files changed, 64 insertions(+), 28 deletions(-) create mode 100644 tests/http/big-test-hosts create mode 100755 tests/http/big-test-kill.sh create mode 100755 tests/http/big-test-start.sh delete mode 100755 tests/http/run-a-big-test.sh (limited to 'tests') diff --git a/tests/http/big-test-hosts b/tests/http/big-test-hosts new file mode 100644 index 00000000..27c0c656 --- /dev/null +++ b/tests/http/big-test-hosts @@ -0,0 +1,4 @@ +root@104.156.246.48 +root@104.156.252.136 +root@46.101.72.130 +root@188.166.240.16 diff --git a/tests/http/big-test-kill.sh b/tests/http/big-test-kill.sh new file mode 100755 index 00000000..fbb34c10 --- /dev/null +++ b/tests/http/big-test-kill.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Edit as needed -- note that >1000 per host is likely problematic due to Linux kernel limits +NUM_CONTAINERS=100 +CONTAINER_IMAGE=zerotier/http-test + +# +# This script is designed to be run on Docker hosts to run NUM_CONTAINERS +# +# It can then be run on each Docker host via pssh or similar to run very +# large scale tests. +# + +export PATH=/bin:/usr/bin:/usr/local/bin:/usr/sbin:/sbin + +# Kill and clean up old test containers if any -- note that this kills all containers on the system! +#docker ps -q | xargs -n 1 docker kill +#docker ps -aq | xargs -n 1 docker rm + +# Pull latest if needed -- change this to your image name and/or where to pull it from +#docker pull $CONTAINER_IMAGE + +# Run NUM_CONTAINERS +#for ((n=0;n<$NUM_CONTAINERS;n++)); do +# docker run --device=/dev/net/tun --privileged -d $CONTAINER_IMAGE +#done + +pssh -h big-test-hosts -i -p 256 "docker ps -q | xargs -r -n 128 docker kill && docker ps -aq | xargs -r -P 16 -n 1 docker rm" + +exit 0 diff --git a/tests/http/big-test-start.sh b/tests/http/big-test-start.sh new file mode 100755 index 00000000..79b6f93a --- /dev/null +++ b/tests/http/big-test-start.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Edit as needed -- note that >1000 per host is likely problematic due to Linux kernel limits +NUM_CONTAINERS=100 +CONTAINER_IMAGE=zerotier/http-test + +# +# This script is designed to be run on Docker hosts to run NUM_CONTAINERS +# +# It can then be run on each Docker host via pssh or similar to run very +# large scale tests. +# + +export PATH=/bin:/usr/bin:/usr/local/bin:/usr/sbin:/sbin + +# Kill and clean up old test containers if any -- note that this kills all containers on the system! +#docker ps -q | xargs -n 1 docker kill +#docker ps -aq | xargs -n 1 docker rm + +# Pull latest if needed -- change this to your image name and/or where to pull it from +#docker pull $CONTAINER_IMAGE + +# Run NUM_CONTAINERS +#for ((n=0;n<$NUM_CONTAINERS;n++)); do +# docker run --device=/dev/net/tun --privileged -d $CONTAINER_IMAGE +#done + +pssh -o big-test-out -h big-test-hosts -i -p 256 "docker pull $CONTAINER_IMAGE && for ((n=0;n<$NUM_CONTAINERS;n++)); do docker run --device=/dev/net/tun --privileged -d $CONTAINER_IMAGE; done" + +exit 0 diff --git a/tests/http/run-a-big-test.sh b/tests/http/run-a-big-test.sh deleted file mode 100755 index 1c125345..00000000 --- a/tests/http/run-a-big-test.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# Edit as needed -- note that >1000 per host is likely problematic due to Linux kernel limits -NUM_CONTAINERS=100 -CONTAINER_IMAGE=zerotier/http-test - -# -# This script is designed to be run on Docker hosts to run NUM_CONTAINERS -# -# It can then be run on each Docker host via pssh or similar to run very -# large scale tests. -# - -export PATH=/bin:/usr/bin:/usr/local/bin:/usr/sbin:/sbin - -# Kill and clean up old test containers if any -- note that this kills all containers on the system! -docker ps -q | xargs -n 1 docker kill -docker ps -aq | xargs -n 1 docker rm - -# Pull latest if needed -- change this to your image name and/or where to pull it from -docker pull $CONTAINER_IMAGE - -# Run NUM_CONTAINERS -for ((n=0;n<$NUM_CONTAINERS;n++)); do - docker run --device=/dev/net/tun --privileged -d $CONTAINER_IMAGE -done - -exit 0 -- cgit v1.2.3