Blame SOURCES/IO-Socket-SSL-2.060-make-all-tests-which-use-fork-also-ignore-signal-PIP.patch

8952ae
From e96b1c9e394011de4ee181cfa42b8021796bf7d4 Mon Sep 17 00:00:00 2001
8952ae
From: Steffen Ullrich <Steffen_Ullrich@genua.de>
8952ae
Date: Mon, 17 Sep 2018 14:09:48 +0200
8952ae
Subject: [PATCH] make all tests which use fork also ignore signal PIPE
8952ae
MIME-Version: 1.0
8952ae
Content-Type: text/plain; charset=UTF-8
8952ae
Content-Transfer-Encoding: 8bit
8952ae
8952ae
Signed-off-by: Petr Písař <ppisar@redhat.com>
8952ae
---
8952ae
 t/nonblock.t         | 4 +---
8952ae
 t/protocol_version.t | 2 --
8952ae
 t/session_ticket.t   | 2 --
8952ae
 t/signal-readline.t  | 1 -
8952ae
 t/sni.t              | 2 --
8952ae
 t/sni_verify.t       | 2 --
8952ae
 t/testlib.pl         | 2 ++
8952ae
 7 files changed, 3 insertions(+), 12 deletions(-)
8952ae
8952ae
diff --git a/t/nonblock.t b/t/nonblock.t
8952ae
index 6c1bc38..ad62799 100644
8952ae
--- a/t/nonblock.t
8952ae
+++ b/t/nonblock.t
8952ae
@@ -9,7 +9,7 @@ use Net::SSLeay;
8952ae
 use Socket;
8952ae
 use IO::Socket::SSL;
8952ae
 use IO::Select;
8952ae
-use Errno qw( EWOULDBLOCK EAGAIN EINPROGRESS EPIPE ECONNRESET );
8952ae
+use Errno qw( EWOULDBLOCK EAGAIN EINPROGRESS);
8952ae
 do './testlib.pl' || do './t/testlib.pl' || die "no testlib";
8952ae
 
8952ae
 if ( ! eval "use 5.006; use IO::Select; return 1" ) {
8952ae
@@ -17,8 +17,6 @@ if ( ! eval "use 5.006; use IO::Select; return 1" ) {
8952ae
     exit;
8952ae
 }
8952ae
 
8952ae
-$SIG{PIPE} = 'IGNORE'; # use EPIPE not signal handler
8952ae
-
8952ae
 $|=1;
8952ae
 print "1..27\n";
8952ae
 
8952ae
diff --git a/t/protocol_version.t b/t/protocol_version.t
8952ae
index 2e5cc6f..3577720 100644
8952ae
--- a/t/protocol_version.t
8952ae
+++ b/t/protocol_version.t
8952ae
@@ -7,8 +7,6 @@ use Socket;
8952ae
 use IO::Socket::SSL;
8952ae
 do './testlib.pl' || do './t/testlib.pl' || die "no testlib";
8952ae
 
8952ae
-$SIG{PIPE} = 'IGNORE';
8952ae
-
8952ae
 plan skip_all => "Test::More has no done_testing"
8952ae
     if !defined &done_testing;
8952ae
 
8952ae
diff --git a/t/session_ticket.t b/t/session_ticket.t
8952ae
index ca70b80..4071b8a 100644
8952ae
--- a/t/session_ticket.t
8952ae
+++ b/t/session_ticket.t
8952ae
@@ -27,8 +27,6 @@ my ($server_cert,$server_key) = CERT_create(
8952ae
     purpose => { server => 1 }
8952ae
 );
8952ae
 
8952ae
-$SIG{PIPE} = 'IGNORE';
8952ae
-
8952ae
 # create two servers with the same session ticket callback
8952ae
 my (@server,@saddr);
8952ae
 for (1,2) {
8952ae
diff --git a/t/signal-readline.t b/t/signal-readline.t
8952ae
index 6dcd4ae..3e226c0 100644
8952ae
--- a/t/signal-readline.t
8952ae
+++ b/t/signal-readline.t
8952ae
@@ -50,7 +50,6 @@ if ( $pid == 0 ) {
8952ae
 
8952ae
 my $csock = $server->accept;
8952ae
 ok("accept");
8952ae
-$SIG{PIPE} = 'IGNORE';
8952ae
 
8952ae
 syswrite($csock,"foo") or print "not ";
8952ae
 ok("wrote foo");
8952ae
diff --git a/t/sni.t b/t/sni.t
8952ae
index c6e6510..de0f06e 100644
8952ae
--- a/t/sni.t
8952ae
+++ b/t/sni.t
8952ae
@@ -17,8 +17,6 @@ if ( ! IO::Socket::SSL->can_client_sni() ) {
8952ae
     exit;
8952ae
 }
8952ae
 
8952ae
-$SIG{PIPE} = 'IGNORE';
8952ae
-
8952ae
 print "1..17\n";
8952ae
 my $server = IO::Socket::SSL->new(
8952ae
     LocalAddr => '127.0.0.1',
8952ae
diff --git a/t/sni_verify.t b/t/sni_verify.t
8952ae
index 86b5dca..b3b299b 100644
8952ae
--- a/t/sni_verify.t
8952ae
+++ b/t/sni_verify.t
8952ae
@@ -17,8 +17,6 @@ if ( ! IO::Socket::SSL->can_client_sni() ) {
8952ae
     exit;
8952ae
 }
8952ae
 
8952ae
-$SIG{PIPE} = 'IGNORE';
8952ae
-
8952ae
 print "1..17\n";
8952ae
 my $server = IO::Socket::SSL->new(
8952ae
     LocalAddr => '127.0.0.1',
8952ae
diff --git a/t/testlib.pl b/t/testlib.pl
8952ae
index 5a99e49..b3f342c 100644
8952ae
--- a/t/testlib.pl
8952ae
+++ b/t/testlib.pl
8952ae
@@ -19,6 +19,8 @@ unless ( $Config::Config{d_fork} || $Config::Config{d_pseudofork} ||
8952ae
     exit
8952ae
 }
8952ae
 
8952ae
+# let IO errors result in EPIPE instead of crashing the test
8952ae
+$SIG{PIPE} = 'IGNORE';
8952ae
 
8952ae
 # small implementations if not used from Test::More (09_fdleak.t)
8952ae
 if ( ! defined &ok ) {
8952ae
-- 
8952ae
2.17.1
8952ae