mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-24 07:46:41 +00:00
Add tests for short-lived connection between hosts and containers.
This commit is contained in:
18
integration/310_container_to_container_edge_test.sh
Executable file
18
integration/310_container_to_container_edge_test.sh
Executable 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
|
||||
27
integration/320_container_edge_cross_host_2_test.sh
Executable file
27
integration/320_container_edge_cross_host_2_test.sh
Executable 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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user