Add a check for correct metrics in smoke-test

This commit is contained in:
Bryan Boreham committed 2020-07-30 10:25:14 +00:00
1 parent 2deb7e2e48
commit f6a3af4a10
2 files changed
+5

No files matched your search

+1
View File
@@ -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
+4
View File
@@ -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 <host> <container> <name> [<ip> ...]
assert_dns_record() {
local host=$1