Jérôme Magnin | 885f64f | 2019-07-15 20:19:42 +0200 | [diff] [blame] | 1 | varnishtest "tcp-check multiple ports" |
Jérôme Magnin | 0d00b54 | 2019-07-23 23:23:16 +0200 | [diff] [blame] | 2 | #EXCLUDE_TARGETS=freebsd,osx,generic |
Jérôme Magnin | 885f64f | 2019-07-15 20:19:42 +0200 | [diff] [blame] | 3 | #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. |
| 6 | feature ignore_unknown_macro |
| 7 | |
| 8 | syslog 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 | |
| 15 | syslog 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 | |
| 22 | server s1 { |
| 23 | } -start |
| 24 | |
| 25 | haproxy h1 -conf { |
| 26 | defaults |
| 27 | mode tcp |
| 28 | timeout connect 200ms |
| 29 | timeout check 500ms |
| 30 | timeout server 5s |
| 31 | timeout client 5s |
Willy Tarreau | 04068a1 | 2019-10-22 13:06:59 +0200 | [diff] [blame] | 32 | #default-server check inter 200ms rise 1 fall 1 |
Jérôme Magnin | 885f64f | 2019-07-15 20:19:42 +0200 | [diff] [blame] | 33 | |
| 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 Tarreau | 04068a1 | 2019-10-22 13:06:59 +0200 | [diff] [blame] | 40 | server srv1 ${s1_addr}:${s1_port} check inter 200ms rise 1 fall 1 |
Jérôme Magnin | 885f64f | 2019-07-15 20:19:42 +0200 | [diff] [blame] | 41 | |
| 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 Tarreau | 04068a1 | 2019-10-22 13:06:59 +0200 | [diff] [blame] | 48 | server srv1 ${s1_addr}:${s1_port} check inter 200ms rise 1 fall 1 |
Jérôme Magnin | 885f64f | 2019-07-15 20:19:42 +0200 | [diff] [blame] | 49 | } -start |
| 50 | |
| 51 | syslog S1 -wait |
| 52 | syslog S2 -wait |