[m2crypto] Fix terminating test suite helper processes when running in Koji

Miloslav Trmac mitr at fedoraproject.org
Wed Dec 18 02:15:16 UTC 2013


commit cf0df8545eae026c894aa66edcd25f81171640c0
Author: Miloslav Trmač <mitr at redhat.com>
Date:   Wed Dec 18 02:51:06 2013 +0100

    Fix terminating test suite helper processes when running in Koji

 m2crypto-0.21.1-tests-no-SIGHUP.patch |   44 +++++++++++++++++++++++++++++++++
 m2crypto.spec                         |    5 +++
 2 files changed, 49 insertions(+), 0 deletions(-)
---
diff --git a/m2crypto-0.21.1-tests-no-SIGHUP.patch b/m2crypto-0.21.1-tests-no-SIGHUP.patch
new file mode 100644
index 0000000..89c76ca
--- /dev/null
+++ b/m2crypto-0.21.1-tests-no-SIGHUP.patch
@@ -0,0 +1,44 @@
+Koji, the Fedora build system, is apparently setting up the build
+processes to ignore SIGHUP by default, leading the helper processes
+used by test_ssl to never terminate.  We could override the SIGHUP
+handling, but sending SIGTERM is more correct anyway.
+
+diff -ur M2Crypto/tests/test_ssl.py M2Crypto-0.21.1/tests/test_ssl.py
+--- M2Crypto/tests/test_ssl.py	2013-12-18 02:08:42.411669114 +0100
++++ M2Crypto-0.21.1/tests/test_ssl.py	2013-12-18 02:10:57.877589271 +0100
+@@ -20,7 +20,7 @@
+ - ThreadingSSLServer
+ """
+ 
+-import os, socket, string, sys, tempfile, thread, time, unittest
++import os, signal, socket, string, sys, tempfile, thread, time, unittest
+ from M2Crypto import Rand, SSL, m2, Err
+ 
+ from fips import fips_mode
+@@ -95,7 +95,7 @@
+             return pid
+ 
+     def stop_server(self, pid):
+-        os.kill(pid, 1)
++        os.kill(pid, signal.SIGTERM)
+         os.waitpid(pid, 0)
+ 
+     def http_get(self, s):
+@@ -1039,7 +1039,7 @@
+             finally:
+                 self.stop_server(pid)
+         finally:
+-            os.kill(pipe_pid, 1)
++            os.kill(pipe_pid, signal.SIGTERM)
+             os.waitpid(pipe_pid, 0)
+             os.unlink('tests/' + FIFO_NAME)
+ 
+@@ -1154,7 +1154,7 @@
+         chunk = string.split(ps)
+         pid, cmd = chunk[0], chunk[4]
+         if cmd == s:
+-            os.kill(int(pid), 1)
++            os.kill(int(pid), signal.SIGTERM)
+     f.close()
+     os.unlink(fn)
+ 
diff --git a/m2crypto.spec b/m2crypto.spec
index cabae79..8e8ef8f 100644
--- a/m2crypto.spec
+++ b/m2crypto.spec
@@ -36,6 +36,8 @@ Patch11: m2crypto-0.21.1-SSL_CTX_new.patch
 Patch12: m2crypto-0.21.1-sni.patch
 # https://bugzilla.osafoundation.org/show_bug.cgi?id=13100
 Patch13: m2crypto-0.21.1-supported-ec.patch
+# https://bugzilla.osafoundation.org/show_bug.cgi?id=13101
+Patch14: m2crypto-0.21.1-tests-no-SIGHUP.patch
 License: MIT
 Group: System Environment/Libraries
 URL: http://wiki.osafoundation.org/bin/view/Projects/MeTooCrypto
@@ -65,6 +67,7 @@ openssl x509 -in tests/x509.pem -out tests/x509.der -outform DER
 %patch11 -p1 -b .SSL_CTX_new
 %patch12 -p1 -b .sni
 %patch13 -p1 -b .supported-ec
+%patch14 -p1 -b .tests-no-SIGHUP
 
 # Red Hat opensslconf.h #includes an architecture-specific file, but SWIG
 # doesn't follow the #include.
@@ -129,6 +132,8 @@ rm tests/*.{pem,py}.* # Patch backup files
 * Wed Dec 18 2013 Miloslav Trmač <mitr at redhat.com> - 0.21.1-13
 - Use only ECC curves available in Fedora in the test suite
   Related: #904996
+- Fix terminating test suite helper processes when running in Koji
+  Related: #904996
 
 * Tue Dec 17 2013 Miloslav Trmač <mitr at redhat.com> - 0.21.1-13
 - Add minimal SNI support, based on a patch by Sander Steffann


More information about the scm-commits mailing list