summaryrefslogtreecommitdiffstats
path: root/reg-tests/http-set-timeout/set_timeout.vtc
blob: a112bc51e0f9d9d64d068ae118dec9be6af69af9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
varnishtest "http-request set-timeout test"

feature ignore_unknown_macro

#REQUIRE_VERSION=2.4

server srv_h1 -repeat 9 {
    rxreq
    txresp
} -start

syslog Slog1 -level info {
    recv
    expect ~ "^.*timeout: 5000 5000.*$"
} -start

syslog Slog2 -level info {
    recv
    expect ~ "^.*timeout: 5000 5000.*$"
} -start

syslog Slog3 -level info {
    recv
    expect ~ "^.*timeout: 5000 3000.*$"
} -start

syslog Slog4 -level info {
    recv
    expect ~ "^.*timeout: 5000 5000.*$"
} -start

syslog Slog5 -level info {
    recv
    expect ~ "^.*timeout: 5000 3000.*$"
} -start

syslog Slog6 -level info {
    recv
    expect ~ "^.*timeout: 5000 5000.*$"
} -start

syslog Slog7 -level info {
    recv
    expect ~ "^.*timeout: 5000 5000.*$"
} -start

syslog Slog8 -level info {
    recv
    expect ~ "^.*timeout: 5000 3000.*$"
} -start

syslog Slog9 -level info {
    recv
    expect ~ "^.*timeout: 5000 3000.*$"
} -start

haproxy hap -conf {
    defaults
        timeout connect 5s
        timeout client 5s
        timeout server 5s
        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}

    listen li3
        mode http
        bind "fd@${li3}"
        log-format "timeout: %[fe_client_timeout] %[cur_client_timeout]"
        log ${Slog4_addr}:${Slog4_port} len 2048 local0 debug err
        http-request set-timeout client 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}

    frontend fe2
        mode http
        bind "fd@${fe2}"
        log-format "timeout: %[fe_client_timeout] %[cur_client_timeout]"
        log ${Slog5_addr}:${Slog5_port} len 2048 local0 debug err
        http-request set-timeout client int(3),mul(1000)
        default_backend be2

    backend be2
       mode http
       server srv_h1 ${srv_h1_addr}:${srv_h1_port}

    listen li4
        mode http
        bind "fd@${li4}"
        log-format "timeout: %[be_server_timeout] %[cur_server_timeout]"
        log ${Slog6_addr}:${Slog6_port} len 2048 local0 debug err
        http-response set-timeout server 5s
       server srv_h1 ${srv_h1_addr}:${srv_h1_port}

    listen li5
        mode http
        bind "fd@${li5}"
        log-format "timeout: %[fe_client_timeout] %[cur_client_timeout]"
        log ${Slog7_addr}:${Slog7_port} len 2048 local0 debug err
        http-response set-timeout client 5s
       server srv_h1 ${srv_h1_addr}:${srv_h1_port}

    frontend fe3
        mode http
        bind "fd@${fe3}"
        log-format "timeout: %[be_server_timeout] %[cur_server_timeout]"
        log ${Slog8_addr}:${Slog8_port} len 2048 local0 debug err
        default_backend be1

    backend be3
       mode http
       http-response set-timeout server int(3),mul(1000)
       server srv_h1 ${srv_h1_addr}:${srv_h1_port}

    frontend fe4
        mode http
        bind "fd@${fe4}"
        log-format "timeout: %[fe_client_timeout] %[cur_client_timeout]"
        log ${Slog9_addr}:${Slog9_port} len 2048 local0 debug err
        http-response set-timeout client int(3),mul(1000)
        default_backend be2

    backend be4
       mode http
       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

client c4 -connect ${hap_li3_sock} {
    txreq
    rxresp
    expect resp.status == 200
} -run

client c5 -connect ${hap_fe2_sock} {
    txreq
    rxresp
    expect resp.status == 200
} -run

client c6 -connect ${hap_li4_sock} {
    txreq
    rxresp
    expect resp.status == 200
} -run

client c7 -connect ${hap_fe3_sock} {
    txreq
    rxresp
    expect resp.status == 200
} -run

client c8 -connect ${hap_li5_sock} {
    txreq
    rxresp
    expect resp.status == 200
} -run

client c9 -connect ${hap_fe4_sock} {
    txreq
    rxresp
    expect resp.status == 200
} -run

syslog Slog1 -wait
syslog Slog2 -wait
syslog Slog3 -wait
syslog Slog4 -wait
syslog Slog5 -wait
syslog Slog6 -wait
syslog Slog7 -wait
syslog Slog8 -wait
syslog Slog9 -wait