From 687504344a4915238309d1aebbe3f509a7bfb35a Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 7 Oct 2025 17:03:35 +0200 Subject: [PATCH] REGTESTS: http-messaging: fix the websocket and upgrade tests not to close early 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 | 11 ++++++++--- reg-tests/http-messaging/websocket.vtc | 8 ++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/reg-tests/http-messaging/protocol_upgrade.vtc b/reg-tests/http-messaging/protocol_upgrade.vtc index 46418a749..2fe65e717 100644 --- a/reg-tests/http-messaging/protocol_upgrade.vtc +++ b/reg-tests/http-messaging/protocol_upgrade.vtc @@ -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 diff --git a/reg-tests/http-messaging/websocket.vtc b/reg-tests/http-messaging/websocket.vtc index e21ddd5bb..9567ea577 100644 --- a/reg-tests/http-messaging/websocket.vtc +++ b/reg-tests/http-messaging/websocket.vtc @@ -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