diff --git a/integration/311_container_to_container_edge_with_ebpf_test.sh b/integration/311_container_to_container_edge_with_ebpf_test.sh index 8d3356e2e..7c66be7b9 100755 --- a/integration/311_container_to_container_edge_with_ebpf_test.sh +++ b/integration/311_container_to_container_edge_with_ebpf_test.sh @@ -17,6 +17,10 @@ wait_for_containers "$HOST1" 60 nginx client has_container "$HOST1" nginx has_container "$HOST1" client + +list_containers "$HOST1" +list_connections "$HOST1" + has_connection containers "$HOST1" client nginx endpoints_have_ebpf "$HOST1" diff --git a/integration/312_container_to_container_edge_same_netns_with_ebpf_test.sh b/integration/312_container_to_container_edge_same_netns_with_ebpf_test.sh index 828c35dcf..820114e9a 100755 --- a/integration/312_container_to_container_edge_same_netns_with_ebpf_test.sh +++ b/integration/312_container_to_container_edge_same_netns_with_ebpf_test.sh @@ -13,6 +13,10 @@ wait_for_containers "$HOST1" 60 nginx client has_container "$HOST1" nginx has_container "$HOST1" client + +list_containers "$HOST1" +list_connections "$HOST1" + has_connection containers "$HOST1" client nginx endpoints_have_ebpf "$HOST1" diff --git a/integration/config.sh b/integration/config.sh index 99f5cdf74..72eb51fdf 100644 --- a/integration/config.sh +++ b/integration/config.sh @@ -40,6 +40,19 @@ scope_end_suite() { done } +list_containers() { + local host=$1 + echo "Listing containers on ${host}:" + curl -s "http://${host}:4040/api/topology/containers?system=show" | jq -r '.nodes[] | select(has("metadata")) | .metadata[] | select(.id == "docker_image_name") | .value' +} + +list_connections() { + local host=$1 + echo "Listing connections on ${host}:" + curl -s "http://${host}:4040/api/topology/containers?system=show" | jq -r '.nodes[] | select(has("adjacency")) | { "from": .id, "to": .adjacency[]} | .from + " -> " + .to' + +} + # this checks we have a named node in the given view has() { local view=$1 @@ -111,6 +124,8 @@ endpoints_have_ebpf() { done echo "Only ${have_ebpf} endpoints of ${number_of_endpoints} have ebpf enabled, should be equal" + echo "Example of one endpoint:" + echo "${report}" | jq -r '[.Endpoint.nodes[]][0]' assert "echo '$have_ebpf" "$number_of_endpoints" }