Christopher Faulet | f97f846 | 2020-04-24 16:25:28 +0200 | [diff] [blame] | 1 | varnishtest "Health-checks: agent-check" |
| 2 | #REGTEST_TYPE=slow |
| 3 | feature ignore_unknown_macro |
| 4 | |
| 5 | barrier b1 cond 2 -cyclic |
| 6 | barrier b2 cond 2 -cyclic |
| 7 | |
| 8 | server s1 { |
| 9 | barrier b1 sync |
| 10 | recv 5 |
Amaury Denoyelle | e500e59 | 2021-06-22 16:23:11 +0200 | [diff] [blame] | 11 | send "75%,maxconn:30,maint,down\n" |
Christopher Faulet | cb436f0 | 2020-05-05 08:10:36 +0200 | [diff] [blame] | 12 | expect_close |
Christopher Faulet | f97f846 | 2020-04-24 16:25:28 +0200 | [diff] [blame] | 13 | barrier b2 sync |
| 14 | } -start |
| 15 | |
| 16 | |
| 17 | haproxy h1 -conf { |
| 18 | defaults |
| 19 | mode tcp |
Willy Tarreau | f673923 | 2021-11-18 17:46:22 +0100 | [diff] [blame] | 20 | timeout client "${HAPROXY_TEST_TIMEOUT-5s}" |
| 21 | timeout server "${HAPROXY_TEST_TIMEOUT-5s}" |
| 22 | timeout connect "${HAPROXY_TEST_TIMEOUT-5s}" |
Christopher Faulet | f97f846 | 2020-04-24 16:25:28 +0200 | [diff] [blame] | 23 | |
| 24 | backend be1 |
| 25 | log ${S1_addr}:${S1_port} daemon |
| 26 | option log-health-checks |
| 27 | server srv ${s1_addr}:${s1_port} weight 100 agent-check agent-addr ${s1_addr} agent-port ${s1_port} agent-send "pouet" agent-inter 100ms |
| 28 | } -start |
| 29 | |
| 30 | haproxy h1 -cli { |
| 31 | send "show servers state" |
| 32 | expect ~ "be1 1 srv 127.0.0.1 2 0 100 100 [[:digit:]]+ 1 0 [[:digit:]] 0 [[:digit:]]+ 0 0 - ${s1_port} -" |
Amaury Denoyelle | e500e59 | 2021-06-22 16:23:11 +0200 | [diff] [blame] | 33 | send "show stat" |
| 34 | expect ~ "be1,srv,0,0,0,0,," |
| 35 | |
Christopher Faulet | f97f846 | 2020-04-24 16:25:28 +0200 | [diff] [blame] | 36 | barrier b1 sync |
| 37 | barrier b2 sync |
| 38 | send "show servers state" |
| 39 | expect ~ "be1 1 srv 127.0.0.1 0 1 75 100 [[:digit:]]+ 1 0 [[:digit:]] 0 [[:digit:]]+ 0 0 - ${s1_port} -" |
Amaury Denoyelle | e500e59 | 2021-06-22 16:23:11 +0200 | [diff] [blame] | 40 | send "show stat" |
| 41 | expect ~ "be1,srv,0,0,0,0,30" |
Christopher Faulet | f97f846 | 2020-04-24 16:25:28 +0200 | [diff] [blame] | 42 | } |