blob: 356ddf61c140d2e4c663725fc13b1e465a21bcb8 [file] [log] [blame]
Jérôme Magnin885f64f2019-07-15 20:19:42 +02001varnishtest "tcp-check multiple ports"
Jérôme Magnin0d00b542019-07-23 23:23:16 +02002#EXCLUDE_TARGETS=freebsd,osx,generic
Jérôme Magnin885f64f2019-07-15 20:19:42 +02003#REGTEST_TYPE=slow
4# This test uses multiple tcp-check connect rules to perform health checking on
5# a target. It relies on port 1 being unbound on the local system.
6feature ignore_unknown_macro
7
8syslog S1 -level notice {
9 recv
Jérôme Magnin885f64f2019-07-15 20:19:42 +020010 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be1/srv1 failed.*Connection refused at step 2 of tcp-check.*connect port 1"
11} -start
12
13syslog S2 -level notice {
14 recv
Jérôme Magnin885f64f2019-07-15 20:19:42 +020015 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be2/srv1 failed.*Connection refused at step 1 of tcp-check.*connect port 1"
16} -start
17
18server s1 {
19} -start
20
21haproxy h1 -conf {
22 defaults
23 mode tcp
Willy Tarreauf6739232021-11-18 17:46:22 +010024 timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
25 timeout check "${HAPROXY_TEST_TIMEOUT-5s}"
26 timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
27 timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
Willy Tarreau04068a12019-10-22 13:06:59 +020028 #default-server check inter 200ms rise 1 fall 1
Jérôme Magnin885f64f2019-07-15 20:19:42 +020029
30 backend be1
31 log ${S1_addr}:${S1_port} len 2048 local0
32 option tcp-check
33 option log-health-checks
34 tcp-check connect port ${s1_port}
35 tcp-check connect port 1
Willy Tarreau04068a12019-10-22 13:06:59 +020036 server srv1 ${s1_addr}:${s1_port} check inter 200ms rise 1 fall 1
Jérôme Magnin885f64f2019-07-15 20:19:42 +020037
38 backend be2
39 log ${S2_addr}:${S2_port} len 2048 local0
40 option tcp-check
41 option log-health-checks
42 tcp-check connect port 1
43 tcp-check connect port ${s1_port}
Willy Tarreau04068a12019-10-22 13:06:59 +020044 server srv1 ${s1_addr}:${s1_port} check inter 200ms rise 1 fall 1
Jérôme Magnin885f64f2019-07-15 20:19:42 +020045} -start
46
47syslog S1 -wait
48syslog S2 -wait