]> git.pld-linux.org Git - packages/python.git/commitdiff
workaround for tests failing with [Errno 92] Protocol not available auto/th/python-2.7.5-3
authorKacper Kornet <draenog@pld-linux.org>
Tue, 27 Aug 2013 01:03:54 +0000 (02:03 +0100)
committerKacper Kornet <draenog@pld-linux.org>
Tue, 27 Aug 2013 01:42:57 +0000 (02:42 +0100)
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 [new file with mode: 0644]
python.spec

diff --git a/python-ENOPROTOOPT-test.patch b/python-ENOPROTOOPT-test.patch
new file mode 100644 (file)
index 0000000..3f38837
--- /dev/null
@@ -0,0 +1,22 @@
+From d542bae2c2089f4a13f6aca59f0ea962997db1cf Mon Sep 17 00:00:00 2001
+From: David Malcolm <dmalcolm@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@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!")
index b285595dfebb16df25b0aa082f801cbf4f9ee65b..7c259a56cd06ea4d284f37f7e62f325cb32c1f3a 100644 (file)
@@ -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
This page took 0.028759 seconds and 4 git commands to generate.