]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REGTESTS: add QUIC test for max-total streams setting
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 15 Apr 2026 12:33:45 +0000 (14:33 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 15 Apr 2026 13:18:37 +0000 (15:18 +0200)
Add a new QUIC regtest to test the new frontend stream.max-total
setting.

This test relies on two haproxy instances, as QUIC client and server.
New setting stream.max-total is set to 3 on the server side. In total, 6
requests are performed, with a check to ensure that a new connection has
been reopened for the last ones.

reg-tests/quic/stream_max_total.vtc [new file with mode: 0644]

diff --git a/reg-tests/quic/stream_max_total.vtc b/reg-tests/quic/stream_max_total.vtc
new file mode 100644 (file)
index 0000000..1b7c1dd
--- /dev/null
@@ -0,0 +1,69 @@
+varnishtest "Test tune.quic.fe.stream_max_total setting"
+feature ignore_unknown_macro
+
+# QUIC backend are not supported with USE_QUIC_OPENSSL_COMPAT
+feature cmd "$HAPROXY_PROGRAM -cc 'feature(QUIC) && !feature(QUIC_OPENSSL_COMPAT) && !feature(OPENSSL_WOLFSSL)'"
+
+haproxy ha_qsrv -conf {
+       global
+               tune.quic.fe.stream.max-total 3
+
+       defaults
+               mode http
+               timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+               timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+               timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
+
+       listen li
+               bind "quic+fd@${fe_quic}" ssl crt ${testdir}/certs/common.pem
+               http-request return status 200 hdr x-id %[fs.id]
+} -start
+
+haproxy ha_qcli -conf {
+       global
+               expose-experimental-directives
+
+       defaults
+               mode http
+               timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
+               timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
+               timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
+
+       listen li
+               bind "fd@${fe}"
+               http-reuse always
+               server quic quic4@${ha_qsrv_fe_quic_addr}:${ha_qsrv_fe_quic_port} ssl verify none
+} -start
+
+client c1 -connect ${ha_qcli_fe_sock} {
+       txreq
+       rxresp
+       expect resp.status == 200
+       expect resp.http.x-id == 0
+
+       txreq
+       rxresp
+       expect resp.status == 200
+       expect resp.http.x-id == 4
+
+       txreq
+       rxresp
+       expect resp.status == 200
+       expect resp.http.x-id == 8
+
+       # max-stream reached, stream ID should be resetted
+       txreq
+       rxresp
+       expect resp.status == 200
+       expect resp.http.x-id == 0
+
+       txreq
+       rxresp
+       expect resp.status == 200
+       expect resp.http.x-id == 4
+
+       txreq
+       rxresp
+       expect resp.status == 200
+       expect resp.http.x-id == 8
+} -run