blob: daa3c5f69bade30ac0e891d9a049d4b07f992bfa [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
10 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Proxy be1 started."
11 recv
12 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be1/srv1 failed.*Connection refused at step 2 of tcp-check.*connect port 1"
13} -start
14
15syslog S2 -level notice {
16 recv
17 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Proxy be2 started."
18 recv
19 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be2/srv1 failed.*Connection refused at step 1 of tcp-check.*connect port 1"
20} -start
21
22server s1 {
23} -start
24
25haproxy h1 -conf {
26 defaults
27 mode tcp
28 timeout connect 200ms
29 timeout check 500ms
30 timeout server 5s
31 timeout client 5s
Willy Tarreau04068a12019-10-22 13:06:59 +020032 #default-server check inter 200ms rise 1 fall 1
Jérôme Magnin885f64f2019-07-15 20:19:42 +020033
34 backend be1
35 log ${S1_addr}:${S1_port} len 2048 local0
36 option tcp-check
37 option log-health-checks
38 tcp-check connect port ${s1_port}
39 tcp-check connect port 1
Willy Tarreau04068a12019-10-22 13:06:59 +020040 server srv1 ${s1_addr}:${s1_port} check inter 200ms rise 1 fall 1
Jérôme Magnin885f64f2019-07-15 20:19:42 +020041
42 backend be2
43 log ${S2_addr}:${S2_port} len 2048 local0
44 option tcp-check
45 option log-health-checks
46 tcp-check connect port 1
47 tcp-check connect port ${s1_port}
Willy Tarreau04068a12019-10-22 13:06:59 +020048 server srv1 ${s1_addr}:${s1_port} check inter 200ms rise 1 fall 1
Jérôme Magnin885f64f2019-07-15 20:19:42 +020049} -start
50
51syslog S1 -wait
52syslog S2 -wait