add should comments to assertions

This commit is contained in:
Steffen Vogel 2021-07-16 13:31:31 +02:00
parent c2d92181c8
commit 5f6507972a

View File

@ -9,16 +9,18 @@ setup_suite() {
}
test_graph_handler() {
assert "curl_pod http://10.4.0.1:1107/graph?format=svg&layout=circo | grep -q '<svg'"
assert "curl_pod http://10.4.0.1:1107/graph?layout=circo | grep -q '<svg'"
assert "curl_pod http://10.4.0.1:1107/graph | grep -q '<svg'"
assert _not "curl_pod http://10.4.0.1:1107/graph?format=svg&layout=fake | grep -q '<svg'"
assert "curl_pod http://10.4.0.1:1107/graph?format=svg&layout=circo | grep -q '<svg'" "graph handler should produce SVG output"
assert "curl_pod http://10.4.0.1:1107/graph?layout=circo | grep -q '<svg'" "graph handler should default to SVG output"
assert "curl_pod http://10.4.0.1:1107/graph | grep -q '<svg'" "graph handler should default to SVG output"
assert _not "curl_pod http://10.4.0.1:1107/graph?layout=fake | grep -q '<svg'" "graph handler should reject invalid layout"
assert _not "curl_pod http://10.4.0.1:1107/graph?format=fake | grep -q '<svg'" "graph handler should reject invalid format"
}
test_health_handler() {
assert "curl_pod http://10.4.0.1:1107/health"
assert "curl_pod http://10.4.0.1:1107/health" "health handler should return a status code of 200"
}
test_metrics_handler() {
assert "curl_pod http://10.4.0.1:1107/metrics"
assert "curl_pod http://10.4.0.1:1107/metrics" "metrics handler should return a status code of 200"
assert "(( $(curl_pod http://10.4.0.1:1107/metrics | egrep ^kilo_nodes | cut -d " " -f 2) > 0 ))" "metrics handler should provide metric: kilo_nodes > 0"
}