mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-18 09:24:31 +00:00
cb436f0c29
agent-check.vtc script fails time to time because the 2nd cli command is sent to early. Waiting for the connection close in the s1 server should be enough to be sure the server state is updated.
38 lines
980 B
Plaintext
38 lines
980 B
Plaintext
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
|
|
send "75%,max-conn:30,maint,down\n"
|
|
expect_close
|
|
barrier b2 sync
|
|
} -start
|
|
|
|
|
|
haproxy h1 -conf {
|
|
defaults
|
|
mode tcp
|
|
timeout client 1s
|
|
timeout server 1s
|
|
timeout connect 100ms
|
|
|
|
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} -"
|
|
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} -"
|
|
}
|