diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:18:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:18:05 +0000 |
commit | b46aad6df449445a9fc4aa7b32bd40005438e3f7 (patch) | |
tree | 751aa858ca01f35de800164516b298887382919d /reg-tests/filters/random-forwarding.vtc | |
parent | Initial commit. (diff) | |
download | haproxy-b46aad6df449445a9fc4aa7b32bd40005438e3f7.tar.xz haproxy-b46aad6df449445a9fc4aa7b32bd40005438e3f7.zip |
Adding upstream version 2.9.5.upstream/2.9.5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | reg-tests/filters/random-forwarding.vtc | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/reg-tests/filters/random-forwarding.vtc b/reg-tests/filters/random-forwarding.vtc new file mode 100644 index 0000000..abb2bcc --- /dev/null +++ b/reg-tests/filters/random-forwarding.vtc @@ -0,0 +1,138 @@ +varnishtest "Filtering test with several filters and random forwarding (via trace filter)" + +#REQUIRE_VERSION=2.4 +#REQUIRE_OPTION=ZLIB|SLZ +#REGTEST_TYPE=slow + +feature ignore_unknown_macro + +barrier b1 cond 2 -cyclic + +server s1 { + rxreq + expect req.url == "/" + expect req.bodylen == 1048576 + expect req.http.accept-encoding == "<undef>" + txresp \ + -hdr "Content-Type: text/plain" \ + -bodylen 1048576 + + rxreq + expect req.url == "127.0.0.1:80" + txresp -nolen + recv 36000 + send_n 1000 "0123456789abcdefghijklmnopqrstuvwxyz" + barrier b1 sync + + accept + rxreq + expect req.url == "/" + txresp -nolen \ + -hdr "Content-Type: text/plain" \ + -bodylen 20480 + close + + accept + rxreq + expect req.url == "/" + txresp -nolen + close + + accept + rxreq + expect req.url == "/" + expect req.bodylen == 20480 + txresp -nolen \ + -hdr "Content-Type: text/plain" \ + -bodylen 20480 + +} -start + +haproxy h1 -conf { + defaults + mode http + timeout connect "${HAPROXY_TEST_TIMEOUT-5s}" + timeout client "${HAPROXY_TEST_TIMEOUT-5s}" + timeout server "${HAPROXY_TEST_TIMEOUT-5s}" + + frontend fe1 + bind "fd@${fe1}" + + compression offload + compression algo gzip + + filter trace name "BEFORE" random-forwarding quiet + filter compression + filter trace name "AFTER" random-forwarding quiet + default_backend be1 + + backend be1 + server www ${s1_addr}:${s1_port} + + listen li1 + mode tcp + bind "fd@${li1}" + # Validate nothing is blocked in TCP mode + filter compression + server www ${s1_addr}:${s1_port} + + +} -start + +client c1 -connect ${h1_fe1_sock} { + txreq -url "/" \ + -hdr "Accept-Encoding: gzip" \ + -hdr "Content-Type: text/plain" \ + -bodylen 1048576 + rxresp + expect resp.status == 200 + expect resp.http.content-encoding == "gzip" + expect resp.http.transfer-encoding == "chunked" + gunzip + expect resp.bodylen == 1048576 + + txreq -method "CONNECT" -url "127.0.0.1:80" -nolen + rxresp -no_obj + expect resp.status == 200 + send_n 1000 "0123456789abcdefghijklmnopqrstuvwxyz" + recv 36000 + barrier b1 sync +} -run + +client c2 -connect ${h1_fe1_sock} { + txreq -url "/" \ + -hdr "Accept-Encoding: gzip" \ + -hdr "Content-Type: text/plain" + rxresp + expect resp.status == 200 + expect resp.http.content-encoding == "<undef>" + expect resp.http.transfer-encoding == "<undef>" + expect resp.http.content-length == "<undef>" + expect resp.bodylen == 20480 +} -run + +client c3 -connect ${h1_fe1_sock} { + txreq -url "/" \ + -hdr "Accept-Encoding: gzip" \ + -hdr "Content-Type: text/plain" + rxresp + expect resp.status == 200 + expect resp.http.content-encoding == "<undef>" + expect resp.http.transfer-encoding == "<undef>" + expect resp.http.content-length == "<undef>" + expect resp.bodylen == 0 +} -run + +client c4 -connect ${h1_li1_sock} { + txreq -url "/" \ + -hdr "Accept-Encoding: gzip" \ + -hdr "Content-Type: text/plain" \ + -bodylen 20480 + rxresp + expect resp.status == 200 + expect resp.http.content-encoding == "<undef>" + expect resp.http.transfer-encoding == "<undef>" + expect resp.http.content-length == "<undef>" + expect resp.bodylen == 20480 + expect_close +} -run |