haproxy/reg-tests/http-messaging/h1_request_target_validation.vtc
Willy Tarreau 48d5ef363d REGTESTS: restrict execution to a single thread group
When threads are enabled and running on a machine with multiple CCX
or multiple nodes, thread groups are now enabled since 3.3-dev2, causing
load-balancing algorithms to randomly fail due to incoming connections
spreading over multiple groups and using different load balancing indexes.

Let's just force "thread-groups 1" into all configs when threads are
enabled to avoid this.
2025-06-30 18:54:35 +02:00

116 lines
2.5 KiB
Plaintext

varnishtest "HTTP request tests: H1 request target parsing"
feature ignore_unknown_macro
feature cmd "$HAPROXY_PROGRAM -cc 'version_atleast(3.0-dev0)'"
haproxy h1 -conf {
global
.if feature(THREAD)
thread-groups 1
.endif
# WT: limit false-positives causing "HTTP header incomplete" due to
# idle server connections being randomly used and randomly expiring
# under us.
tune.idle-pool.shared off
defaults
mode http
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
listen li1
bind "fd@${li1}"
http-request return status 200
} -start
client c1 -connect ${h1_li1_sock} {
txreq -req "OPTIONS" -url "*"
rxresp
expect resp.status == 200
} -run
client c2 -connect ${h1_li1_sock} {
txreq -req "OPTIONS" -url "/"
rxresp
expect resp.status == 200
} -run
client c3 -connect ${h1_li1_sock} {
txreq -req "OPTIONS" -url "http://haproxy.org" \
-hdr "Host: haproxy.org"
rxresp
expect resp.status == 200
} -run
client c4 -connect ${h1_li1_sock} {
txreq -req "OPTIONS" -url "*/test"
rxresp
expect resp.status == 400
} -run
client c5 -connect ${h1_li1_sock} {
txreq -req "GET" -url "*"
rxresp
expect resp.status == 400
} -run
client c6 -connect ${h1_li1_sock} {
txreq -req "CONNECT" -url "haproxy.org:80" \
-hdr "Host: haproxy.org"
rxresp
expect resp.status == 200
} -run
client c7 -connect ${h1_li1_sock} {
txreq -req "CONNECT" -url "haproxy.org" \
-hdr "Host: haproxy.org"
rxresp
expect resp.status == 400
} -run
client c8 -connect ${h1_li1_sock} {
txreq -req "CONNECT" -url "/"
rxresp
expect resp.status == 400
} -run
client c9 -connect ${h1_li1_sock} {
txreq -req "CONNECT" -url "http://haproxy.org:80" \
-hdr "Host: haproxy.org"
rxresp
expect resp.status == 400
} -run
client c11 -connect ${h1_li1_sock} {
txreq -req "GET" -url "/" \
-hdr "Host: haproxy.org"
rxresp
expect resp.status == 200
} -run
client c12 -connect ${h1_li1_sock} {
txreq -req "GET" -url "haproxy.org:80" \
-hdr "Host: haproxy.org"
rxresp
expect resp.status == 400
} -run
client c13 -connect ${h1_li1_sock} {
txreq -req "GET" -url "admin"
rxresp
expect resp.status == 400
} -run
client c14 -connect ${h1_li1_sock} {
txreq -req "GET" -url "admin/a/b"
rxresp
expect resp.status == 400
} -run