Agent Mesh
Go a2aa2a-protocolagent-meshagentic-aiinferencemcpmeshmesh-networknetwork-securitynetworking-aip2p-network
Fix e2e tests
Tomas Tormod0cab35a7bb9
diff --git a/tests/e2e/lib/container_mesh.bash b/tests/e2e/lib/container_mesh.bashindex df8b5106..73668c14 100644--- a/tests/e2e/lib/container_mesh.bash+++ b/tests/e2e/lib/container_mesh.bash@@ -121,7 +121,7 @@ if [[ -z "${MESH_HELPERS_LOADED:-}" ]]; thenmesh_get_node_count_via_mcp() {local idx="$1"local output- output="$(timeout 15s docker run --rm --network "${MESH_NETWORK}" -v "$(pwd)/bin/mcp-client:/mcp-client" python:3.12 /mcp-client -url "http://sam-node-${idx}:8080/mcp/events" 2>/dev/null)"+ output="$(timeout 15s docker run --rm --network "${MESH_NETWORK}" -v "$(pwd)/bin/mcp-client:/mcp-client" python:3.12 /mcp-client -url "http://sam-node-${idx}:8080/mcp/events" -tool "get_mesh_info" 2>/dev/null)"echo "${output}" | jq '.known_peers | length'}@@ -132,7 +132,7 @@ if [[ -z "${MESH_HELPERS_LOADED:-}" ]]; thenlocal ifor ((i=0; i<timeout_s; i++)); dolocal output- output="$(timeout 15s docker run --rm --network "${MESH_NETWORK}" -v "$(pwd)/bin/mcp-client:/mcp-client" python:3.12 /mcp-client -url "http://sam-node-${idx}:8080/mcp/events" 2>/dev/null)"+ output="$(timeout 15s docker run --rm --network "${MESH_NETWORK}" -v "$(pwd)/bin/mcp-client:/mcp-client" python:3.12 /mcp-client -url "http://sam-node-${idx}:8080/mcp/events" -tool "get_mesh_info" 2>/dev/null)"echo "Node ${idx} get_mesh_info raw output: ${output}"local countcount="$(echo "${output}" | jq '.known_peers | length')"@@ -152,7 +152,7 @@ if [[ -z "${MESH_HELPERS_LOADED:-}" ]]; thenlocal ifor ((i=0; i<timeout_s; i++)); dolocal output- output="$(timeout 15s docker run --rm --network "${MESH_NETWORK}" -v "$(pwd)/bin/mcp-client:/mcp-client" python:3.12 /mcp-client -url "http://sam-node-${idx}:8080/mcp/events" 2>/dev/null)"+ output="$(timeout 15s docker run --rm --network "${MESH_NETWORK}" -v "$(pwd)/bin/mcp-client:/mcp-client" python:3.12 /mcp-client -url "http://sam-node-${idx}:8080/mcp/events" -tool "get_mesh_info" 2>/dev/null)"echo "[$(date +%T)] Node ${idx} get_mesh_info raw output: ${output}"local connectedconnected="$(echo "${output}" | jq -r --arg peer "$target_peer" '.connected_peers | index($peer) != null')"@@ -172,7 +172,7 @@ if [[ -z "${MESH_HELPERS_LOADED:-}" ]]; thenlocal ifor ((i=0; i<timeout_s; i++)); dolocal output- output="$(timeout 15s docker run --rm --network "${MESH_NETWORK}" -v "$(pwd)/bin/mcp-client:/mcp-client" python:3.12 /mcp-client -url "http://sam-node-${idx}:8080/mcp/events" 2>/dev/null)"+ output="$(timeout 15s docker run --rm --network "${MESH_NETWORK}" -v "$(pwd)/bin/mcp-client:/mcp-client" python:3.12 /mcp-client -url "http://sam-node-${idx}:8080/mcp/events" -tool "get_mesh_info" 2>/dev/null)"echo "[$(date +%T)] Node ${idx} get_mesh_info raw output: ${output}"local connectedconnected="$(echo "${output}" | jq -r --arg peer "$target_peer" '.connected_peers | index($peer) != null')"diff --git a/tests/e2e/policy.bats b/tests/e2e/policy.batsindex 69cde7b9..c822dfa8 100644--- a/tests/e2e/policy.bats+++ b/tests/e2e/policy.bats@@ -239,7 +239,7 @@ EOF"for ((i=0; i<30; i++)); dolocal output- output="$(docker run --rm --network "${MESH_NETWORK}" -v "$(pwd)/bin/mcp-client:/mcp-client" python:3.12 /mcp-client -url "http://sam-node-2:8080/mcp/events" 2>/dev/null)"+ output="$(docker run --rm --network "${MESH_NETWORK}" -v "$(pwd)/bin/mcp-client:/mcp-client" python:3.12 /mcp-client -url "http://sam-node-2:8080/mcp/events" -tool "get_mesh_info" 2>/dev/null)"TARGET_PEER_ID=$(echo "${output}" | grep -oE '12D3Koo[a-zA-Z0-9]+' | grep -v "${hub_id}" | grep -v "${node2_id}" | head -n 1)if [[ -n "${TARGET_PEER_ID}" ]]; thenbreak