[bench] Conformance: the slow-client probes (a TLS handshake that never starts, an HTTP/2 header block that never ends) against both engines, and Caddy's real version from the binary's build info

This commit is contained in:
2026-11-22 19:04:59 +01:00
parent 142f0bedf7
commit facf4422c8
2 changed files with 42 additions and 6 deletions
+13 -1
View File
@@ -18,7 +18,7 @@ set -euo pipefail
root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
out="$root/bench/conformance"
mkdir -p "$out"
for tool in caddy h2spec jq; do
for tool in caddy h2spec jq; do # and python3 for the slow-client probes, when present
command -v "$tool" >/dev/null || { echo "missing: $tool" >&2; exit 2; }
done
testssl=$(command -v testssl.sh || command -v testssl || true)
@@ -60,6 +60,18 @@ for engine in ianitor caddy; do
grade=$(jq -r '[.[] | select(.id=="overall_grade")][0].finding // "n/a"' "$out/$engine-testssl.json" 2>/dev/null || echo n/a)
bad=$(jq -r '[.[] | select(.severity=="HIGH" or .severity=="CRITICAL")] | length' "$out/$engine-testssl.json" 2>/dev/null || echo "?")
printf '%-10s %-8s %s\n' "$engine" testssl "grade $grade, $bad findings HIGH or CRITICAL"
# Slow clients (QC phase 4, tests/support/probes): a TLS handshake that never starts, and an
# HTTP/2 header block that never ends; how long each engine keeps them open (75 s at most).
if command -v python3 >/dev/null; then
probes="$root/tests/support/probes"
python3 "$probes/slow.py" 127.0.0.1 "$p" idle 75 localhost >"$out/$engine-slow-idle.txt" 2>&1 &
a=$!
python3 "$probes/h2slow.py" 127.0.0.1 "$p" 75 localhost >"$out/$engine-slow-h2.txt" 2>&1 &
b=$!
wait $a $b || true
printf '%-10s %-8s %s\n' "$engine" slow "$(cut -d';' -f1 "$out/$engine-slow-idle.txt" | head -1); $(cut -d';' -f1 "$out/$engine-slow-h2.txt" | head -1)"
fi
done
# A case Caddy passes and Ianitor fails is a regression against the fallback.