diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:35:11 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:35:11 +0000 |
commit | da76459dc21b5af2449af2d36eb95226cb186ce2 (patch) | |
tree | 542ebb3c1e796fac2742495b8437331727bbbfa0 /reg-tests/webstats/webstats-scope-and-post-change.vtc | |
parent | Initial commit. (diff) | |
download | haproxy-upstream/2.6.12.tar.xz haproxy-upstream/2.6.12.zip |
Adding upstream version 2.6.12.upstream/2.6.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | reg-tests/webstats/webstats-scope-and-post-change.vtc | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/reg-tests/webstats/webstats-scope-and-post-change.vtc b/reg-tests/webstats/webstats-scope-and-post-change.vtc new file mode 100644 index 0000000..e896c05 --- /dev/null +++ b/reg-tests/webstats/webstats-scope-and-post-change.vtc @@ -0,0 +1,84 @@ +varnishtest "Webgui stats page check filtering with scope and changing server state" + +feature ignore_unknown_macro + +server s1 { +} -start + +haproxy h1 -conf { + global + # WT: limit false-positives causing "HTTP header incomplete" due to + # idle server connections being randomly used and randomly expiring + # under us. + tune.idle-pool.shared off + + defaults + mode http + + frontend fe1 + bind "fd@${fe1}" + stats enable + stats refresh 5s + stats uri / + stats admin if TRUE + + backend b1 + server srv1 ${s1_addr}:${s1_port} + server srv2 ${s1_addr}:${s1_port} + server srv3 ${s1_addr}:${s1_port} + + backend b2 + server srv1 ${s1_addr}:${s1_port} + server srv2 ${s1_addr}:${s1_port} + +} -start + +client c1 -connect ${h1_fe1_sock} { + txreq -url "/;csv;" + rxresp + expect resp.status == 200 +} -run + +client c2 -connect ${h1_fe1_sock} { + txreq -url "/?;csv;scope=b1" + rxresp + expect resp.status == 200 +} -run + +haproxy h1 -cli { + send "show stat" + expect ~ .* +} + +client c3 -connect ${h1_fe1_sock} { + txreq -url "/" + rxresp + expect resp.status == 200 + + txreq -url "/?;csv;scope=b1" + rxresp + expect resp.status == 200 + expect resp.body ~ ".*\nb1,BACKEND.*" + expect resp.body !~ ".*\nb2,BACKEND.*" + + txreq -req "POST" -url "/?scope=b2" -body "s=srv1&s=srv2&s=srv3&action=maint&b=%233" + rxresp + expect resp.status == 303 + + txreq -req "POST" -url "/" -body "s=srv2&action=drain&b=%233" + rxresp + expect resp.status == 303 + + txreq -req "POST" -url "/" -body "s=srv1&action=maint&b=%234" + rxresp + expect resp.status == 303 + + txreq -url "/?;csv;scope=fe1" + rxresp + expect resp.status == 200 +} -run + +haproxy h1 -cli { + send "show stat" + expect ~ "\nb1,srv1.*MAINT.*\nb1,srv2.*DRAIN.*\nb1,srv3.*MAINT.*\nb1,BACKEND.*DOWN.*\nb2,srv1.*MAINT.*\nb2,srv2.*no check.*\nb2,BACKEND.*UP" +} -wait |