comparison lib/Test/Nginx.pm @ 1921:07656d303199

Tests: adjusted TODO for OpenSSL 1.0.2h and up in h2_http2.t. OpenSSL uses correct SNI/ALPN callback order (SNI callback before ALPN callback) starting with OpenSSL 1.0.2h, so "sni to enabled" test is expected to succeed starting with OpenSSL 1.0.2h. With this change, the "openssl:..." feature test now supports checking patch level encoded as letters, such as in "openssl:1.0.2h".
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 12 Jul 2023 02:40:24 +0300
parents 8b74936ff2ac
children 1d980c5013dc
comparison
equal deleted inserted replaced
1920:79ca9ab75310 1921:07656d303199
264 return IO::Socket::SSL->can('get_session_reused'); 264 return IO::Socket::SSL->can('get_session_reused');
265 } 265 }
266 return 0; 266 return 0;
267 } 267 }
268 268
269 if ($feature =~ /^(openssl|libressl):([0-9.]+)/) { 269 if ($feature =~ /^(openssl|libressl):([0-9.]+)([a-z]*)/) {
270 my $library = $1; 270 my $library = $1;
271 my $need = $2; 271 my $need = $2;
272 my $patch = $3;
272 273
273 $self->{_configure_args} = `$NGINX -V 2>&1` 274 $self->{_configure_args} = `$NGINX -V 2>&1`
274 if !defined $self->{_configure_args}; 275 if !defined $self->{_configure_args};
275 276
276 return 0 unless 277 return 0 unless
277 $self->{_configure_args} =~ /with $library ([0-9.]+)/i; 278 $self->{_configure_args}
278 279 =~ /with $library ([0-9.]+)([a-z]*)/i;
279 my @v = split(/\./, $1); 280
281 my @v = (split(/\./, $1), unpack("C*", $2));
280 my ($n, $v); 282 my ($n, $v);
281 283
282 for $n (split(/\./, $need)) { 284 for $n (split(/\./, $need), unpack("C*", $patch)) {
283 $v = shift @v || 0; 285 $v = shift @v || 0;
284 return 0 if $n > $v; 286 return 0 if $n > $v;
285 return 1 if $v > $n; 287 return 1 if $v > $n;
286 } 288 }
287 289