changeset 1856:ce4a06d72256

Tests: SIGPIPE handling in mail tests. In contrast to http tests, mail tests generally do not try to handle SIGPIPE when writing to a socket, and instead rely on $SIG{PIPE} being set at the start of the test (see 96:ecff5407867c). Fixed some tests which don't do this.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 18 May 2023 18:06:59 +0300
parents b3bbde3f806d
children da3889ba0b96
files mail_capability.t mail_error_log.t mail_ssl.t mail_ssl_conf_command.t mail_ssl_session_reuse.t
diffstat 5 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mail_capability.t
+++ b/mail_capability.t
@@ -25,6 +25,8 @@ use Test::Nginx::SMTP;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
+local $SIG{PIPE} = 'IGNORE';
+
 my $t = Test::Nginx->new()->has(qw/mail mail_ssl imap pop3 smtp/)
 	->has_daemon('openssl')->plan(17);
 
--- a/mail_error_log.t
+++ b/mail_error_log.t
@@ -26,6 +26,8 @@ use Test::Nginx::IMAP;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
+local $SIG{PIPE} = 'IGNORE';
+
 plan(skip_all => 'win32') if $^O eq 'MSWin32';
 
 my $t = Test::Nginx->new()->has(qw/mail imap http rewrite/);
--- a/mail_ssl.t
+++ b/mail_ssl.t
@@ -25,6 +25,8 @@ use Test::Nginx::SMTP;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
+local $SIG{PIPE} = 'IGNORE';
+
 eval {
 	require Net::SSLeay;
 	Net::SSLeay::load_error_strings();
--- a/mail_ssl_conf_command.t
+++ b/mail_ssl_conf_command.t
@@ -22,6 +22,8 @@ use Test::Nginx;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
+local $SIG{PIPE} = 'IGNORE';
+
 eval {
 	require Net::SSLeay;
 	Net::SSLeay::load_error_strings();
--- a/mail_ssl_session_reuse.t
+++ b/mail_ssl_session_reuse.t
@@ -23,6 +23,8 @@ use Test::Nginx;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
+local $SIG{PIPE} = 'IGNORE';
+
 eval {
 	require Net::SSLeay;
 	Net::SSLeay::load_error_strings();