mirror of
https://github.com/weaveworks/scope.git
synced 2026-04-20 01:17:09 +00:00
Add integration test for non-empty topologies.
This commit is contained in:
36
integration/115_topologies_test.sh
Executable file
36
integration/115_topologies_test.sh
Executable file
@@ -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
|
||||
Reference in New Issue
Block a user