Browse Source

Big test stuff.

Adam Ierymenko 9 years ago
parent
commit
29249db5d2
3 changed files with 42 additions and 6 deletions
  1. 4 0
      tests/http/big-test-hosts
  2. 8 6
      tests/http/big-test-kill.sh
  3. 30 0
      tests/http/big-test-start.sh

+ 4 - 0
tests/http/big-test-hosts


+ 8 - 6
tests/http/run-a-big-test.sh → tests/http/big-test-kill.sh

@@ -14,15 +14,17 @@ CONTAINER_IMAGE=zerotier/http-test
 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
+#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
+#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
+#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

+ 30 - 0
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