From: Amaury Denoyelle Date: Mon, 1 Jun 2026 16:27:26 +0000 (+0200) Subject: REGTESTS: add basic QMux tests X-Git-Tag: v3.4.0~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c9e4b0d187a568f0916303f450425dc64978bf4;p=thirdparty%2Fhaproxy.git REGTESTS: add basic QMux tests Write two simple QMux tests, for http/3 in SSL and clear. --- diff --git a/reg-tests/qmux/certs b/reg-tests/qmux/certs new file mode 120000 index 000000000..9b744ba4f --- /dev/null +++ b/reg-tests/qmux/certs @@ -0,0 +1 @@ +../ssl/certs \ No newline at end of file diff --git a/reg-tests/qmux/h3.vtc b/reg-tests/qmux/h3.vtc new file mode 100644 index 000000000..9182e5809 --- /dev/null +++ b/reg-tests/qmux/h3.vtc @@ -0,0 +1,39 @@ +varnishtest "HTTP/3 over QMux" +feature ignore_unknown_macro + +# TODO to adjust once QMux compilation is QUIC/SSL free +feature cmd "$HAPROXY_PROGRAM -cc 'feature(QUIC) && !feature(QUIC_OPENSSL_COMPAT) && !feature(OPENSSL_WOLFSSL) && ssllib_name_startswith(OpenSSL) && openssl_version_atleast(1.1.1)'" + +haproxy h1 -conf { + global + .if feature(THREAD) + thread-groups 1 + .endif + expose-experimental-directives + ssl-server-verify none + + defaults + mode http + timeout connect "${HAPROXY_TEST_TIMEOUT-5s}" + timeout client "${HAPROXY_TEST_TIMEOUT-5s}" + timeout server "${HAPROXY_TEST_TIMEOUT-5s}" + + frontend fterm + bind "fd@${fterm}" ssl crt ${testdir}/certs/common.pem alpn h3 + http-request return status 200 hdr x-alpn %[ssl_fc_alpn] hdr x-ver %[req.ver] + + frontend fpub + bind "fd@${fpub}" proto h1 + use_backend be + + backend be + server hap ${h1_fterm_addr}:${h1_fterm_port} ssl alpn h3 +} -start + +client c1 -connect ${h1_fpub_sock} { + txreq + rxresp + expect resp.status == 200 + expect resp.http.x-alpn == "h3" + expect resp.http.x-ver == "3.0" +} -run diff --git a/reg-tests/qmux/h3_clr.vtc b/reg-tests/qmux/h3_clr.vtc new file mode 100644 index 000000000..364e180bd --- /dev/null +++ b/reg-tests/qmux/h3_clr.vtc @@ -0,0 +1,38 @@ +varnishtest "HTTP/3 over clear QMux" +feature ignore_unknown_macro + +# TODO to adjust once QMux compilation is QUIC/SSL free +feature cmd "$HAPROXY_PROGRAM -cc 'feature(QUIC) && !feature(QUIC_OPENSSL_COMPAT) && !feature(OPENSSL_WOLFSSL) && ssllib_name_startswith(OpenSSL) && openssl_version_atleast(1.1.1)'" +feature cmd "$HAPROXY_PROGRAM -cc 'version_atleast(3.4-dev14)'" + +haproxy h1 -conf { + global + .if feature(THREAD) + thread-groups 1 + .endif + expose-experimental-directives + + defaults + mode http + timeout connect "${HAPROXY_TEST_TIMEOUT-5s}" + timeout client "${HAPROXY_TEST_TIMEOUT-5s}" + timeout server "${HAPROXY_TEST_TIMEOUT-5s}" + + frontend fterm + bind "fd@${fterm}" proto qmux + http-request return status 200 hdr x-ver %[req.ver] + + frontend fpub + bind "fd@${fpub}" proto h1 + use_backend be + + backend be + server hap ${h1_fterm_addr}:${h1_fterm_port} proto qmux +} -start + +client c1 -connect ${h1_fpub_sock} { + txreq + rxresp + expect resp.status == 200 + expect resp.http.x-ver == "3.0" +} -run