Zero-dependency Python 3.11+ single file. 16 failure modes selectable by
URL path and combinable with '+': no-range, lies-about-accept-ranges,
etag-changes, flaky-reset (TCP RST mid-body, clean on the 3rd try),
slow-loris, redirect-chain, 401-basic, 401-digest, 403-without-referer,
416-always, content-length-mismatch, expiring-signed-url, throttled,
chunked-no-length, utf8/legacy content-disposition. Deterministic
synthetic bodies (byte i = f(seed, path, i)) with a /sha256/ reference
route so any range is independently verifiable. /__control {"reset":true}
clears flaky-mode counters between cases.
selftest.py exercises every mode (43 checks) and is registered as the
`testserver_selftest` CTest. README documents the full surface — CORE's
M1 DoD is written against it.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HPPSGhiArbvQgwC2DNiURS
22 lines
603 B
CMake
22 lines
603 B
CMake
# tools/testserver — no build, just register the self-test with CTest so a broken
|
|
# hostile-mode contract is caught in CI, not in a CORE debugging session.
|
|
|
|
if(NOT VELOX_BUILD_TESTS)
|
|
return()
|
|
endif()
|
|
|
|
find_package(Python3 3.11 COMPONENTS Interpreter)
|
|
if(NOT Python3_Interpreter_FOUND)
|
|
message(WARNING "testserver: Python 3.11+ not found; skipping its self-test.")
|
|
return()
|
|
endif()
|
|
|
|
add_test(
|
|
NAME testserver_selftest
|
|
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/selftest.py
|
|
)
|
|
set_tests_properties(testserver_selftest PROPERTIES
|
|
LABELS "tools;qa"
|
|
TIMEOUT 120
|
|
)
|