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/compression/lua_validation.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 'reg-tests/compression/lua_validation.vtc')
-rw-r--r-- | reg-tests/compression/lua_validation.vtc | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/reg-tests/compression/lua_validation.vtc b/reg-tests/compression/lua_validation.vtc new file mode 100644 index 0000000..b10cbd9 --- /dev/null +++ b/reg-tests/compression/lua_validation.vtc @@ -0,0 +1,59 @@ +# Checks that compression doesn't cause corruption.. + +varnishtest "Compression validation" +#REQUIRE_OPTIONS=ZLIB|SLZ,LUA,OPENSSL +#REGTEST_TYPE=slow + +feature ignore_unknown_macro + +haproxy h1 -conf { +global +# log stdout format short daemon + lua-load ${testdir}/lua_validation.lua + +defaults + mode http + log global + option httplog + +frontend main-https + bind "fd@${fe1}" ssl crt ${testdir}/common.pem + compression algo gzip + compression type text/html text/plain application/json application/javascript + compression offload + use_backend TestBack if TRUE + +backend TestBack + server LocalSrv ${h1_fe2_addr}:${h1_fe2_port} + +listen fileloader + mode http + bind "fd@${fe2}" + http-request use-service lua.fileloader-http01 +} -start + +shell { + HOST=${h1_fe1_addr} + if [ "${h1_fe1_addr}" = "::1" ] ; then + HOST="\[::1\]" + fi + + md5=$(command -v md5 || command -v md5sum) + + if [ -z $md5 ] ; then + echo "MD5 checksum utility not found" + exit 1 + fi + + expectchecksum="4d9c62aa5370b8d5f84f17ec2e78f483" + + for opt in "" "--limit-rate 300K" "--limit-rate 500K" ; do + checksum=$(curl --max-time 15 --compressed -k "https://$HOST:${h1_fe1_port}" $opt | $md5 | cut -d ' ' -f1) + if [ "$checksum" != "$expectchecksum" ] ; then + echo "Expecting checksum $expectchecksum" + echo "Received checksum: $checksum" + exit 1; + fi + done + +} -run |