comparison stream_ssl_alpn.t @ 1860:58951cf933e1

Tests: added has_feature() test for SSL libraries. This makes it possible to further simplify various SSL tests. It also avoids direct testing of the $t->{_configure_args} internal field, and implements proper comparison of version numbers.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 18 May 2023 18:07:06 +0300
parents cdcd75657e52
children 46351d990aee
comparison
equal deleted inserted replaced
1859:5f46af4707e7 1860:58951cf933e1
79 is(get_ssl('wrong', 'first'), 'X first X', 'alpn many'); 79 is(get_ssl('wrong', 'first'), 'X first X', 'alpn many');
80 is(get_ssl('wrong', 'second'), 'X second X', 'alpn second'); 80 is(get_ssl('wrong', 'second'), 'X second X', 'alpn second');
81 is(get_ssl(), 'X X', 'no alpn'); 81 is(get_ssl(), 'X X', 'no alpn');
82 82
83 SKIP: { 83 SKIP: {
84 $t->{_configure_args} =~ /LibreSSL ([\d\.]+)/; 84 skip 'LibreSSL too old', 2
85 skip 'LibreSSL too old', 2 if defined $1 and $1 lt '3.4.0'; 85 if $t->has_module('LibreSSL')
86 $t->{_configure_args} =~ /OpenSSL ([\d\.]+)/; 86 and not $t->has_feature('libressl:3.4.0');
87 skip 'OpenSSL too old', 2 if defined $1 and $1 lt '1.1.0'; 87 skip 'OpenSSL too old', 2
88 if $t->has_module('OpenSSL')
89 and not $t->has_feature('openssl:1.1.0');
88 90
89 ok(!get_ssl('wrong'), 'alpn mismatch'); 91 ok(!get_ssl('wrong'), 'alpn mismatch');
90 92
91 $t->stop(); 93 $t->stop();
92 94