diff --git a/test/101_cross_hosts_2_test.sh b/test/101_cross_hosts_2_test.sh index 70039b2b..bc345eaa 100755 --- a/test/101_cross_hosts_2_test.sh +++ b/test/101_cross_hosts_2_test.sh @@ -24,5 +24,6 @@ weave_on $HOST2 attach $C2/24 c2 wait_for_x network_tester_status "network tester status" assert "echo $status" "pass" +assert "connections_metric $HOST1 state=\\\"established\\\"" "1" end_suite diff --git a/test/config.sh b/test/config.sh index 29958867..fd239b10 100644 --- a/test/config.sh +++ b/test/config.sh @@ -267,6 +267,10 @@ wait_for_attached() { wait_for_x "check_attached $1 $2" "$2 on $1 to be attached" } +connections_metric() { + $SSH $1 curl -sS http://127.0.0.1:6784/metrics | awk -e "/^weave_connections.*$2/ { print \$2 }" +} + # assert_dns_record [ ...] assert_dns_record() { local host=$1