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 |
| 11 | send "75%,max-conn: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 |
| 20 | timeout client 1s |
| 21 | timeout server 1s |
| 22 | timeout connect 100ms |
| 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} -" |
| 33 | barrier b1 sync |
| 34 | barrier b2 sync |
| 35 | send "show servers state" |
| 36 | expect ~ "be1 1 srv 127.0.0.1 0 1 75 100 [[:digit:]]+ 1 0 [[:digit:]] 0 [[:digit:]]+ 0 0 - ${s1_port} -" |
| 37 | } |