#!/usr/bin/env bash # 15-minute fuzz for each required target. Exit 0 only if every target PASS. set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" cd "$ROOT" export PATH="/data/prod2u/opt/go1.25.13/bin:/opt/python-3.12/bin:/usr/bin:/bin:${PATH}" export GOTOOLCHAIN="${GOTOOLCHAIN:-local}" export GOROOT="${GOROOT:-/data/prod2u/opt/go1.25.13}" SEC="${HTH_FUZZ_SECONDS:-900}" fail=0 run_one() { local name="$1" shift echo "=== ${name} fuzztime=${SEC}s ===" if ! "$@"; then echo "FAIL ${name}" fail=1 fi } run_one fuzz-parser go test ./internal/protocol -fuzz=FuzzParser -fuzztime="${SEC}s" run_one fuzz-profile go test ./internal/profile -fuzz=FuzzLoadStrict -fuzztime="${SEC}s" run_one fuzz-config go test ./internal/config -fuzz=FuzzLoadYAML -fuzztime="${SEC}s" run_one fuzz-assemble go test ./internal/safety -fuzz=FuzzAssemble -fuzztime="${SEC}s" run_one fuzz-telemetry go test ./internal/telemetry -fuzz=FuzzResumeIDs -fuzztime="${SEC}s" run_one fuzz-capture go test ./internal/capture -fuzz=FuzzReadRecords -fuzztime="${SEC}s" run_one fuzz-replay go test ./internal/backend -fuzz=FuzzReplayOpen -fuzztime="${SEC}s" run_one fuzz-sdk-descriptor env HTH_FUZZ_SECONDS="${SEC}" python3.12 -m pytest -q sdk/python/tests/test_descriptor_fuzz.py exit "${fail}"