mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-12-02 16:21:27 +01:00
Move all these files and others for OCSP tests found into reg-tests/ssl
to reg-test/ssl/certs and adapt all the VTC files which use them.
This patch is needed by other tests which have to include the SSL tests.
Indeed, some VTC commands contain paths to these files which cannot
be customized with environment variables, depending on the location the VTC file
is runi from, because VTC does not resolve the environment variables. Only macros
as ${testdir} can be resolved.
For instance this command run from a VTC file from reg-tests/ssl directory cannot
be reused from another directory, except if we add a symbolic link for each certs,
key etc.
haproxy h1 -cli {
send "del ssl crt-list ${testdir}/localhost.crt-list ${testdir}/common.pem:1"
}
This is not what we want. We add a symbolic link to reg-test/ssl/certs to the
directory and modify the command above as follows:
haproxy h1 -cli {
send "del ssl crt-list ${testdir}/certs/localhost.crt-list ${testdir}/certs/common.pem:1"
}
65 lines
1.5 KiB
Plaintext
65 lines
1.5 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
|
|
.if feature(THREAD)
|
|
thread-groups 1
|
|
.endif
|
|
|
|
tune.lua.bool-sample-conversion normal
|
|
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}/certs/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
|