blob: 6840164a97a3f0c23703476cd89ad5e7affe0817 [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
14 expect ~ "^.*timeout: 1000 1000.*$"
15} -start
16
17syslog Slog2 -level info {
18 recv
19 expect ~ "^.*timeout: 1000 5000.*$"
20} -start
21
22syslog Slog3 -level info {
23 recv
24 expect ~ "^.*timeout: 1000 3000.*$"
25} -start
26
27haproxy hap -conf {
28 defaults
29 timeout connect 1s
30 timeout client 1s
31 timeout server 1s
32 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