[packages/python/fix_tests] workaround for tests failing with [Errno 92] Protocol not available

draenog draenog at pld-linux.org
Tue Aug 27 03:43:21 CEST 2013


commit 69f899d337f30b2ef81e6d72a20eeae95a6ee423
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Tue Aug 27 02:03:54 2013 +0100

    workaround for tests failing with [Errno 92] Protocol not available
    
    The errors are due to new kernel-headers exposing SO_REUSEPOR, which
    is not present yes in kernel run on builder. The patch is taken from:
    https://bugzilla.redhat.com/show_bug.cgi?id=913732

 python-ENOPROTOOPT-test.patch | 22 ++++++++++++++++++++++
 python.spec                   |  8 +++++---
 2 files changed, 27 insertions(+), 3 deletions(-)
---
diff --git a/python.spec b/python.spec
index b285595..7c259a5 100644
--- a/python.spec
+++ b/python.spec
@@ -43,7 +43,7 @@ Summary(tr.UTF-8):	X arayüzlü, yüksek düzeyli, kabuk yorumlayıcı dili
 Summary(uk.UTF-8):	Мова програмування дуже високого рівня з X-інтерфейсом
 Name:		python
 Version:	%{py_ver}.5
-Release:	2
+Release:	3
 Epoch:		1
 License:	PSF
 Group:		Development/Languages/Python
@@ -59,7 +59,8 @@ Patch4:		%{name}-noarch_to_datadir.patch
 Patch5:		%{name}-verbose.patch
 Patch6:		%{name}-distro.patch
 Patch7:		%{name}-DNStests.patch
-Patch8:		%{name}-CVE-2013-4238.patch
+Patch8:		%{name}-ENOPROTOOPT-test.patch
+Patch9:		%{name}-CVE-2013-4238.patch
 URL:		http://www.python.org/
 BuildRequires:	autoconf >= 2.65
 BuildRequires:	automake
@@ -561,6 +562,7 @@ Przykłady te są dla Pythona 2.3.4, nie %{version}.
 %patch6 -p1
 %patch7 -p1
 %patch8 -p1
+%patch9 -p1
 
 tar xjf %{SOURCE1}
 
@@ -605,7 +607,7 @@ END { if (fail) { print "\nPROBLEMS FOUND:"; print logmsg; exit(1); } }'
 LC_ALL=C
 export LC_ALL
 %if %{with tests}
-%{__make} -j1 test \
+WITHIN_PYTHON_RPM_BUILD=1 %{__make} -j1 test \
 	TESTOPTS="%{test_flags} %{test_list}" \
 	TESTPYTHON="LD_LIBRARY_PATH=`pwd` PYTHONHOME=`pwd` PYTHONPATH=`pwd`/Lib:`pwd`/Lib/lib-tk:`pwd`/build/lib.linux-`uname -m`-%{py_ver} ./python -tt"
 %endif
diff --git a/python-ENOPROTOOPT-test.patch b/python-ENOPROTOOPT-test.patch
new file mode 100644
index 0000000..3f38837
--- /dev/null
+++ b/python-ENOPROTOOPT-test.patch
@@ -0,0 +1,22 @@
+From d542bae2c2089f4a13f6aca59f0ea962997db1cf Mon Sep 17 00:00:00 2001
+From: David Malcolm <dmalcolm at redhat.com>
+Date: Mon, 04 Mar 2013 21:18:16 +0000
+Subject: 2.7.3-32: add workaround for ENOPROTOOPT seen running selftests in Koji (rhbz#913732)
+
+* Mon Mar  4 2013 David Malcolm <dmalcolm at redhat.com> - 2.7.3-32
+- add workaround for ENOPROTOOPT seen running selftests in Koji
+(rhbz#913732)
+---
+diff -up Python-2.7.3/Lib/test/test_support.py.rhbz913732 Python-2.7.3/Lib/test/test_support.py
+--- Python-2.7.3/Lib/test/test_support.py.rhbz913732	2013-03-04 16:11:53.757315921 -0500
++++ Python-2.7.3/Lib/test/test_support.py	2013-03-04 16:12:11.331314722 -0500
+@@ -371,7 +371,8 @@ def bind_port(sock, host=HOST):
+             if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1:
+                 raise TestFailed("tests should never set the SO_REUSEADDR "   \
+                                  "socket option on TCP/IP sockets!")
+-        if hasattr(socket, 'SO_REUSEPORT'):
++        if hasattr(socket, 'SO_REUSEPORT') \
++                and 'WITHIN_PYTHON_RPM_BUILD' not in os.environ: # rhbz#913732
+             if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:
+                 raise TestFailed("tests should never set the SO_REUSEPORT "   \
+                                  "socket option on TCP/IP sockets!")
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python.git/commitdiff/69f899d337f30b2ef81e6d72a20eeae95a6ee423



More information about the pld-cvs-commit mailing list