blob: a61e9e8455150059fea21296f1e94265e9eafa82 [file] [log] [blame]
Jérôme Magnin885f64f2019-07-15 20:19:42 +02001varnishtest "tcp-check multiple ports"
2#REGTEST_TYPE=slow
3# This test uses multiple tcp-check connect rules to perform health checking on
4# a target. It relies on port 1 being unbound on the local system.
5feature ignore_unknown_macro
6
7syslog S1 -level notice {
8 recv
9 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Proxy be1 started."
10 recv
11 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be1/srv1 failed.*Connection refused at step 2 of tcp-check.*connect port 1"
12} -start
13
14syslog S2 -level notice {
15 recv
16 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Proxy be2 started."
17 recv
18 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be2/srv1 failed.*Connection refused at step 1 of tcp-check.*connect port 1"
19} -start
20
21server s1 {
22} -start
23
24haproxy h1 -conf {
25 defaults
26 mode tcp
27 timeout connect 200ms
28 timeout check 500ms
29 timeout server 5s
30 timeout client 5s
31 default-server check inter 200ms rise 1 fall 1
32
33 backend be1
34 log ${S1_addr}:${S1_port} len 2048 local0
35 option tcp-check
36 option log-health-checks
37 tcp-check connect port ${s1_port}
38 tcp-check connect port 1
39 server srv1 ${s1_addr}:${s1_port}
40
41 backend be2
42 log ${S2_addr}:${S2_port} len 2048 local0
43 option tcp-check
44 option log-health-checks
45 tcp-check connect port 1
46 tcp-check connect port ${s1_port}
47 server srv1 ${s1_addr}:${s1_port}
48} -start
49
50syslog S1 -wait
51syslog S2 -wait