Files
weave-scope/integration/300_internet_edge_test.sh
2016-03-03 20:22:47 +00:00

32 lines
623 B
Bash
Executable File

#! /bin/bash
. ./config.sh
start_suite "Test short lived connections from the Internet"
if ! echo "$HOST1" | grep "us-central1-a"; then
echo "Skipping; test needs to be run against VMs on GCE."
scope_end_suite
exit
fi
weave_on $HOST1 launch
scope_on $HOST1 launch
docker_on $HOST1 run -d -p 80:80 --name nginx nginx
do_connections() {
while true; do
curl -s http://$HOST1:80/ >/dev/null || true
sleep 1
done
}
do_connections&
wait_for_containers $HOST1 60 nginx "The Internet"
has_connection_by_id containers $HOST1 "in-theinternet" $(node_id containers $HOST1 nginx)
kill %do_connections
scope_end_suite