From f6835e433cbd93154512bb7f6828e7b81fd692f6 Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Tue, 22 Mar 2016 17:21:49 +0000 Subject: [PATCH 1/2] Fix bug in container image reporting, strip the prefix off when adding image to the registry --- probe/docker/registry.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/probe/docker/registry.go b/probe/docker/registry.go index a7383937e..b9e63c8c6 100644 --- a/probe/docker/registry.go +++ b/probe/docker/registry.go @@ -230,7 +230,7 @@ func (r *registry) updateImages() error { for i := range images { image := &images[i] - r.images[image.ID] = image + r.images[trimImageID(image.ID)] = image } return nil From 55d84bfa0259fbdd18a08b6bd86fb0028470e215 Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Tue, 22 Mar 2016 17:23:50 +0000 Subject: [PATCH 2/2] Add integration test for non-empty topologies. --- integration/115_topologies_test.sh | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 integration/115_topologies_test.sh diff --git a/integration/115_topologies_test.sh b/integration/115_topologies_test.sh new file mode 100755 index 000000000..6a2753a01 --- /dev/null +++ b/integration/115_topologies_test.sh @@ -0,0 +1,36 @@ +#! /bin/bash + +. ./config.sh + +start_suite "Test some key topologies are not empty" + +scope_on $HOST1 launch + +wait_for_containers $HOST1 60 weavescope + +topology_is_not_empty() { + local host="$1" + local topology="$2" + local timeout="${5:-60}" + + for i in $(seq $timeout); do + local report="$(curl -s http://$host:4040/api/report)" + local count=$(echo "$report" | jq -r ".$topology.nodes | length > 0" 2>/dev/null) + if [ "$count" = "true" ]; then + assert "curl -s http://$host:4040/api/report | jq -r '.$topology.nodes | length > 0'" true + return + fi + sleep 1 + done + + echo "Failed to find any nodes in the $topology topology after $timeout secs" + assert "curl -s http://$host:4040/api/report | jq -r '.$topology.nodes | length > 0'" true +} + +topology_is_not_empty $HOST1 Endpoint +topology_is_not_empty $HOST1 Process +topology_is_not_empty $HOST1 Container +topology_is_not_empty $HOST1 ContainerImage +topology_is_not_empty $HOST1 Host + +scope_end_suite