Review Feedback

This commit is contained in:
Tom Wilkie
2015-09-30 12:56:03 +00:00
parent af4a35c67d
commit 88686b5c6c
6 changed files with 13 additions and 16 deletions

View File

@@ -7,7 +7,7 @@ start_suite "Launch scope and check it boots"
weave_on $HOST1 launch
scope_on $HOST1 launch
sleep 5
sleep 5 # give the probe a few seconds to build a report and send it to the app
has_container $HOST1 weave 1
has_container $HOST1 weaveproxy 1

View File

@@ -6,7 +6,7 @@ start_suite "Launch scope (without weave installed) and check it boots"
scope_on $HOST1 launch
sleep 5
sleep 5 # give the probe a few seconds to build a report and send it to the app
has_container $HOST1 weave 0
has_container $HOST1 weaveproxy 0

View File

@@ -7,15 +7,13 @@ start_suite "Launch 2 scopes and check they cluster automatically"
weave_on $HOST1 launch $HOST1 $HOST2
weave_on $HOST2 launch $HOST1 $HOST2
sleep 10 # let weave settle
scope_on $HOST1 launch
scope_on $HOST2 launch
docker_on $HOST1 run -dit --name db1 peterbourgon/tns-db
docker_on $HOST2 run -dit --name db2 peterbourgon/tns-db
sleep 30
sleep 30 # need to allow the scopes to poll dns, resolve the other app ids, and send them reports
check() {
has_container $1 weave 2

View File

@@ -10,7 +10,7 @@ scope_on $HOST2 launch $HOST1 $HOST2
docker_on $HOST1 run -dit --name db1 peterbourgon/tns-db
docker_on $HOST2 run -dit --name db2 peterbourgon/tns-db
sleep 30
sleep 30 # need to allow the scopes to poll dns, resolve the other app ids, and send them reports.
check() {
has_container $1 weave 0

View File

@@ -18,17 +18,17 @@ RUNNER="$WEAVE_ROOT/testing/runner/runner"
. "$WEAVE_ROOT/test/config.sh"
scope_on() {
local host=$1
shift 1
[ -z "$DEBUG" ] || greyly echo "Scope on $host: $@" >&2
DOCKER_HOST=tcp://$host:$DOCKER_PORT $SCOPE "$@"
local host=$1
shift 1
[ -z "$DEBUG" ] || greyly echo "Scope on $host: $@" >&2
DOCKER_HOST=tcp://$host:$DOCKER_PORT $SCOPE "$@"
}
weave_on() {
local host=$1
shift 1
[ -z "$DEBUG" ] || greyly echo "Weave on $host: $@" >&2
DOCKER_HOST=tcp://$host:$DOCKER_PORT $WEAVE "$@"
local host=$1
shift 1
[ -z "$DEBUG" ] || greyly echo "Weave on $host: $@" >&2
DOCKER_HOST=tcp://$host:$DOCKER_PORT $WEAVE "$@"
}
# this checks we have a weavescope container

3
scope
View File

@@ -20,7 +20,6 @@ fi
IMAGE_VERSION=${VERSION:-$IMAGE_VERSION}
SCOPE_IMAGE=weaveworks/scope:$IMAGE_VERSION
SCOPE_CONTAINER_NAME=weavescope
DOCKER_BRIDGE=${DOCKER_BRIDGE:-docker0}
IP_REGEXP="[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"
IP_ADDR_CMD="find /sys/class/net -type l | xargs -n1 basename | grep -vE 'docker|veth|lo' | \
xargs -n1 ip addr show | grep inet | awk '{ print \$2 }' | grep -oE '$IP_REGEXP'"
@@ -70,7 +69,7 @@ case "$COMMAND" in
echo $CONTAINER
if ! echo "$@" | grep -E "\-\-no\-app|\-\-service\-token" 1>/dev/null; then
IP_ADDRS=$(docker run --rm --net=host --entrypoint /bin/sh $SCOPE_IMAGE -c "$IP_ADDR_CMD")
IP_ADDRS=$(docker run --rm --net=host --entrypoint /bin/sh $SCOPE_IMAGE -c "$IP_ADDR_CMD")
echo "Weave Scope is reachable at the following URL(s):" >&2
for ip in $IP_ADDRS; do
echo " * http://$ip:4040/" >&2