Add HTTP/1.1 wire tests for One’s server

Closed
HA
2d ago
+224-6

Description

Adds a one.http.wire CTest target that sends raw HTTP/1.1 requests over loopback to a test-only echo server built with One’s HTTPServer, HTTPRequest, and HTTPResponse wrappers. The tests establish a baseline for evaluating future HTTP parser changes.

The seven cases cover request-target parsing, requests split across writes, fixed-length binary bodies, chunked bodies, rejection of a missing Host header, and payloads at and above the configured body limit. The cases were written against RFC 9112 and informed by the h1spec revision pinned by uWebSockets. The test README documents the selected coverage and exclusions.

The fixture binds to an OS-assigned loopback port, announces readiness, and shuts down after the run. The runner bounds request and shutdown waits. The existing CTest job picks up the suite when server tests are enabled.

Validation

  • Built the test fixture and compiled the production server translation unit with GCC 14.2.
  • All seven cases passed across 20 consecutive CTest runs.
  • A deliberately incorrect expected response body caused CTest to fail as intended.
  • Formatting, JavaScript syntax, and whitespace checks passed.
  • Full Docker CI and macOS runtime verification remain pending.