comparison mail_ssl.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 ce4a06d72256
children 7b7b64569f55
comparison
equal deleted inserted replaced
1859:5f46af4707e7 1860:58951cf933e1
173 # alpn 173 # alpn
174 174
175 ok(get_ssl_socket(8148, ['imap']), 'alpn'); 175 ok(get_ssl_socket(8148, ['imap']), 'alpn');
176 176
177 SKIP: { 177 SKIP: {
178 $t->{_configure_args} =~ /LibreSSL ([\d\.]+)/; 178 skip 'LibreSSL too old', 1
179 skip 'LibreSSL too old', 1 if defined $1 and $1 lt '3.4.0'; 179 if $t->has_module('LibreSSL')
180 $t->{_configure_args} =~ /OpenSSL ([\d\.]+)/; 180 and not $t->has_feature('libressl:3.4.0');
181 skip 'OpenSSL too old', 1 if defined $1 and $1 lt '1.1.0'; 181 skip 'OpenSSL too old', 1
182 if $t->has_module('OpenSSL')
183 and not $t->has_feature('openssl:1.1.0');
182 184
183 TODO: { 185 TODO: {
184 local $TODO = 'not yet' unless $t->has_version('1.21.4'); 186 local $TODO = 'not yet' unless $t->has_version('1.21.4');
185 187
186 ok(!get_ssl_socket(8148, ['unknown']), 'alpn rejected'); 188 ok(!get_ssl_socket(8148, ['unknown']), 'alpn rejected');