blob: 44edfe5b5f1460f3e7c13cdd661149096612645f [file] [log] [blame]
Frederic Lecaille8b77c052018-12-13 22:15:07 +01001varnishtest "Health-checks: only for servers with 'check' set"
2feature ignore_unknown_macro
3
4# This test start 40 servers in the same backend, named srv0 up to srv39.
5# Only the odd servers have health-checks enabled.
6# The first health-checks passed tests are checked for all these servers
7# thanks to syslog messages.
8
Frédéric Lécailleffe30f72019-04-19 11:20:52 +02009#REQUIRE_VERSION=1.8
Frédéric Lécaille15685c72018-12-20 09:55:45 +010010#EXCLUDE_TARGETS=freebsd
Frédéric Lécailledc1a3bd2019-03-29 15:07:24 +010011#REGTEST_TYPE=slow
Frédéric Lécaille15685c72018-12-20 09:55:45 +010012
Willy Tarreau43ba3cf2020-09-24 09:57:32 +020013syslog S -repeat 20 -level notice {
Frederic Lecaille8b77c052018-12-13 22:15:07 +010014 recv
Willy Tarreau43ba3cf2020-09-24 09:57:32 +020015 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be1/srv([13579]|[123][13579]) succeeded.+reason: Layer4 check passed.+check duration: [[:digit:]]+ms.+status: 1/1 UP"
Frederic Lecaille8b77c052018-12-13 22:15:07 +010016} -start
17
18server s0 {} -start
19server s1 {} -start
20server s2 {} -start
21server s3 {} -start
22server s4 {} -start
23server s5 {} -start
24server s6 {} -start
25server s7 {} -start
26server s8 {} -start
27server s9 {} -start
28server s10 {} -start
29server s11 {} -start
30server s12 {} -start
31server s13 {} -start
32server s14 {} -start
33server s15 {} -start
34server s16 {} -start
35server s17 {} -start
36server s18 {} -start
37server s19 {} -start
38server s20 {} -start
39server s21 {} -start
40server s22 {} -start
41server s23 {} -start
42server s24 {} -start
43server s25 {} -start
44server s26 {} -start
45server s27 {} -start
46server s28 {} -start
47server s29 {} -start
48server s30 {} -start
49server s31 {} -start
50server s32 {} -start
51server s33 {} -start
52server s34 {} -start
53server s35 {} -start
54server s36 {} -start
55server s37 {} -start
56server s38 {} -start
57server s39 {} -start
58
59haproxy h1 -conf {
60 defaults
61 timeout client 1s
62 timeout server 1s
63 timeout connect 1s
Christopher Faulet617780f2020-04-07 08:00:35 +020064 default-server no-check inter 200ms downinter 100ms rise 1 fall 1
Frederic Lecaille8b77c052018-12-13 22:15:07 +010065
66 backend be1
67 option log-health-checks
68 log ${S_addr}:${S_port} daemon
69 server srv0 ${s0_addr}:${s0_port}
70 server srv1 ${s1_addr}:${s1_port} check
71 server srv2 ${s2_addr}:${s2_port}
72 server srv3 ${s3_addr}:${s3_port} check
73 server srv4 ${s4_addr}:${s4_port}
74 server srv5 ${s5_addr}:${s5_port} check
75 server srv6 ${s6_addr}:${s6_port}
76 server srv7 ${s7_addr}:${s7_port} check
77 server srv8 ${s8_addr}:${s8_port}
78 server srv9 ${s9_addr}:${s9_port} check
79 server srv10 ${s10_addr}:${s10_port}
80 server srv11 ${s11_addr}:${s11_port} check
81 server srv12 ${s12_addr}:${s12_port}
82 server srv13 ${s13_addr}:${s13_port} check
83 server srv14 ${s14_addr}:${s14_port}
84 server srv15 ${s15_addr}:${s15_port} check
85 server srv16 ${s16_addr}:${s16_port}
86 server srv17 ${s17_addr}:${s17_port} check
87 server srv18 ${s18_addr}:${s18_port}
88 server srv19 ${s19_addr}:${s19_port} check
89 server srv20 ${s20_addr}:${s20_port}
90 server srv21 ${s21_addr}:${s21_port} check
91 server srv22 ${s22_addr}:${s22_port}
92 server srv23 ${s23_addr}:${s23_port} check
93 server srv24 ${s24_addr}:${s24_port}
94 server srv25 ${s25_addr}:${s25_port} check
95 server srv26 ${s26_addr}:${s26_port}
96 server srv27 ${s27_addr}:${s27_port} check
97 server srv28 ${s28_addr}:${s28_port}
98 server srv29 ${s29_addr}:${s29_port} check
99 server srv30 ${s30_addr}:${s30_port}
100 server srv31 ${s31_addr}:${s31_port} check
101 server srv32 ${s32_addr}:${s32_port}
102 server srv33 ${s33_addr}:${s33_port} check
103 server srv34 ${s34_addr}:${s34_port}
104 server srv35 ${s35_addr}:${s35_port} check
105 server srv36 ${s36_addr}:${s36_port}
106 server srv37 ${s37_addr}:${s37_port} check
107 server srv38 ${s38_addr}:${s38_port}
108 server srv39 ${s39_addr}:${s39_port} check
109} -start
110
111syslog S -wait
112
113haproxy h1 -cli {
114 send "show servers state"
Willy Tarreauf3ec86a2018-12-14 09:49:19 +0100115 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\n2 be1 1 srv0 ${s0_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s0_port} -\n2 be1 2 srv1 ${s1_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s1_port} -\n2 be1 3 srv2 ${s2_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s2_port} -\n2 be1 4 srv3 ${s3_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s3_port} -\n2 be1 5 srv4 ${s4_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s4_port} -\n2 be1 6 srv5 ${s5_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s5_port} -\n2 be1 7 srv6 ${s6_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s6_port} -\n2 be1 8 srv7 ${s7_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s7_port} -\n2 be1 9 srv8 ${s8_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s8_port} -\n2 be1 10 srv9 ${s9_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s9_port} -\n2 be1 11 srv10 ${s10_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s10_port} -\n2 be1 12 srv11 ${s11_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s11_port} -\n2 be1 13 srv12 ${s12_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s12_port} -\n2 be1 14 srv13 ${s13_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s13_port} -\n2 be1 15 srv14 ${s14_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s14_port} -\n2 be1 16 srv15 ${s15_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s15_port} -\n2 be1 17 srv16 ${s16_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s16_port} -\n2 be1 18 srv17 ${s17_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s17_port} -\n2 be1 19 srv18 ${s18_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s18_port} -\n2 be1 20 srv19 ${s19_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s19_port} -\n2 be1 21 srv20 ${s20_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s20_port} -\n2 be1 22 srv21 ${s21_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s21_port} -\n2 be1 23 srv22 ${s22_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s22_port} -\n2 be1 24 srv23 ${s23_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s23_port} -\n2 be1 25 srv24 ${s24_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s24_port} -\n2 be1 26 srv25 ${s25_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s25_port} -\n2 be1 27 srv26 ${s26_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s26_port} -\n2 be1 28 srv27 ${s27_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s27_port} -\n2 be1 29 srv28 ${s28_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s28_port} -\n2 be1 30 srv29 ${s29_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s29_port} -\n2 be1 31 srv30 ${s30_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s30_port} -\n2 be1 32 srv31 ${s31_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s31_port} -\n2 be1 33 srv32 ${s32_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s32_port} -\n2 be1 34 srv33 ${s33_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s33_port} -\n2 be1 35 srv34 ${s34_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s34_port} -\n2 be1 36 srv35 ${s35_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s35_port} -\n2 be1 37 srv36 ${s36_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s36_port} -\n2 be1 38 srv37 ${s37_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s37_port} -\n2 be1 39 srv38 ${s38_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s38_port} -\n2 be1 40 srv39 ${s39_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s39_port} -\n"
Frederic Lecaille8b77c052018-12-13 22:15:07 +0100116}
117