haproxy/reg-tests/stick-table/src_conn_rate.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

48 lines
1,008 B
Text

varnishtest "stick table: src_conn_rate"
feature ignore_unknown_macro
haproxy h0 -conf {
global
.if feature(THREAD)
thread-groups 1
.endif
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@${fe1}"
http-request track-sc0 src table conn_rate_table
http-request deny if { src_conn_rate(conn_rate_table) gt 3 }
http-request return status 200
backend conn_rate_table
stick-table type ip size 1m expire 1m store conn_rate(1m)
} -start
client c0 -connect ${h0_fe1_addr}:${h0_fe1_port} {
txreq
rxresp
expect resp.status == 200
} -run
client c1 -connect ${h0_fe1_addr}:${h0_fe1_port} {
txreq
rxresp
expect resp.status == 200
} -run
client c2 -connect ${h0_fe1_addr}:${h0_fe1_port} {
txreq
rxresp
expect resp.status == 200
} -run
client c3 -connect ${h0_fe1_addr}:${h0_fe1_port} {
txreq
rxresp
expect resp.status == 403
} -run