haproxy/reg-tests/compression/lua_validation.vtc
Aurelien DARRAGON f2838f5172 REGTESTS: fix lua-based regtests using tune.lua.smp-preserve-bool
Because of the previous commit, configs making use of lua script without
setting "tune.lua.smp-preserve-bool" explicitly now raise a warning.

However, since 6f746af91 ("REGTESTS: use -dW by default on every
reg-tests"), regtests are not allowed to raise warnings anymore.

Because of this the CI now fails for every tests that relies on Lua.
To fix this, let's explicitly set the "tune.lua.smp-preserve-bool" for
all tests involving Lua. Here we set the value to "on" because we know
it is safe to do so, and this way it will be future-proof.

If ec7443827 ("MINOR: hlua: add option to preserve bool type from smp to
lua") is backported, then this patch must be backported with it (if it
is not trivial to backport, then simply follow this rule: grep for
"lua-load" in reg-tests directory, then for each match, make sure to set
the tune.smp-preserve-bool tunable in the global section.
2024-12-19 14:21:35 +01:00

61 lines
1.4 KiB
Plaintext

# 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
tune.lua.smp-preserve-bool on
lua-load ${testdir}/lua_validation.lua
defaults
timeout client 30s
timeout server 30s
timeout connect 30s
mode http
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