haproxy/reg-tests/ssl/crt_store.vtc
Frederic Lecaille 6e94b69665 REGTESTS: ssl: Move all the SSL certificates, keys, crt-lists inside "certs" directory
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"
 }
2025-12-08 10:40:59 +01:00

42 lines
960 B
Plaintext

#REGTEST_TYPE=devel
varnishtest "Test the crt-store section"
feature cmd "$HAPROXY_PROGRAM -cc 'version_atleast(3.0-dev7)'"
feature cmd "$HAPROXY_PROGRAM -cc 'feature(OPENSSL)'"
feature ignore_unknown_macro
#
# Basic check for the crt-store, ensure that loading works and that we can't
# load a crt which was used before
#
haproxy h1 -arg -V -conf-OK {
global
.if feature(THREAD)
thread-groups 1
.endif
crt-store
load crt "${testdir}/certs/common.crt" key "${testdir}/certs/common.key"
defaults
timeout client 30s
timeout server 30s
timeout connect 30s
listen ssl-lst
bind "${tmpdir}/ssl.sock" ssl crt "${testdir}/certs/common.crt" strict-sni
}
haproxy h2 -arg -V -conf-BAD {} {
listen ssl-lst
bind "${tmpdir}/ssl.sock" ssl crt "${testdir}/certs/common.pem" strict-sni
crt-store
load crt "${testdir}/certs/common.pem" key "${testdir}/certs/common.key"
}