]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REGTESTS: http-messaging: fix the websocket and upgrade tests not to close early
authorWilly Tarreau <w@1wt.eu>
Tue, 7 Oct 2025 15:03:35 +0000 (17:03 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 8 Oct 2025 08:29:41 +0000 (10:29 +0200)
By default when building an H2 request, vtest sets the END_STREAM flag
on the HEADERS frame. This is problematic with the websocket and proto
upgrade tests since we're using CONNECT, because it immediately closes
afterwards, which does not correspond to what we're testing. Doing this
in abortonclose mode rightfully produces an error. Let's fix the test
so as not to set the flag on the HEADERS frame. However, doing so means
we'll receive a window update that we must also accept. Now the test
works both with and without abortonclose.

reg-tests/http-messaging/protocol_upgrade.vtc
reg-tests/http-messaging/websocket.vtc

index 46418a74913b6431ba49ae203e855d4351fef6a4..2fe65e7173e777fe0b7a7b4de8e7791bf8dc57d8 100644 (file)
@@ -232,8 +232,10 @@ client c2_h2 -connect ${hap_frt_h2_sock} {
                  -scheme "http" \
                  -url "/" \
                  -hdr ":authority" "127.0.0.1" \
-                 -hdr ":protocol" "custom_protocol"
+                 -hdr ":protocol" "custom_protocol" \
+                 -nostrend
 
+               rxwinup
                rxhdrs
                expect resp.status == 200
        } -run
@@ -256,8 +258,10 @@ client c3_h2_h1 -connect ${hap_frt_h2_h1_sock} {
                  -scheme "http" \
                  -url "/" \
                  -hdr ":authority" "127.0.0.1" \
-                 -hdr ":protocol" "custom_protocol"
+                 -hdr ":protocol" "custom_protocol" \
+                 -nostrend
 
+               rxwinup
                rxhdrs
                expect resp.status == 200
        } -run
@@ -348,7 +352,8 @@ client c9_h2c -connect ${hap_frt_h2_h1_sock} {
                  -scheme "http" \
                  -url "/" \
                  -hdr ":authority" "127.0.0.1" \
-                 -hdr ":protocol" "h2c"
+                 -hdr ":protocol" "h2c" \
+                 -nostrend
 
                rxrst
                expect rst.err == 1
index e21ddd5bbcae8e94ca580ac0bf2746e3e43d9d76..9567ea577de6478a3665c640f107baa901946fa6 100644 (file)
@@ -190,8 +190,10 @@ client c4 -connect ${hap_fe3_sock} {
                  -scheme "http" \
                  -url "/" \
                  -hdr ":authority" "127.0.0.1" \
-                 -hdr ":protocol" "websocket"
+                 -hdr ":protocol" "websocket" \
+                 -nostrend
 
+               rxwinup
                rxhdrs
                expect resp.status == 200
        } -run
@@ -216,8 +218,10 @@ client c5 -connect ${hap_fe4_sock} {
                  -scheme "http" \
                  -url "/" \
                  -hdr ":authority" "127.0.0.1" \
-                 -hdr ":protocol" "websocket"
+                 -hdr ":protocol" "websocket" \
+                 -nostrend
 
+               rxwinup
                rxhdrs
                expect resp.status == 502
        } -run