2020-04-24 14:25:28 +00:00
|
|
|
varnishtest "Health-checks: agent-check"
|
|
|
|
#REGTEST_TYPE=slow
|
|
|
|
feature ignore_unknown_macro
|
|
|
|
|
|
|
|
barrier b1 cond 2 -cyclic
|
|
|
|
barrier b2 cond 2 -cyclic
|
|
|
|
|
|
|
|
server s1 {
|
|
|
|
barrier b1 sync
|
|
|
|
recv 5
|
2021-06-22 14:23:11 +00:00
|
|
|
send "75%,maxconn:30,maint,down\n"
|
2020-05-05 06:10:36 +00:00
|
|
|
expect_close
|
2020-04-24 14:25:28 +00:00
|
|
|
barrier b2 sync
|
|
|
|
} -start
|
|
|
|
|
|
|
|
|
|
|
|
haproxy h1 -conf {
|
|
|
|
defaults
|
|
|
|
mode tcp
|
2021-11-18 16:46:22 +00:00
|
|
|
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
|
2020-04-24 14:25:28 +00:00
|
|
|
|
|
|
|
backend be1
|
|
|
|
log ${S1_addr}:${S1_port} daemon
|
|
|
|
option log-health-checks
|
|
|
|
server srv ${s1_addr}:${s1_port} weight 100 agent-check agent-addr ${s1_addr} agent-port ${s1_port} agent-send "pouet" agent-inter 100ms
|
|
|
|
} -start
|
|
|
|
|
|
|
|
haproxy h1 -cli {
|
|
|
|
send "show servers state"
|
|
|
|
expect ~ "be1 1 srv 127.0.0.1 2 0 100 100 [[:digit:]]+ 1 0 [[:digit:]] 0 [[:digit:]]+ 0 0 - ${s1_port} -"
|
2021-06-22 14:23:11 +00:00
|
|
|
send "show stat"
|
|
|
|
expect ~ "be1,srv,0,0,0,0,,"
|
|
|
|
|
2020-04-24 14:25:28 +00:00
|
|
|
barrier b1 sync
|
|
|
|
barrier b2 sync
|
|
|
|
send "show servers state"
|
|
|
|
expect ~ "be1 1 srv 127.0.0.1 0 1 75 100 [[:digit:]]+ 1 0 [[:digit:]] 0 [[:digit:]]+ 0 0 - ${s1_port} -"
|
2021-06-22 14:23:11 +00:00
|
|
|
send "show stat"
|
|
|
|
expect ~ "be1,srv,0,0,0,0,30"
|
2020-04-24 14:25:28 +00:00
|
|
|
}
|