blob: ebaa6a3b4feb396454a207532db6cd7bf8fdc3b2 [file] [log] [blame]
Amaury Denoyelle78ea5c92020-12-10 13:44:01 +01001varnishtest "http-request set-timeout test"
2
3feature ignore_unknown_macro
4
Christopher Faulet85a81362020-12-15 17:13:39 +01005#REQUIRE_VERSION=2.4
6
Amaury Denoyelle78ea5c92020-12-10 13:44:01 +01007server srv_h1 -repeat 3 {
8 rxreq
9 txresp
10} -start
11
12syslog Slog1 -level info {
13 recv
Willy Tarreauf6739232021-11-18 17:46:22 +010014 expect ~ "^.*timeout: 5000 5000.*$"
Amaury Denoyelle78ea5c92020-12-10 13:44:01 +010015} -start
16
17syslog Slog2 -level info {
18 recv
Willy Tarreauf6739232021-11-18 17:46:22 +010019 expect ~ "^.*timeout: 5000 5000.*$"
Amaury Denoyelle78ea5c92020-12-10 13:44:01 +010020} -start
21
22syslog Slog3 -level info {
23 recv
Willy Tarreauf6739232021-11-18 17:46:22 +010024 expect ~ "^.*timeout: 5000 3000.*$"
Amaury Denoyelle78ea5c92020-12-10 13:44:01 +010025} -start
26
27haproxy hap -conf {
28 defaults
Willy Tarreauf6739232021-11-18 17:46:22 +010029 timeout connect 5s
30 timeout client 5s
31 timeout server 5s
Amaury Denoyelle78ea5c92020-12-10 13:44:01 +010032 log global
33
34 listen li1
35 mode http
36 bind "fd@${li1}"
37 log-format "timeout: %[be_server_timeout] %[cur_server_timeout]"
38 log ${Slog1_addr}:${Slog1_port} len 2048 local0 debug err
39 server srv_h1 ${srv_h1_addr}:${srv_h1_port}
40
41 listen li2
42 mode http
43 bind "fd@${li2}"
44 log-format "timeout: %[be_server_timeout] %[cur_server_timeout]"
45 log ${Slog2_addr}:${Slog2_port} len 2048 local0 debug err
46 http-request set-timeout server 5s
47 server srv_h1 ${srv_h1_addr}:${srv_h1_port}
48
49 frontend fe1
50 mode http
51 bind "fd@${fe1}"
52 log-format "timeout: %[be_server_timeout] %[cur_server_timeout]"
53 log ${Slog3_addr}:${Slog3_port} len 2048 local0 debug err
54 default_backend be1
55
56 backend be1
57 mode http
58 http-request set-timeout server int(3),mul(1000)
59 server srv_h1 ${srv_h1_addr}:${srv_h1_port}
60} -start
61
62client c1 -connect ${hap_li1_sock} {
63 txreq
64 rxresp
65 expect resp.status == 200
66} -run
67
68client c2 -connect ${hap_li2_sock} {
69 txreq
70 rxresp
71 expect resp.status == 200
72} -run
73
74client c3 -connect ${hap_fe1_sock} {
75 txreq
76 rxresp
77 expect resp.status == 200
78} -run
79
80syslog Slog1 -wait
81syslog Slog2 -wait
82syslog Slog3 -wait