REGTESTS: http-messaging: add tests for the H2 and H3 trailers
Two new tests cover the trailers parsers of the H2 and the H3 muxes, so
that any change to these parsers can be checked against the current
behaviour.
h2_trailers.vtc checks that valid trailers are forwarded with their
leading and trailing spaces removed, on the request as well as on the
response path, and that all the trailers rejected by the parser cause
the stream to be reset: literal and indexed pseudo-headers, upper case
letters and non-token characters in the names, NUL/CR/LF in the values,
and the fields affecting the message framing or the routing.
Since vtest doesn't speak H3, h3_trailers.vtc stacks two HTTP layers in
the same haproxy: the H2 requests emitted by vtest are converted to H3
and sent over a local qmux connection to a second frontend which
converts them back to H2 for the vtest servers. Only valid trailers are
checked there because the invalid ones cannot reach the H3 parser: HTX
lower cases the trailer names and the H3 mux drops the trailers which
are forbidden on the wire.
A few notes about the tricks used in these tests:
- a trailers frame is emitted using "txreq -noadd", which sends a
HEADERS frame with ES+EH set and no pseudo-header at all ;
- trailers vtest cannot encode (a NUL in a value) or decode (an empty
value as the last field) are crafted by hand with sendhex ;
- haproxy doesn't ack the settings of an H2 server before it has
something else to send, so the servers must not wait for that ack ;
- the window update emitted after the request headers is consumed
before sending invalid trailers, so that the reset is necessarily
the next frame to be received ;
- "option http-buffer-request" makes sure the invalid trailers are
detected while the stream is still open and that no server is
involved.