blob: eb2e08e047f577338f8814c488b538786504a53d [file] [log] [blame]
Christopher Fauletf97f8462020-04-24 16:25:28 +02001varnishtest "Health-checks: agent-check"
2#REGTEST_TYPE=slow
3feature ignore_unknown_macro
4
5barrier b1 cond 2 -cyclic
6barrier b2 cond 2 -cyclic
7
8server s1 {
9 barrier b1 sync
10 recv 5
11 send "75%,max-conn:30,maint,down\n"
Christopher Fauletcb436f02020-05-05 08:10:36 +020012 expect_close
Christopher Fauletf97f8462020-04-24 16:25:28 +020013 barrier b2 sync
14} -start
15
16
17haproxy 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
30haproxy 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}