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 |
Jérôme Magnin | 885f64f | 2019-07-15 20:19:42 +0200 | [diff] [blame] | 10 | expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be1/srv1 failed.*Connection refused at step 2 of tcp-check.*connect port 1" |
| 11 | } -start |
| 12 | |
| 13 | syslog S2 -level notice { |
| 14 | recv |
Jérôme Magnin | 885f64f | 2019-07-15 20:19:42 +0200 | [diff] [blame] | 15 | expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be2/srv1 failed.*Connection refused at step 1 of tcp-check.*connect port 1" |
| 16 | } -start |
| 17 | |
| 18 | server s1 { |
| 19 | } -start |
| 20 | |
| 21 | haproxy h1 -conf { |
| 22 | defaults |
| 23 | mode tcp |
Willy Tarreau | f673923 | 2021-11-18 17:46:22 +0100 | [diff] [blame] | 24 | 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 Tarreau | 04068a1 | 2019-10-22 13:06:59 +0200 | [diff] [blame] | 28 | #default-server check inter 200ms rise 1 fall 1 |
Jérôme Magnin | 885f64f | 2019-07-15 20:19:42 +0200 | [diff] [blame] | 29 | |
| 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 Tarreau | 04068a1 | 2019-10-22 13:06:59 +0200 | [diff] [blame] | 36 | 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] | 37 | |
| 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 Tarreau | 04068a1 | 2019-10-22 13:06:59 +0200 | [diff] [blame] | 44 | 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] | 45 | } -start |
| 46 | |
| 47 | syslog S1 -wait |
| 48 | syslog S2 -wait |