]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REGTEST: ssl/cli: tests options and filters w/ add ssl crt-list
authorWilliam Lallemand <wlallemand@haproxy.com>
Wed, 1 Apr 2020 15:13:22 +0000 (17:13 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 1 Apr 2020 18:10:53 +0000 (20:10 +0200)
Now that the 'add ssl crt-list' command supports filters and options,
add some in the vtc file to test them.

reg-tests/ssl/add_ssl_crt-list.vtc

index 173db56c189e49664c2663913415ce2376377542..a02ccf4a934a5ce31bf0a2c1ec31aa680ac2f2de 100644 (file)
@@ -46,7 +46,7 @@ shell {
    echo "new ssl cert ${testdir}/ecdsa.pem" | socat "${tmpdir}/h1/stats" -
    printf "set ssl cert ${testdir}/ecdsa.pem <<\n$(cat ${testdir}/ecdsa.pem)\n\n" | socat "${tmpdir}/h1/stats" -
    echo "commit ssl cert ${testdir}/ecdsa.pem" | socat "${tmpdir}/h1/stats" -
-   echo "add ssl crt-list ${testdir}/localhost.crt-list ${testdir}/ecdsa.pem" | socat "${tmpdir}/h1/stats" -
+   printf "add ssl crt-list ${testdir}/localhost.crt-list <<\n${testdir}/ecdsa.pem [verify none allow-0rtt] localhost !www.test1.com\n\n" | socat "${tmpdir}/h1/stats" -
 }
 
 haproxy h1 -cli {
@@ -56,7 +56,8 @@ haproxy h1 -cli {
 
 haproxy h1 -cli {
     send "show ssl crt-list ${testdir}/localhost.crt-list"
-    expect ~ ".*${testdir}/ecdsa.pem"
+    # check the options and the filters in any order
+    expect ~ ".*${testdir}/ecdsa.pem \\[(?=.*verify none)(?=.*allow-0rtt).*\\](?=.*!www.test1.com)(?=.*localhost).*"
 }
 
 shell {