2020-12-10 12:44:01 +00:00
|
|
|
varnishtest "http-request set-timeout test"
|
|
|
|
|
|
|
|
feature ignore_unknown_macro
|
|
|
|
|
2020-12-15 16:13:39 +00:00
|
|
|
#REQUIRE_VERSION=2.4
|
|
|
|
|
2020-12-10 12:44:01 +00:00
|
|
|
server srv_h1 -repeat 3 {
|
|
|
|
rxreq
|
|
|
|
txresp
|
|
|
|
} -start
|
|
|
|
|
|
|
|
syslog Slog1 -level info {
|
|
|
|
recv
|
2021-11-18 16:46:22 +00:00
|
|
|
expect ~ "^.*timeout: 5000 5000.*$"
|
2020-12-10 12:44:01 +00:00
|
|
|
} -start
|
|
|
|
|
|
|
|
syslog Slog2 -level info {
|
|
|
|
recv
|
2021-11-18 16:46:22 +00:00
|
|
|
expect ~ "^.*timeout: 5000 5000.*$"
|
2020-12-10 12:44:01 +00:00
|
|
|
} -start
|
|
|
|
|
|
|
|
syslog Slog3 -level info {
|
|
|
|
recv
|
2021-11-18 16:46:22 +00:00
|
|
|
expect ~ "^.*timeout: 5000 3000.*$"
|
2020-12-10 12:44:01 +00:00
|
|
|
} -start
|
|
|
|
|
|
|
|
haproxy hap -conf {
|
|
|
|
defaults
|
2021-11-18 16:46:22 +00:00
|
|
|
timeout connect 5s
|
|
|
|
timeout client 5s
|
|
|
|
timeout server 5s
|
2020-12-10 12:44:01 +00:00
|
|
|
log global
|
|
|
|
|
|
|
|
listen li1
|
|
|
|
mode http
|
|
|
|
bind "fd@${li1}"
|
|
|
|
log-format "timeout: %[be_server_timeout] %[cur_server_timeout]"
|
|
|
|
log ${Slog1_addr}:${Slog1_port} len 2048 local0 debug err
|
|
|
|
server srv_h1 ${srv_h1_addr}:${srv_h1_port}
|
|
|
|
|
|
|
|
listen li2
|
|
|
|
mode http
|
|
|
|
bind "fd@${li2}"
|
|
|
|
log-format "timeout: %[be_server_timeout] %[cur_server_timeout]"
|
|
|
|
log ${Slog2_addr}:${Slog2_port} len 2048 local0 debug err
|
|
|
|
http-request set-timeout server 5s
|
|
|
|
server srv_h1 ${srv_h1_addr}:${srv_h1_port}
|
|
|
|
|
|
|
|
frontend fe1
|
|
|
|
mode http
|
|
|
|
bind "fd@${fe1}"
|
|
|
|
log-format "timeout: %[be_server_timeout] %[cur_server_timeout]"
|
|
|
|
log ${Slog3_addr}:${Slog3_port} len 2048 local0 debug err
|
|
|
|
default_backend be1
|
|
|
|
|
|
|
|
backend be1
|
|
|
|
mode http
|
|
|
|
http-request set-timeout server int(3),mul(1000)
|
|
|
|
server srv_h1 ${srv_h1_addr}:${srv_h1_port}
|
|
|
|
} -start
|
|
|
|
|
|
|
|
client c1 -connect ${hap_li1_sock} {
|
|
|
|
txreq
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
|
|
|
client c2 -connect ${hap_li2_sock} {
|
|
|
|
txreq
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
|
|
|
client c3 -connect ${hap_fe1_sock} {
|
|
|
|
txreq
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
|
|
|
syslog Slog1 -wait
|
|
|
|
syslog Slog2 -wait
|
|
|
|
syslog Slog3 -wait
|