Add tests for short-lived connection between hosts and containers.

This commit is contained in:
Tom Wilkie
2015-10-05 11:48:37 +00:00
parent 2a077ff47e
commit 8aa7b37e7e
3 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
#! /bin/bash
. ./config.sh
start_suite "Test short lived connections between containers"
weave_on $HOST1 launch
scope_on $HOST1 launch
weave_on $HOST1 run -d --name nginx nginx
weave_on $HOST1 run -d --name client alpine /bin/sh -c "while true; do wget http://nginx.weave.local:80/ >/dev/null; sleep 1; done"
sleep 20 # give the probe a few seconds to build a report and send it to the app
has_container $HOST1 nginx 1
has_container $HOST1 client 1
has_connection $HOST1 client nginx
scope_end_suite

View File

@@ -0,0 +1,27 @@
#! /bin/bash
. ./config.sh
start_suite "Test short lived connections between containers on different hosts"
weave_on $HOST1 launch $HOST1 $HOST2
weave_on $HOST2 launch $HOST1 $HOST2
scope_on $HOST1 launch
scope_on $HOST2 launch
weave_on $HOST1 run -d --name nginx nginx
weave_on $HOST2 run -d --name client alpine /bin/sh -c "while true; do wget http://nginx.weave.local:80/ >/dev/null; sleep 1; done"
sleep 30 # need to allow the scopes to poll dns, resolve the other app ids, and send them reports
check() {
has_container $1 nginx 1
has_container $1 client 1
has_connection $1 client nginx
}
check $HOST1
check $HOST2
scope_end_suite

View File

@@ -21,6 +21,7 @@ echo Prefetching Images
for HOST in $HOSTS; do
weave_on $HOST setup
docker_on $HOST pull peterbourgon/tns-db
docker_on $HOST pull alpine
done
curl -sL git.io/weave -o ./weave