Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 1 | varnishtest "Health-checks" |
| 2 | feature ignore_unknown_macro |
| 3 | |
Christopher Faulet | 85a8136 | 2020-12-15 17:13:39 +0100 | [diff] [blame] | 4 | #REQUIRE_VERSION=2.4 |
Willy Tarreau | 03c6ab0 | 2019-04-25 08:39:48 +0200 | [diff] [blame] | 5 | #EXCLUDE_TARGETS=freebsd,osx,generic |
Frédéric Lécaille | dc1a3bd | 2019-03-29 15:07:24 +0100 | [diff] [blame] | 6 | #REGTEST_TYPE=slow |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 7 | |
| 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 Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 17 | # - 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 Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 19 | |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 20 | syslog S1 -level notice { |
| 21 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 22 | 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 | |
| 25 | syslog S3 -level notice { |
| 26 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 27 | 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 | |
| 30 | syslog S5 -level notice { |
| 31 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 32 | 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 | |
| 35 | syslog S7 -level notice { |
| 36 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 37 | 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 | |
| 40 | syslog S9 -level notice { |
| 41 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 42 | 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 | |
| 45 | syslog S11 -level notice { |
| 46 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 47 | 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 | |
| 50 | syslog S13 -level notice { |
| 51 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 52 | 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 | |
| 55 | syslog S15 -level notice { |
| 56 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 57 | 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 | |
| 60 | syslog S17 -level notice { |
| 61 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 62 | 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 | |
| 65 | syslog S19 -level notice { |
| 66 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 67 | 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 | |
| 70 | syslog S21 -level notice { |
| 71 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 72 | 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 | |
| 75 | syslog S23 -level notice { |
| 76 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 77 | 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 | |
| 80 | syslog S25 -level notice { |
| 81 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 82 | 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 | |
| 85 | syslog S27 -level notice { |
| 86 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 87 | 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 | |
| 90 | syslog S29 -level notice { |
| 91 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 92 | 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 | |
| 95 | syslog S31 -level notice { |
| 96 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 97 | 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 | |
| 100 | syslog S33 -level notice { |
| 101 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 102 | 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 | |
| 105 | syslog S35 -level notice { |
| 106 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 107 | 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 | |
| 110 | syslog S37 -level notice { |
| 111 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 112 | 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 | |
| 115 | syslog S39 -level notice { |
| 116 | recv |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 117 | 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 Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 120 | server s0 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 121 | rxreq |
| 122 | txresp |
| 123 | } -start |
| 124 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 125 | server s2 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 126 | rxreq |
| 127 | txresp |
| 128 | } -start |
| 129 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 130 | server s4 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 131 | rxreq |
| 132 | txresp |
| 133 | } -start |
| 134 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 135 | server s6 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 136 | rxreq |
| 137 | txresp |
| 138 | } -start |
| 139 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 140 | server s8 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 141 | rxreq |
| 142 | txresp |
| 143 | } -start |
| 144 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 145 | server s10 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 146 | rxreq |
| 147 | txresp |
| 148 | } -start |
| 149 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 150 | server s12 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 151 | rxreq |
| 152 | txresp |
| 153 | } -start |
| 154 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 155 | server s14 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 156 | rxreq |
| 157 | txresp |
| 158 | } -start |
| 159 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 160 | server s16 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 161 | rxreq |
| 162 | txresp |
| 163 | } -start |
| 164 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 165 | server s18 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 166 | rxreq |
| 167 | txresp |
| 168 | } -start |
| 169 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 170 | server s20 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 171 | rxreq |
| 172 | txresp |
| 173 | } -start |
| 174 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 175 | server s22 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 176 | rxreq |
| 177 | txresp |
| 178 | } -start |
| 179 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 180 | server s24 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 181 | rxreq |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 182 | txresp |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 183 | } -start |
| 184 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 185 | server s26 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 186 | rxreq |
| 187 | txresp |
| 188 | } -start |
| 189 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 190 | server s28 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 191 | rxreq |
| 192 | txresp |
| 193 | } -start |
| 194 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 195 | server s30 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 196 | rxreq |
| 197 | txresp |
| 198 | } -start |
| 199 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 200 | server s32 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 201 | rxreq |
| 202 | txresp |
| 203 | } -start |
| 204 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 205 | server s34 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 206 | rxreq |
| 207 | txresp |
| 208 | } -start |
| 209 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 210 | server s36 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 211 | rxreq |
| 212 | txresp |
| 213 | } -start |
| 214 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 215 | server s38 { |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 216 | rxreq |
| 217 | txresp |
| 218 | } -start |
| 219 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 220 | server s1 {} -start |
| 221 | server s3 {} -start |
| 222 | server s5 {} -start |
| 223 | server s7 {} -start |
| 224 | server s9 {} -start |
| 225 | server s11 {} -start |
| 226 | server s13 {} -start |
| 227 | server s15 {} -start |
| 228 | server s17 {} -start |
| 229 | server s19 {} -start |
| 230 | server s21 {} -start |
| 231 | server s23 {} -start |
| 232 | server s25 {} -start |
| 233 | server s27 {} -start |
| 234 | server s29 {} -start |
| 235 | server s31 {} -start |
| 236 | server s33 {} -start |
| 237 | server s35 {} -start |
| 238 | server s37 {} -start |
| 239 | server s39 {} -start |
| 240 | |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 241 | haproxy h1 -conf { |
| 242 | defaults |
| 243 | timeout client 1s |
| 244 | timeout server 1s |
| 245 | timeout connect 1s |
| 246 | balance first |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 247 | default-server no-check inter 20ms downinter 1s rise 1 fall 1 |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 248 | |
| 249 | backend be1 |
| 250 | option log-health-checks |
| 251 | log ${S1_addr}:${S1_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 252 | server srv0 ${s0_addr}:${s0_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 253 | server srv1 ${s1_addr}:${s1_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 254 | |
| 255 | backend be3 |
| 256 | option log-health-checks |
| 257 | log ${S3_addr}:${S3_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 258 | server srv2 ${s2_addr}:${s2_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 259 | server srv3 ${s3_addr}:${s3_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 260 | |
| 261 | backend be5 |
| 262 | option log-health-checks |
| 263 | log ${S5_addr}:${S5_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 264 | server srv4 ${s4_addr}:${s4_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 265 | server srv5 ${s5_addr}:${s5_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 266 | |
| 267 | backend be7 |
| 268 | option log-health-checks |
| 269 | log ${S7_addr}:${S7_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 270 | server srv6 ${s6_addr}:${s6_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 271 | server srv7 ${s7_addr}:${s7_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 272 | |
| 273 | backend be9 |
| 274 | option log-health-checks |
| 275 | log ${S9_addr}:${S9_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 276 | server srv8 ${s8_addr}:${s8_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 277 | server srv9 ${s9_addr}:${s9_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 278 | |
| 279 | backend be11 |
| 280 | option log-health-checks |
| 281 | log ${S11_addr}:${S11_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 282 | server srv10 ${s10_addr}:${s10_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 283 | server srv11 ${s11_addr}:${s11_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 284 | |
| 285 | backend be13 |
| 286 | option log-health-checks |
| 287 | log ${S13_addr}:${S13_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 288 | server srv12 ${s12_addr}:${s12_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 289 | server srv13 ${s13_addr}:${s13_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 290 | |
| 291 | backend be15 |
| 292 | option log-health-checks |
| 293 | log ${S15_addr}:${S15_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 294 | server srv14 ${s14_addr}:${s14_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 295 | server srv15 ${s15_addr}:${s15_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 296 | |
| 297 | backend be17 |
| 298 | option log-health-checks |
| 299 | log ${S17_addr}:${S17_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 300 | server srv16 ${s16_addr}:${s16_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 301 | server srv17 ${s17_addr}:${s17_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 302 | |
| 303 | backend be19 |
| 304 | option log-health-checks |
| 305 | log ${S19_addr}:${S19_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 306 | server srv18 ${s18_addr}:${s18_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 307 | server srv19 ${s19_addr}:${s19_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 308 | |
| 309 | backend be21 |
| 310 | option log-health-checks |
| 311 | log ${S21_addr}:${S21_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 312 | server srv20 ${s20_addr}:${s20_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 313 | server srv21 ${s21_addr}:${s21_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 314 | |
| 315 | backend be23 |
| 316 | option log-health-checks |
| 317 | log ${S23_addr}:${S23_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 318 | server srv22 ${s22_addr}:${s22_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 319 | server srv23 ${s23_addr}:${s23_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 320 | |
| 321 | backend be25 |
| 322 | option log-health-checks |
| 323 | log ${S25_addr}:${S25_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 324 | server srv24 ${s24_addr}:${s24_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 325 | server srv25 ${s25_addr}:${s25_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 326 | |
| 327 | backend be27 |
| 328 | option log-health-checks |
| 329 | log ${S27_addr}:${S27_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 330 | server srv26 ${s26_addr}:${s26_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 331 | server srv27 ${s27_addr}:${s27_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 332 | |
| 333 | backend be29 |
| 334 | option log-health-checks |
| 335 | log ${S29_addr}:${S29_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 336 | server srv28 ${s28_addr}:${s28_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 337 | server srv29 ${s29_addr}:${s29_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 338 | |
| 339 | backend be31 |
| 340 | option log-health-checks |
| 341 | log ${S31_addr}:${S31_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 342 | server srv30 ${s30_addr}:${s30_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 343 | server srv31 ${s31_addr}:${s31_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 344 | |
| 345 | backend be33 |
| 346 | option log-health-checks |
| 347 | log ${S33_addr}:${S33_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 348 | server srv32 ${s32_addr}:${s32_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 349 | server srv33 ${s33_addr}:${s33_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 350 | |
| 351 | backend be35 |
| 352 | option log-health-checks |
| 353 | log ${S35_addr}:${S35_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 354 | server srv34 ${s34_addr}:${s34_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 355 | server srv35 ${s35_addr}:${s35_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 356 | |
| 357 | backend be37 |
| 358 | option log-health-checks |
| 359 | log ${S37_addr}:${S37_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 360 | server srv36 ${s36_addr}:${s36_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 361 | server srv37 ${s37_addr}:${s37_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 362 | |
| 363 | backend be39 |
| 364 | option log-health-checks |
| 365 | log ${S39_addr}:${S39_port} daemon |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 366 | server srv38 ${s38_addr}:${s38_port} |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 367 | server srv39 ${s39_addr}:${s39_port} check |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 368 | |
| 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. |
| 452 | syslog S1 -wait |
| 453 | syslog S3 -wait |
| 454 | syslog S5 -wait |
| 455 | syslog S7 -wait |
| 456 | syslog S9 -wait |
| 457 | syslog S11 -wait |
| 458 | syslog S13 -wait |
| 459 | syslog S15 -wait |
| 460 | syslog S17 -wait |
| 461 | syslog S19 -wait |
| 462 | syslog S21 -wait |
| 463 | syslog S23 -wait |
| 464 | syslog S25 -wait |
| 465 | syslog S27 -wait |
| 466 | syslog S29 -wait |
| 467 | syslog S31 -wait |
| 468 | syslog S33 -wait |
| 469 | syslog S35 -wait |
| 470 | syslog S37 -wait |
| 471 | syslog S39 -wait |
| 472 | |
| 473 | client c1 -connect ${h1_fe1_sock} { |
| 474 | txreq |
| 475 | rxresp |
| 476 | expect resp.status == 200 |
| 477 | } -start |
| 478 | |
| 479 | client c3 -connect ${h1_fe3_sock} { |
| 480 | txreq |
| 481 | rxresp |
| 482 | expect resp.status == 200 |
| 483 | } -start |
| 484 | |
| 485 | client c5 -connect ${h1_fe5_sock} { |
| 486 | txreq |
| 487 | rxresp |
| 488 | expect resp.status == 200 |
| 489 | } -start |
| 490 | |
| 491 | client c7 -connect ${h1_fe7_sock} { |
| 492 | txreq |
| 493 | rxresp |
| 494 | expect resp.status == 200 |
| 495 | } -start |
| 496 | |
| 497 | client c9 -connect ${h1_fe9_sock} { |
| 498 | txreq |
| 499 | rxresp |
| 500 | expect resp.status == 200 |
| 501 | } -start |
| 502 | |
| 503 | client c11 -connect ${h1_fe11_sock} { |
| 504 | txreq |
| 505 | rxresp |
| 506 | expect resp.status == 200 |
| 507 | } -start |
| 508 | |
| 509 | client c13 -connect ${h1_fe13_sock} { |
| 510 | txreq |
| 511 | rxresp |
| 512 | expect resp.status == 200 |
| 513 | } -start |
| 514 | |
| 515 | client c15 -connect ${h1_fe15_sock} { |
| 516 | txreq |
| 517 | rxresp |
| 518 | expect resp.status == 200 |
| 519 | } -start |
| 520 | |
| 521 | client c17 -connect ${h1_fe17_sock} { |
| 522 | txreq |
| 523 | rxresp |
| 524 | expect resp.status == 200 |
| 525 | } -start |
| 526 | |
| 527 | client c19 -connect ${h1_fe19_sock} { |
| 528 | txreq |
| 529 | rxresp |
| 530 | expect resp.status == 200 |
| 531 | } -start |
| 532 | |
| 533 | client c21 -connect ${h1_fe21_sock} { |
| 534 | txreq |
| 535 | rxresp |
| 536 | expect resp.status == 200 |
| 537 | } -start |
| 538 | |
| 539 | client c23 -connect ${h1_fe23_sock} { |
| 540 | txreq |
| 541 | rxresp |
| 542 | expect resp.status == 200 |
| 543 | } -start |
| 544 | |
| 545 | client c25 -connect ${h1_fe25_sock} { |
| 546 | txreq |
| 547 | rxresp |
| 548 | expect resp.status == 200 |
| 549 | } -start |
| 550 | |
| 551 | client c27 -connect ${h1_fe27_sock} { |
| 552 | txreq |
| 553 | rxresp |
| 554 | expect resp.status == 200 |
| 555 | } -start |
| 556 | |
| 557 | client c29 -connect ${h1_fe29_sock} { |
| 558 | txreq |
| 559 | rxresp |
| 560 | expect resp.status == 200 |
| 561 | } -start |
| 562 | |
| 563 | client c31 -connect ${h1_fe31_sock} { |
| 564 | txreq |
| 565 | rxresp |
| 566 | expect resp.status == 200 |
| 567 | } -start |
| 568 | |
| 569 | client c33 -connect ${h1_fe33_sock} { |
| 570 | txreq |
| 571 | rxresp |
| 572 | expect resp.status == 200 |
| 573 | } -start |
| 574 | |
| 575 | client c35 -connect ${h1_fe35_sock} { |
| 576 | txreq |
| 577 | rxresp |
| 578 | expect resp.status == 200 |
| 579 | } -start |
| 580 | |
| 581 | client c37 -connect ${h1_fe37_sock} { |
| 582 | txreq |
| 583 | rxresp |
| 584 | expect resp.status == 200 |
| 585 | } -start |
| 586 | |
| 587 | client c39 -connect ${h1_fe39_sock} { |
| 588 | txreq |
| 589 | rxresp |
| 590 | expect resp.status == 200 |
| 591 | } -start |
| 592 | |
| 593 | client c1 -wait |
| 594 | client c3 -wait |
| 595 | client c5 -wait |
| 596 | client c7 -wait |
| 597 | client c9 -wait |
| 598 | client c11 -wait |
| 599 | client c13 -wait |
| 600 | client c15 -wait |
| 601 | client c17 -wait |
| 602 | client c19 -wait |
| 603 | client c21 -wait |
| 604 | client c23 -wait |
| 605 | client c25 -wait |
| 606 | client c27 -wait |
| 607 | client c29 -wait |
| 608 | client c31 -wait |
| 609 | client c33 -wait |
| 610 | client c35 -wait |
| 611 | client c37 -wait |
| 612 | client c39 -wait |
| 613 | |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 614 | server s0 -wait |
| 615 | server s2 -wait |
| 616 | server s4 -wait |
| 617 | server s6 -wait |
| 618 | server s8 -wait |
| 619 | server s10 -wait |
| 620 | server s12 -wait |
| 621 | server s14 -wait |
| 622 | server s16 -wait |
| 623 | server s18 -wait |
| 624 | server s20 -wait |
| 625 | server s22 -wait |
| 626 | server s24 -wait |
| 627 | server s26 -wait |
| 628 | server s28 -wait |
| 629 | server s30 -wait |
| 630 | server s32 -wait |
| 631 | server s34 -wait |
| 632 | server s36 -wait |
| 633 | server s38 -wait |
Frederic Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 634 | |
| 635 | |
| 636 | haproxy h1 -cli { |
| 637 | send "show servers state" |
Willy Tarreau | a2f44a9 | 2022-02-21 20:44:00 +0100 | [diff] [blame] | 638 | # 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 Lecaille | 573d289 | 2018-12-13 22:15:08 +0100 | [diff] [blame] | 644 | } |
| 645 | |