[PATCH 02 of 11] Tests: removed unneeded require from proxy_ssl_keepalive.t

Maxim Dounin mdounin at mdounin.ru
Wed May 3 01:26:18 UTC 2023


Hello!

On Tue, May 02, 2023 at 05:49:23PM +0400, Sergey Kandaurov wrote:

> 
> > On 17 Apr 2023, at 07:31, Maxim Dounin <mdounin at mdounin.ru> wrote:
> > 
> > # HG changeset patch
> > # User Maxim Dounin <mdounin at mdounin.ru>
> > # Date 1681702250 -10800
> > #      Mon Apr 17 06:30:50 2023 +0300
> > # Node ID 6f0148ef1991d92a003c8529c8cce9a8dd49e706
> > # Parent  a01b7d84f4355073a00f43760fc512e03b4452c3
> > Tests: removed unneeded require from proxy_ssl_keepalive.t.
> > 
> > diff --git a/proxy_ssl_keepalive.t b/proxy_ssl_keepalive.t
> > --- a/proxy_ssl_keepalive.t
> > +++ b/proxy_ssl_keepalive.t
> > @@ -22,9 +22,6 @@ use Test::Nginx;
> > select STDERR; $| = 1;
> > select STDOUT; $| = 1;
> > 
> > -eval { require IO::Socket::SSL; };
> > -plan(skip_all => 'IO::Socket::SSL not installed') if $@;
> > -
> > my $t = Test::Nginx->new()->has(qw/http http_ssl proxy upstream_keepalive/)
> > 	->has_daemon('openssl')->plan(3)
> > 	->write_file_expand('nginx.conf', <<'EOF');
> 
> We can as well remove it from h2_ssl_proxy_cache.t and h2_ssl_variables.t
> after 45c80276d691, HTTP2 package handles that for us.
> (Same approach used for the crypto layer of HTTP/3 tests.)

Both h2_ssl_proxy_cache.t and h2_ssl_variables.t actually use 
IO::Socket::SSL, even if the actual use is within 
Test::Nginx::HTTP2, and will behave incorrectly if IO::Socket::SSL 
is not available (as currently written, they won't fail, but will 
skip individual tests with incorrect reasoning).  As such, they do 
need these requires (and the corresponding plan(skip_all) call if 
IO::Socket::SSL is not available).

In contrast, proxy_ssl_keepalive.t does not use IO::Socket::SSL at 
all.  All client connections initiated by the test are plain text, 
and SSL is only used within nginx itself.  As such, 
IO::Socket::SSL is not required to run the test (and hence the 
patch).

-- 
Maxim Dounin
http://mdounin.ru/


More information about the nginx-devel mailing list