| varnishtest "stick table: src_conn_rate" |
| feature ignore_unknown_macro |
| timeout connect "${HAPROXY_TEST_TIMEOUT-5s}" |
| timeout client "${HAPROXY_TEST_TIMEOUT-5s}" |
| timeout server "${HAPROXY_TEST_TIMEOUT-5s}" |
| 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 |
| stick-table type ip size 1m expire 1m store conn_rate(1m) |
| client c0 -connect ${h0_fe1_addr}:${h0_fe1_port} { |
| expect resp.status == 200 |
| client c1 -connect ${h0_fe1_addr}:${h0_fe1_port} { |
| expect resp.status == 200 |
| client c2 -connect ${h0_fe1_addr}:${h0_fe1_port} { |
| expect resp.status == 200 |
| client c3 -connect ${h0_fe1_addr}:${h0_fe1_port} { |
| expect resp.status == 403 |