changeset 1900:236d038dc04a

Tests: suppress "listen .. http2;" deprecation warnings.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 31 May 2023 13:29:34 +0400
parents a0ee073760c5
children f9bb84e4c8e2
files grpc.t grpc_next_upstream.t grpc_pass.t grpc_request_buffering.t grpc_ssl.t h2.t h2_absolute_redirect.t h2_auth_request.t h2_error_page.t h2_fastcgi_request_buffering.t h2_headers.t h2_keepalive.t h2_limit_conn.t h2_limit_req.t h2_priority.t h2_proxy_cache.t h2_proxy_max_temp_file_size.t h2_proxy_protocol.t h2_proxy_request_buffering.t h2_proxy_request_buffering_redirect.t h2_proxy_request_buffering_ssl.t h2_proxy_ssl.t h2_request_body.t h2_request_body_extra.t h2_request_body_preread.t h2_server_push.t h2_server_tokens.t h2_trailers.t h2_variables.t h3_server_name.t proxy_ssl_conf_command.t worker_shutdown_timeout_h2.t
diffstat 32 files changed, 161 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/grpc.t
+++ b/grpc.t
@@ -90,7 +90,11 @@ http {
 
 EOF
 
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/grpc_next_upstream.t
+++ b/grpc_next_upstream.t
@@ -106,7 +106,11 @@ http {
 
 EOF
 
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/grpc_pass.t
+++ b/grpc_pass.t
@@ -97,7 +97,12 @@ foreach my $name ('localhost') {
 }
 
 $t->run_daemon(\&dns_daemon, port(8982), $t);
+
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run()->plan(5);
+open STDERR, ">&", \*OLDERR;
 
 $t->waitforfile($t->testdir . '/' . port(8982));
 
--- a/grpc_request_buffering.t
+++ b/grpc_request_buffering.t
@@ -64,7 +64,11 @@ http {
 
 EOF
 
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/grpc_ssl.t
+++ b/grpc_ssl.t
@@ -128,7 +128,11 @@ sleep 1 if $^O eq 'MSWin32';
 
 $t->write_file('password', 'client');
 
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2.t
+++ b/h2.t
@@ -132,7 +132,11 @@ http {
 
 EOF
 
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 # file size is slightly beyond initial window size: 2**16 + 80 bytes
 
--- a/h2_absolute_redirect.t
+++ b/h2_absolute_redirect.t
@@ -107,7 +107,11 @@ EOF
 mkdir($t->testdir() . '/dir');
 mkdir($t->testdir() . '/dir sp');
 
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run()->plan(23);
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_auth_request.t
+++ b/h2_auth_request.t
@@ -66,7 +66,11 @@ http {
 
 EOF
 
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_error_page.t
+++ b/h2_error_page.t
@@ -54,7 +54,11 @@ http {
 
 EOF
 
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_fastcgi_request_buffering.t
+++ b/h2_fastcgi_request_buffering.t
@@ -23,7 +23,7 @@ use Test::Nginx::HTTP2;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->has(qw/http http_v2 fastcgi/);
+my $t = Test::Nginx->new()->has(qw/http http_v2 fastcgi/)->plan(48);
 
 $t->write_file_expand('nginx.conf', <<'EOF');
 
@@ -52,8 +52,11 @@ http {
 
 EOF
 
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
-$t->plan(48);
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_headers.t
+++ b/h2_headers.t
@@ -122,7 +122,14 @@ http {
 EOF
 
 $t->run_daemon(\&http_daemon);
-$t->run()->waitforsocket('127.0.0.1:' . port(8083));
+
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
+$t->run();
+open STDERR, ">&", \*OLDERR;
+
+$t->waitforsocket('127.0.0.1:' . port(8083));
 
 # file size is slightly beyond initial window size: 2**16 + 80 bytes
 
--- a/h2_keepalive.t
+++ b/h2_keepalive.t
@@ -25,7 +25,7 @@ use Test::Nginx::HTTP2;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->has(qw/http http_v2/)
+my $t = Test::Nginx->new()->has(qw/http http_v2/)->plan(19)
 	->write_file_expand('nginx.conf', <<'EOF');
 
 %%TEST_GLOBALS%%
@@ -73,7 +73,11 @@ EOF
 $t->write_file('index.html', 'SEE-THAT' x 50000);
 $t->write_file('t.html', 'SEE-THAT');
 
-$t->run()->plan(19);
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
+$t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_limit_conn.t
+++ b/h2_limit_conn.t
@@ -51,7 +51,12 @@ http {
 EOF
 
 $t->write_file('t.html', 'SEE-THIS');
+
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_limit_req.t
+++ b/h2_limit_req.t
@@ -64,7 +64,12 @@ EOF
 
 $t->write_file('index.html', '');
 $t->write_file('t.html', 'SEE-THIS');
+
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_priority.t
+++ b/h2_priority.t
@@ -44,7 +44,11 @@ http {
 
 EOF
 
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 # file size is slightly beyond initial window size: 2**16 + 80 bytes
 
--- a/h2_proxy_cache.t
+++ b/h2_proxy_cache.t
@@ -68,7 +68,12 @@ EOF
 
 $t->write_file('t.html', 'SEE-THIS');
 $t->write_file('slow.html', 'SEE-THIS');
+
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_proxy_max_temp_file_size.t
+++ b/h2_proxy_max_temp_file_size.t
@@ -66,7 +66,12 @@ http {
 EOF
 
 $t->write_file('1', 'X' x (1024 * 1024));
+
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_proxy_protocol.t
+++ b/h2_proxy_protocol.t
@@ -54,7 +54,12 @@ http {
 EOF
 
 $t->write_file('t.html', 'SEE-THIS');
+
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_proxy_request_buffering.t
+++ b/h2_proxy_request_buffering.t
@@ -25,7 +25,7 @@ use Test::Nginx::HTTP2;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->has(qw/http http_v2 proxy/);
+my $t = Test::Nginx->new()->has(qw/http http_v2 proxy/)->plan(49);
 
 $t->write_file_expand('nginx.conf', <<'EOF');
 
@@ -65,8 +65,11 @@ http {
 
 EOF
 
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
-$t->plan(49);
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_proxy_request_buffering_redirect.t
+++ b/h2_proxy_request_buffering_redirect.t
@@ -25,7 +25,7 @@ select STDOUT; $| = 1;
 
 my $t = Test::Nginx->new()->has(qw/http http_v2 proxy rewrite/)->plan(1);
 
-$t->write_file_expand('nginx.conf', <<'EOF')->run();
+$t->write_file_expand('nginx.conf', <<'EOF');
 
 %%TEST_GLOBALS%%
 
@@ -68,6 +68,12 @@ http {
 
 EOF
 
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
+$t->run();
+open STDERR, ">&", \*OLDERR;
+
 ###############################################################################
 
 # unbuffered request body
--- a/h2_proxy_request_buffering_ssl.t
+++ b/h2_proxy_request_buffering_ssl.t
@@ -26,7 +26,7 @@ select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
 my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy/)
-	->has_daemon('openssl');
+	->has_daemon('openssl')->plan(40);
 
 $t->write_file_expand('nginx.conf', <<'EOF');
 
@@ -98,8 +98,11 @@ foreach my $name ('localhost') {
 		or die "Can't create certificate for $name: $!\n";
 }
 
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
-$t->plan(40);
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_proxy_ssl.t
+++ b/h2_proxy_ssl.t
@@ -74,7 +74,12 @@ foreach my $name ('localhost') {
 }
 
 $t->write_file('index.html', '');
+
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_request_body.t
+++ b/h2_request_body.t
@@ -77,7 +77,12 @@ EOF
 $t->write_file('index.html', '');
 $t->write_file('t.html', 'SEE-THIS');
 $t->write_file('slow.html', 'SEE-THIS');
+
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_request_body_extra.t
+++ b/h2_request_body_extra.t
@@ -90,7 +90,11 @@ EOF
 plan(skip_all => 'not yet') unless $t->has_version('1.21.2');
 $t->plan(50);
 
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_request_body_preread.t
+++ b/h2_request_body_preread.t
@@ -23,7 +23,7 @@ use Test::Nginx::HTTP2;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->has(qw/http http_v2 proxy limit_req/);
+my $t = Test::Nginx->new()->has(qw/http http_v2 proxy limit_req/)->plan(9);
 
 $t->write_file_expand('nginx.conf', <<'EOF');
 
@@ -89,7 +89,12 @@ http {
 EOF
 
 $t->write_file('t', '');
-$t->run()->plan(9);
+
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
+$t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_server_push.t
+++ b/h2_server_push.t
@@ -139,7 +139,11 @@ EOF
 $t->write_file('t2', 'SEE-THIS');
 $t->write_file('explf', join('', map { sprintf "X%06dXXX", $_ } (1 .. 6553)));
 
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_server_tokens.t
+++ b/h2_server_tokens.t
@@ -23,7 +23,7 @@ use Test::Nginx::HTTP2;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->has(qw/http http_v2 rewrite/)
+my $t = Test::Nginx->new()->has(qw/http http_v2 rewrite/)->plan(12)
 	->write_file_expand('nginx.conf', <<'EOF');
 
 %%TEST_GLOBALS%%
@@ -88,7 +88,11 @@ http {
 
 EOF
 
-$t->run()->plan(12);
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
+$t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_trailers.t
+++ b/h2_trailers.t
@@ -60,7 +60,12 @@ EOF
 $t->write_file('index.html', 'SEE-THIS');
 $t->write_file('empty', '');
 $t->write_file('continuation', 'SEE-THIS');
+
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h2_variables.t
+++ b/h2_variables.t
@@ -60,7 +60,11 @@ http {
 
 EOF
 
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/h3_server_name.t
+++ b/h3_server_name.t
@@ -74,7 +74,11 @@ foreach my $name ('localhost') {
 		or die "Can't create certificate for $name: $!\n";
 }
 
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
 $t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/proxy_ssl_conf_command.t
+++ b/proxy_ssl_conf_command.t
@@ -28,7 +28,7 @@ my $t = Test::Nginx->new()
 
 plan(skip_all => 'no ssl_conf_command') if $t->has_module('BoringSSL');
 
-$t->write_file_expand('nginx.conf', <<'EOF');
+$t->write_file_expand('nginx.conf', <<'EOF')->plan(3);
 
 %%TEST_GLOBALS%%
 
@@ -106,7 +106,12 @@ foreach my $name ('localhost', 'override
 }
 
 $t->write_file('index.html', '');
-$t->run()->plan(3);
+
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
+$t->run();
+open STDERR, ">&", \*OLDERR;
 
 ###############################################################################
 
--- a/worker_shutdown_timeout_h2.t
+++ b/worker_shutdown_timeout_h2.t
@@ -51,7 +51,14 @@ http {
 EOF
 
 $t->run_daemon(\&http_silent_daemon);
-$t->run()->waitforsocket('127.0.0.1:' . port(8081));
+
+# suppress deprecation warning
+
+open OLDERR, ">&", \*STDERR; close STDERR;
+$t->run();
+open STDERR, ">&", \*OLDERR;
+
+$t->waitforsocket('127.0.0.1:' . port(8081));
 
 ###############################################################################