blob: 4bab93474b7cda03fccaa6bd9956caddbb2e2954 [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
Amaury Denoyellee500e592021-06-22 16:23:11 +020012 send "75%,maxconn: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} -"
Amaury Denoyellee500e592021-06-22 16:23:11 +020034 send "show stat"
35 expect ~ "be1,srv,0,0,0,0,,"
36
Christopher Fauletf97f8462020-04-24 16:25:28 +020037 barrier b1 sync
38 barrier b2 sync
39 send "show servers state"
40 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 +020041 send "show stat"
42 expect ~ "be1,srv,0,0,0,0,30"
Christopher Fauletf97f8462020-04-24 16:25:28 +020043}