-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP/2 functional tests #88
Comments
The h2spec tool provides a lot of tests for http2 connections and must be also used. It provides tests:
Utility is easy started: |
Tests for tempesta-tech/tempesta#1378 need folowing scenarios implemented:
For all scenarios above:
In all the cases read short as 'less than maximum allowed frame size', and long as 'bigger than allowed frame size'. Need to run tests with various allowed frame sizes: default frame size (16kb) and user settings (any value bigger than 16kb) |
Just faced HTTPX Python client for HTTP/2, see also https://pypi.org/project/httpx/ . Probably. it's the most easy way to test HTTP/2. Requires Python 3 though, so it will depend on #56 |
May be help python-hyper/h2 |
#164 implements tests for chunked modifications |
h2-frang-related tests (moved from tempesta-tech/tempesta#673).
|
|
|
Closed as completed |
The main part is that (also fix the disabled tests for the issue)
h2spec
rather than develop h2 layer in python in our own.DONE: Deproxy was extended to support http2 by commit 6e521d3
At least following new functional tests must be implemented for HTTP/2 (from more crucial to lower priority). It seems some of the tests are covered by
h2spec
and some of them are covered by already existing h2 tests:pipelining test for Handling non-idempotent requests in HTTP/2 tempesta#1619 , e.g. extending
pipelining/test_pipelining.py
with the scenario for HTTP/2Check that Tempesta generates correct static responses (e.g. 304)
Redirect (e.g. for JavaScript challenge) must be built with correct HTTP2 framing
Sticky cookie via h2 protocol, when multiple cookies are send by client (Sticky cookies doesn't work over h2 tempesta#1396)
Test POST request with a body (Missing Content-Length header field in transformed h2 to h1 request tempesta#1409)
A client sends data by 1-byte chunks to stress HTTP framing and parsing
Test that the same header (e.g. Host) is normally processed if different HPACK methods are used (only static index, only Huffman encoding, no HPACK at all (plain text)).
HPACK bomb
ALPN - establish
h2
andhttp/1.1
connections and make sure that the higher priority protocol is used if both of them are announced by a client and configured on the server.Verification of correct frames exchange during establishing of
h2
connection: get correctSETTINGS
frame (withSETTINGS_INITIAL_WINDOW_SIZE
parameter), correctWINDOW_UPDATE
frame and correctSETTINGS ACK
frame.Get response on
PING
frame.Basic HTTP/2 request, convert it to HTTP/1.1 request to a backend, and forward the response in HTTP/2 format.Co ered by any basic HTTP/2 test caseVerification of correct handling for connection and stream error cases: a) get valid
GOAWAY
frame in response on connection error case; b) get validRST_STREAM
frame in response on stream error situation (the whole connection must remain alive).Check correct stream processing inh2spec: http2/5.1HTTP2_STREAM_[LOC|REM]_CLOSED
state: 1. Instigate the stream error case for particular stream; 2. Send predefined amount of frames (service and application) for that stream - frames must be silently ignored by TempestaFW (i.e. frames must not be passed to backend, and errors must not be generated); 3. After the predefined amount of frames will be exceeded, TempestaFW must return connection error to client peer (GOAWAY frame) and close connection.Basic test for streams multiplexing: 1. Different HTTP/2 requests (i.e.
HEADERS
/CONTINUATION
/DATA
frames in each request) are sent in several streams - one by one, without waiting the responses; 2. And correct HTTP/2 responses must be received for each request/stream (regardless of the sending/receiving order). Do this in one and several TCP connections in parallel.Exceed number of allowed streams and check that RST is received
HPACK entries eviction: we must correctly process the maximum dynamic table and evict old entries - the test must define the table limit and send too many different headers
Emulate dynamic table size tracking bug on any of the peers: encoder thinks (incorrectly) that there is enough memory and add a new dynamic table entry sending in a request both the new and the oldest (evicted on Tempesta side) entries. Tempesta must correctly handle the encoding error.h2spec: http2/4.3 and hpack/2.3.3Performance/stress test with many concurrent TCP connections with many concurrent HTTP/2 streams. Use h2load from https://github.com/nghttp2/nghttp2 .
Fuzzing for various frame formats - we need to intensively test handling of invalid frames on different stream stage, not only initial frames.We have "some" HTTP/2 fuzzer in the functional tests Implementation of HTTP/2 fuzzer tempesta#1603Use small
SETTINGS_MAX_FRAME_SIZE
on a client and test that HTTP response headers and body are normally fragmentedTest case from HPACK dyn tables do not update special fields in req structure tempesta#1617 (also see discussion HPACK dyn tables do not update special fields in request tempesta#1635 (comment)) send a header with index 2 (static table for
:method GET
) ANDGET
as string value, i.e. use the full index in a partially indexed pseudoheader.Check correct processing of padded frames (formh2spec: generic3.1 and 3.2DATA
/HEADERS
frames with padding).Stream IDs: (1) check that even IDs and ID >
0x7fffffff
aren't accepted and (2) you cannot reuse old ID (see Victim 1–HTTP/2 Stream Multiplexing (CVE-2016-0150))Check that only allowed frames are successfully received on closed stream RFC 7540 5.1 closed paragraph.
Following existing HTTP/1 tests must be extended, i.e. each test must run twice in HTTP/1 and HTTP/2 modes correspondingly:
/cache - need to check that HTTP/1.1 response is correctly sent to HTTP/1.1 clients and transformed to HTTP/2 for HTTP/2 client.#810/malformedh2 malformed tests and review old #427/mixed_requestsThe text was updated successfully, but these errors were encountered: