blob: 5cf51c658e639166053c257dd62bf657b1e15c3f [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
Amaury Denoyellee500e592021-06-22 16:23:11 +020011 send "75%,maxconn: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
Willy Tarreauf6739232021-11-18 17:46:22 +010020 timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
21 timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
22 timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
Christopher Fauletf97f8462020-04-24 16:25:28 +020023
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} -"
Amaury Denoyellee500e592021-06-22 16:23:11 +020033 send "show stat"
34 expect ~ "be1,srv,0,0,0,0,,"
35
Christopher Fauletf97f8462020-04-24 16:25:28 +020036 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 Denoyellee500e592021-06-22 16:23:11 +020040 send "show stat"
41 expect ~ "be1,srv,0,0,0,0,30"
Christopher Fauletf97f8462020-04-24 16:25:28 +020042}