blob: 0065c9c8c86accaa848f78668a0b80bebeb3ac16 [file] [log] [blame]
Frederic Lecaille573d2892018-12-13 22:15:08 +01001varnishtest "Health-checks"
2feature ignore_unknown_macro
3
Christopher Faulet85a81362020-12-15 17:13:39 +01004#REQUIRE_VERSION=2.4
Willy Tarreau03c6ab02019-04-25 08:39:48 +02005#EXCLUDE_TARGETS=freebsd,osx,generic
Frédéric Lécailledc1a3bd2019-03-29 15:07:24 +01006#REGTEST_TYPE=slow
Frederic Lecaille573d2892018-12-13 22:15:08 +01007
8# This script start 40 servers named s0 up to s39.
9# For 0 <= i <= 19:
10# - s(i) and s(i+1) belong to backend be(2*i+1),
11# - fe(2*i+1) backend is configured to used be(2*i+1) backend.
12# - only s(2*i+1) servers have health-checks enabled,
13# - we start 20 clients named s(2*i+1) which connect to fe(2*i+1) frontend,
14# - so that to ensure that health-checks do not consume any connection
15# (any varnishtest server without -repeat <n> with n > 1 accepts
16# only one connection).
Willy Tarreaua2f44a92022-02-21 20:44:00 +010017# - we take care of sending the clients to the unchecked servers using the
18# "first" lb algo so that servers always receive a valid request
Frederic Lecaille573d2892018-12-13 22:15:08 +010019
Frederic Lecaille573d2892018-12-13 22:15:08 +010020syslog S1 -level notice {
21 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +010022 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be1/srv1 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
23} -start
24
25syslog S3 -level notice {
26 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +010027 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be3/srv3 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
28} -start
29
30syslog S5 -level notice {
31 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +010032 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be5/srv5 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
33} -start
34
35syslog S7 -level notice {
36 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +010037 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be7/srv7 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
38} -start
39
40syslog S9 -level notice {
41 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +010042 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be9/srv9 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
43} -start
44
45syslog S11 -level notice {
46 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +010047 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be11/srv11 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
48} -start
49
50syslog S13 -level notice {
51 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +010052 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be13/srv13 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
53} -start
54
55syslog S15 -level notice {
56 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +010057 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be15/srv15 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
58} -start
59
60syslog S17 -level notice {
61 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +010062 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be17/srv17 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
63} -start
64
65syslog S19 -level notice {
66 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +010067 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be19/srv19 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
68} -start
69
70syslog S21 -level notice {
71 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +010072 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be21/srv21 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
73} -start
74
75syslog S23 -level notice {
76 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +010077 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be23/srv23 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
78} -start
79
80syslog S25 -level notice {
81 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +010082 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be25/srv25 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
83} -start
84
85syslog S27 -level notice {
86 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +010087 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be27/srv27 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
88} -start
89
90syslog S29 -level notice {
91 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +010092 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be29/srv29 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
93} -start
94
95syslog S31 -level notice {
96 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +010097 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be31/srv31 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
98} -start
99
100syslog S33 -level notice {
101 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +0100102 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be33/srv33 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
103} -start
104
105syslog S35 -level notice {
106 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +0100107 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be35/srv35 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
108} -start
109
110syslog S37 -level notice {
111 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +0100112 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be37/srv37 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
113} -start
114
115syslog S39 -level notice {
116 recv
Frederic Lecaille573d2892018-12-13 22:15:08 +0100117 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be39/srv39 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
118} -start
119
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100120server s0 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100121 rxreq
122 txresp
123} -start
124
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100125server s2 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100126 rxreq
127 txresp
128} -start
129
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100130server s4 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100131 rxreq
132 txresp
133} -start
134
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100135server s6 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100136 rxreq
137 txresp
138} -start
139
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100140server s8 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100141 rxreq
142 txresp
143} -start
144
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100145server s10 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100146 rxreq
147 txresp
148} -start
149
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100150server s12 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100151 rxreq
152 txresp
153} -start
154
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100155server s14 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100156 rxreq
157 txresp
158} -start
159
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100160server s16 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100161 rxreq
162 txresp
163} -start
164
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100165server s18 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100166 rxreq
167 txresp
168} -start
169
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100170server s20 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100171 rxreq
172 txresp
173} -start
174
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100175server s22 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100176 rxreq
177 txresp
178} -start
179
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100180server s24 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100181 rxreq
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100182 txresp
Frederic Lecaille573d2892018-12-13 22:15:08 +0100183} -start
184
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100185server s26 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100186 rxreq
187 txresp
188} -start
189
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100190server s28 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100191 rxreq
192 txresp
193} -start
194
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100195server s30 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100196 rxreq
197 txresp
198} -start
199
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100200server s32 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100201 rxreq
202 txresp
203} -start
204
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100205server s34 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100206 rxreq
207 txresp
208} -start
209
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100210server s36 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100211 rxreq
212 txresp
213} -start
214
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100215server s38 {
Frederic Lecaille573d2892018-12-13 22:15:08 +0100216 rxreq
217 txresp
218} -start
219
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100220server s1 {} -start
221server s3 {} -start
222server s5 {} -start
223server s7 {} -start
224server s9 {} -start
225server s11 {} -start
226server s13 {} -start
227server s15 {} -start
228server s17 {} -start
229server s19 {} -start
230server s21 {} -start
231server s23 {} -start
232server s25 {} -start
233server s27 {} -start
234server s29 {} -start
235server s31 {} -start
236server s33 {} -start
237server s35 {} -start
238server s37 {} -start
239server s39 {} -start
240
Frederic Lecaille573d2892018-12-13 22:15:08 +0100241haproxy h1 -conf {
242 defaults
243 timeout client 1s
244 timeout server 1s
245 timeout connect 1s
246 balance first
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100247 default-server no-check inter 20ms downinter 1s rise 1 fall 1
Frederic Lecaille573d2892018-12-13 22:15:08 +0100248
249 backend be1
250 option log-health-checks
251 log ${S1_addr}:${S1_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100252 server srv0 ${s0_addr}:${s0_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100253 server srv1 ${s1_addr}:${s1_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100254
255 backend be3
256 option log-health-checks
257 log ${S3_addr}:${S3_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100258 server srv2 ${s2_addr}:${s2_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100259 server srv3 ${s3_addr}:${s3_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100260
261 backend be5
262 option log-health-checks
263 log ${S5_addr}:${S5_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100264 server srv4 ${s4_addr}:${s4_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100265 server srv5 ${s5_addr}:${s5_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100266
267 backend be7
268 option log-health-checks
269 log ${S7_addr}:${S7_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100270 server srv6 ${s6_addr}:${s6_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100271 server srv7 ${s7_addr}:${s7_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100272
273 backend be9
274 option log-health-checks
275 log ${S9_addr}:${S9_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100276 server srv8 ${s8_addr}:${s8_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100277 server srv9 ${s9_addr}:${s9_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100278
279 backend be11
280 option log-health-checks
281 log ${S11_addr}:${S11_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100282 server srv10 ${s10_addr}:${s10_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100283 server srv11 ${s11_addr}:${s11_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100284
285 backend be13
286 option log-health-checks
287 log ${S13_addr}:${S13_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100288 server srv12 ${s12_addr}:${s12_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100289 server srv13 ${s13_addr}:${s13_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100290
291 backend be15
292 option log-health-checks
293 log ${S15_addr}:${S15_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100294 server srv14 ${s14_addr}:${s14_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100295 server srv15 ${s15_addr}:${s15_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100296
297 backend be17
298 option log-health-checks
299 log ${S17_addr}:${S17_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100300 server srv16 ${s16_addr}:${s16_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100301 server srv17 ${s17_addr}:${s17_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100302
303 backend be19
304 option log-health-checks
305 log ${S19_addr}:${S19_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100306 server srv18 ${s18_addr}:${s18_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100307 server srv19 ${s19_addr}:${s19_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100308
309 backend be21
310 option log-health-checks
311 log ${S21_addr}:${S21_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100312 server srv20 ${s20_addr}:${s20_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100313 server srv21 ${s21_addr}:${s21_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100314
315 backend be23
316 option log-health-checks
317 log ${S23_addr}:${S23_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100318 server srv22 ${s22_addr}:${s22_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100319 server srv23 ${s23_addr}:${s23_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100320
321 backend be25
322 option log-health-checks
323 log ${S25_addr}:${S25_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100324 server srv24 ${s24_addr}:${s24_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100325 server srv25 ${s25_addr}:${s25_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100326
327 backend be27
328 option log-health-checks
329 log ${S27_addr}:${S27_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100330 server srv26 ${s26_addr}:${s26_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100331 server srv27 ${s27_addr}:${s27_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100332
333 backend be29
334 option log-health-checks
335 log ${S29_addr}:${S29_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100336 server srv28 ${s28_addr}:${s28_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100337 server srv29 ${s29_addr}:${s29_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100338
339 backend be31
340 option log-health-checks
341 log ${S31_addr}:${S31_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100342 server srv30 ${s30_addr}:${s30_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100343 server srv31 ${s31_addr}:${s31_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100344
345 backend be33
346 option log-health-checks
347 log ${S33_addr}:${S33_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100348 server srv32 ${s32_addr}:${s32_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100349 server srv33 ${s33_addr}:${s33_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100350
351 backend be35
352 option log-health-checks
353 log ${S35_addr}:${S35_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100354 server srv34 ${s34_addr}:${s34_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100355 server srv35 ${s35_addr}:${s35_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100356
357 backend be37
358 option log-health-checks
359 log ${S37_addr}:${S37_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100360 server srv36 ${s36_addr}:${s36_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100361 server srv37 ${s37_addr}:${s37_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100362
363 backend be39
364 option log-health-checks
365 log ${S39_addr}:${S39_port} daemon
Frederic Lecaille573d2892018-12-13 22:15:08 +0100366 server srv38 ${s38_addr}:${s38_port}
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100367 server srv39 ${s39_addr}:${s39_port} check
Frederic Lecaille573d2892018-12-13 22:15:08 +0100368
369 frontend fe1
370 bind "fd@${fe1}"
371 use_backend be1
372
373 frontend fe3
374 bind "fd@${fe3}"
375 use_backend be3
376
377 frontend fe5
378 bind "fd@${fe5}"
379 use_backend be5
380
381 frontend fe7
382 bind "fd@${fe7}"
383 use_backend be7
384
385 frontend fe9
386 bind "fd@${fe9}"
387 use_backend be9
388
389 frontend fe11
390 bind "fd@${fe11}"
391 use_backend be11
392
393 frontend fe13
394 bind "fd@${fe13}"
395 use_backend be13
396
397 frontend fe15
398 bind "fd@${fe15}"
399 use_backend be15
400
401 frontend fe17
402 bind "fd@${fe17}"
403 use_backend be17
404
405 frontend fe19
406 bind "fd@${fe19}"
407 use_backend be19
408
409 frontend fe21
410 bind "fd@${fe21}"
411 use_backend be21
412
413 frontend fe23
414 bind "fd@${fe23}"
415 use_backend be23
416
417 frontend fe25
418 bind "fd@${fe25}"
419 use_backend be25
420
421 frontend fe27
422 bind "fd@${fe27}"
423 use_backend be27
424
425 frontend fe29
426 bind "fd@${fe29}"
427 use_backend be29
428
429 frontend fe31
430 bind "fd@${fe31}"
431 use_backend be31
432
433 frontend fe33
434 bind "fd@${fe33}"
435 use_backend be33
436
437 frontend fe35
438 bind "fd@${fe35}"
439 use_backend be35
440
441 frontend fe37
442 bind "fd@${fe37}"
443 use_backend be37
444
445 frontend fe39
446 bind "fd@${fe39}"
447 use_backend be39
448} -start
449
450# This is a sort of synchronization: after having waited for all the syslog
451# servers we are sure that all the health-checks have succeeded.
452syslog S1 -wait
453syslog S3 -wait
454syslog S5 -wait
455syslog S7 -wait
456syslog S9 -wait
457syslog S11 -wait
458syslog S13 -wait
459syslog S15 -wait
460syslog S17 -wait
461syslog S19 -wait
462syslog S21 -wait
463syslog S23 -wait
464syslog S25 -wait
465syslog S27 -wait
466syslog S29 -wait
467syslog S31 -wait
468syslog S33 -wait
469syslog S35 -wait
470syslog S37 -wait
471syslog S39 -wait
472
473client c1 -connect ${h1_fe1_sock} {
474 txreq
475 rxresp
476 expect resp.status == 200
477} -start
478
479client c3 -connect ${h1_fe3_sock} {
480 txreq
481 rxresp
482 expect resp.status == 200
483} -start
484
485client c5 -connect ${h1_fe5_sock} {
486 txreq
487 rxresp
488 expect resp.status == 200
489} -start
490
491client c7 -connect ${h1_fe7_sock} {
492 txreq
493 rxresp
494 expect resp.status == 200
495} -start
496
497client c9 -connect ${h1_fe9_sock} {
498 txreq
499 rxresp
500 expect resp.status == 200
501} -start
502
503client c11 -connect ${h1_fe11_sock} {
504 txreq
505 rxresp
506 expect resp.status == 200
507} -start
508
509client c13 -connect ${h1_fe13_sock} {
510 txreq
511 rxresp
512 expect resp.status == 200
513} -start
514
515client c15 -connect ${h1_fe15_sock} {
516 txreq
517 rxresp
518 expect resp.status == 200
519} -start
520
521client c17 -connect ${h1_fe17_sock} {
522 txreq
523 rxresp
524 expect resp.status == 200
525} -start
526
527client c19 -connect ${h1_fe19_sock} {
528 txreq
529 rxresp
530 expect resp.status == 200
531} -start
532
533client c21 -connect ${h1_fe21_sock} {
534 txreq
535 rxresp
536 expect resp.status == 200
537} -start
538
539client c23 -connect ${h1_fe23_sock} {
540 txreq
541 rxresp
542 expect resp.status == 200
543} -start
544
545client c25 -connect ${h1_fe25_sock} {
546 txreq
547 rxresp
548 expect resp.status == 200
549} -start
550
551client c27 -connect ${h1_fe27_sock} {
552 txreq
553 rxresp
554 expect resp.status == 200
555} -start
556
557client c29 -connect ${h1_fe29_sock} {
558 txreq
559 rxresp
560 expect resp.status == 200
561} -start
562
563client c31 -connect ${h1_fe31_sock} {
564 txreq
565 rxresp
566 expect resp.status == 200
567} -start
568
569client c33 -connect ${h1_fe33_sock} {
570 txreq
571 rxresp
572 expect resp.status == 200
573} -start
574
575client c35 -connect ${h1_fe35_sock} {
576 txreq
577 rxresp
578 expect resp.status == 200
579} -start
580
581client c37 -connect ${h1_fe37_sock} {
582 txreq
583 rxresp
584 expect resp.status == 200
585} -start
586
587client c39 -connect ${h1_fe39_sock} {
588 txreq
589 rxresp
590 expect resp.status == 200
591} -start
592
593client c1 -wait
594client c3 -wait
595client c5 -wait
596client c7 -wait
597client c9 -wait
598client c11 -wait
599client c13 -wait
600client c15 -wait
601client c17 -wait
602client c19 -wait
603client c21 -wait
604client c23 -wait
605client c25 -wait
606client c27 -wait
607client c29 -wait
608client c31 -wait
609client c33 -wait
610client c35 -wait
611client c37 -wait
612client c39 -wait
613
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100614server s0 -wait
615server s2 -wait
616server s4 -wait
617server s6 -wait
618server s8 -wait
619server s10 -wait
620server s12 -wait
621server s14 -wait
622server s16 -wait
623server s18 -wait
624server s20 -wait
625server s22 -wait
626server s24 -wait
627server s26 -wait
628server s28 -wait
629server s30 -wait
630server s32 -wait
631server s34 -wait
632server s36 -wait
633server s38 -wait
Frederic Lecaille573d2892018-12-13 22:15:08 +0100634
635
636haproxy h1 -cli {
637 send "show servers state"
Willy Tarreaua2f44a92022-02-21 20:44:00 +0100638 # output produced using the command below (warning, a bug inserts a "be0" every other line:
639 # for ((i=0;i<40;i++)); do id=$((i/2+2)); be=$((i|1)); si=$(((i&1)+1));
640 # if ((i&1)); then chk="6 ([[:digit:]]+ ){3}"; else chk="1 0 1 0 ";fi;
641 # printf "%d be%d %d srv%d \${s%d_addr} 2 0 1 1 [[:digit:]]+ %s0 0 0 - \${s%d_port} - 0 0 - - 0\n" "$id" "$be" "$si" "$i" "$i" "$chk" "$i" "$i" ;
642 # done|grep -v be0|sed 's,$,\\n,'| tr -d '\n'
643 expect ~ "# be_id be_name srv_id srv_name srv_addr srv_op_state srv_admin_state srv_uweight srv_iweight srv_time_since_last_change srv_check_status srv_check_result srv_check_health srv_check_state srv_agent_state bk_f_forced_id srv_f_forced_id srv_fqdn srv_port srvrecord srv_use_ssl srv_check_port srv_check_addr srv_agent_addr srv_agent_port\n2 be1 1 srv0 ${s0_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s0_port} - 0 0 - - 0\n2 be1 2 srv1 ${s1_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s1_port} - 0 0 - - 0\n3 be3 1 srv2 ${s2_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s2_port} - 0 0 - - 0\n3 be3 2 srv3 ${s3_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s3_port} - 0 0 - - 0\n4 be5 1 srv4 ${s4_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s4_port} - 0 0 - - 0\n4 be5 2 srv5 ${s5_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s5_port} - 0 0 - - 0\n5 be7 1 srv6 ${s6_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s6_port} - 0 0 - - 0\n5 be7 2 srv7 ${s7_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s7_port} - 0 0 - - 0\n6 be9 1 srv8 ${s8_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s8_port} - 0 0 - - 0\n6 be9 2 srv9 ${s9_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s9_port} - 0 0 - - 0\n7 be11 1 srv10 ${s10_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s10_port} - 0 0 - - 0\n7 be11 2 srv11 ${s11_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s11_port} - 0 0 - - 0\n8 be13 1 srv12 ${s12_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s12_port} - 0 0 - - 0\n8 be13 2 srv13 ${s13_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s13_port} - 0 0 - - 0\n9 be15 1 srv14 ${s14_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s14_port} - 0 0 - - 0\n9 be15 2 srv15 ${s15_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s15_port} - 0 0 - - 0\n10 be17 1 srv16 ${s16_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s16_port} - 0 0 - - 0\n10 be17 2 srv17 ${s17_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s17_port} - 0 0 - - 0\n11 be19 1 srv18 ${s18_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s18_port} - 0 0 - - 0\n11 be19 2 srv19 ${s19_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s19_port} - 0 0 - - 0\n12 be21 1 srv20 ${s20_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s20_port} - 0 0 - - 0\n12 be21 2 srv21 ${s21_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s21_port} - 0 0 - - 0\n13 be23 1 srv22 ${s22_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s22_port} - 0 0 - - 0\n13 be23 2 srv23 ${s23_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s23_port} - 0 0 - - 0\n14 be25 1 srv24 ${s24_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s24_port} - 0 0 - - 0\n14 be25 2 srv25 ${s25_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s25_port} - 0 0 - - 0\n15 be27 1 srv26 ${s26_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s26_port} - 0 0 - - 0\n15 be27 2 srv27 ${s27_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s27_port} - 0 0 - - 0\n16 be29 1 srv28 ${s28_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s28_port} - 0 0 - - 0\n16 be29 2 srv29 ${s29_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s29_port} - 0 0 - - 0\n17 be31 1 srv30 ${s30_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s30_port} - 0 0 - - 0\n17 be31 2 srv31 ${s31_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s31_port} - 0 0 - - 0\n18 be33 1 srv32 ${s32_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s32_port} - 0 0 - - 0\n18 be33 2 srv33 ${s33_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s33_port} - 0 0 - - 0\n19 be35 1 srv34 ${s34_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s34_port} - 0 0 - - 0\n19 be35 2 srv35 ${s35_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s35_port} - 0 0 - - 0\n20 be37 1 srv36 ${s36_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s36_port} - 0 0 - - 0\n20 be37 2 srv37 ${s37_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s37_port} - 0 0 - - 0\n21 be39 1 srv38 ${s38_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s38_port} - 0 0 - - 0\n21 be39 2 srv39 ${s39_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s39_port} - 0 0 - - 0\n"
Frederic Lecaille573d2892018-12-13 22:15:08 +0100644}
645