diff 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
line wrap: on
line diff
--- a/lib/Test/Nginx.pm
+++ b/lib/Test/Nginx.pm
@@ -266,20 +266,22 @@ sub has_feature($) {
 		return 0;
 	}
 
-	if ($feature =~ /^(openssl|libressl):([0-9.]+)/) {
+	if ($feature =~ /^(openssl|libressl):([0-9.]+)([a-z]*)/) {
 		my $library = $1;
 		my $need = $2;
+		my $patch = $3;
 
 		$self->{_configure_args} = `$NGINX -V 2>&1`
 			if !defined $self->{_configure_args};
 
 		return 0 unless
-			$self->{_configure_args} =~ /with $library ([0-9.]+)/i;
+			$self->{_configure_args}
+			=~ /with $library ([0-9.]+)([a-z]*)/i;
 
-		my @v = split(/\./, $1);
+		my @v = (split(/\./, $1), unpack("C*", $2));
 		my ($n, $v);
 
-		for $n (split(/\./, $need)) {
+		for $n (split(/\./, $need), unpack("C*", $patch)) {
 			$v = shift @v || 0;
 			return 0 if $n > $v;
 			return 1 if $v > $n;