blob: 134569319ae2e3da323a4fe3f501a68b880edacc [file] [log] [blame]
Christopher Fauletf97f8462020-04-24 16:25:28 +02001varnishtest "Health-checks: agent-check"
Willy Tarreau55da2b92020-09-29 10:58:04 +02002#REQUIRE_VERSION=1.8
Christopher Fauletf97f8462020-04-24 16:25:28 +02003#REGTEST_TYPE=slow
4feature ignore_unknown_macro
5
6barrier b1 cond 2 -cyclic
7barrier b2 cond 2 -cyclic
8
9server s1 {
10 barrier b1 sync
11 recv 5
12 send "75%,max-conn:30,maint,down\n"
Christopher Fauletcb436f02020-05-05 08:10:36 +020013 expect_close
Christopher Fauletf97f8462020-04-24 16:25:28 +020014 barrier b2 sync
15} -start
16
17
18haproxy h1 -conf {
19 defaults
20 mode tcp
21 timeout client 1s
22 timeout server 1s
23 timeout connect 100ms
24
25 backend be1
26 log ${S1_addr}:${S1_port} daemon
27 option log-health-checks
28 server srv ${s1_addr}:${s1_port} weight 100 agent-check agent-addr ${s1_addr} agent-port ${s1_port} agent-send "pouet" agent-inter 100ms
29} -start
30
31haproxy h1 -cli {
32 send "show servers state"
33 expect ~ "be1 1 srv 127.0.0.1 2 0 100 100 [[:digit:]]+ 1 0 [[:digit:]] 0 [[:digit:]]+ 0 0 - ${s1_port} -"
34 barrier b1 sync
35 barrier b2 sync
36 send "show servers state"
37 expect ~ "be1 1 srv 127.0.0.1 0 1 75 100 [[:digit:]]+ 1 0 [[:digit:]] 0 [[:digit:]]+ 0 0 - ${s1_port} -"
38}