From fdb9f83f9d935781c38d2700478a7499fcc586b9d825acdaa73fb6916bc2d411 Mon Sep 17 00:00:00 2001 From: Jan Matejek Date: Tue, 17 May 2016 13:40:41 +0000 Subject: [PATCH] Accepting request 396253 from home:matejcik:branches:devel:languages:python - added %check section with testsuite - skip-networked-test.patch - mark a test as networked so that we can specify non-network test run - rsa128-i586.patch - sidestep a crasher bug on 32bit platforms by generating reasonably-sized RSA keys instead of small 128bit ones OBS-URL: https://build.opensuse.org/request/show/396253 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyOpenSSL?expand=0&rev=34 --- python-pyOpenSSL.changes | 9 +++++++++ python-pyOpenSSL.spec | 15 +++++++++++++-- rsa128-i586.patch | 31 +++++++++++++++++++++++++++++++ skip-networked-test.patch | 12 ++++++++++++ 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 rsa128-i586.patch create mode 100644 skip-networked-test.patch diff --git a/python-pyOpenSSL.changes b/python-pyOpenSSL.changes index efd96fe..8ae95ca 100644 --- a/python-pyOpenSSL.changes +++ b/python-pyOpenSSL.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon May 16 15:29:16 UTC 2016 - jmatejek@suse.com + +- added %check section with testsuite +- skip-networked-test.patch - mark a test as networked so that we can + specify non-network test run +- rsa128-i586.patch - sidestep a crasher bug on 32bit platforms + by generating reasonably-sized RSA keys instead of small 128bit ones + ------------------------------------------------------------------- Mon May 9 09:54:12 UTC 2016 - hpj@urpla.net diff --git a/python-pyOpenSSL.spec b/python-pyOpenSSL.spec index 47f8757..b0f7184 100644 --- a/python-pyOpenSSL.spec +++ b/python-pyOpenSSL.spec @@ -25,12 +25,16 @@ License: Apache-2.0 Group: Development/Languages/Python Source: http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-%{version}.tar.gz Patch0: bug-lp-1265482.diff +Patch1: skip-networked-test.patch +Patch2: rsa128-i586.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: openssl-devel BuildRequires: python-Sphinx -BuildRequires: python-cryptography >= 0.2 +BuildRequires: python-cryptography >= 1.3.1 BuildRequires: python-devel +BuildRequires: python-pytest BuildRequires: python-setuptools -Requires: python-cryptography >= 0.2 +Requires: python-cryptography >= 1.3.1 Provides: pyOpenSSL = %{version} Provides: python-openssl = %{version} Obsoletes: python-openssl < %{version} @@ -59,6 +63,8 @@ Provides documentation for %{name}. %prep %setup -q -n pyOpenSSL-%{version} %patch0 -p1 +%patch1 -p1 +%patch2 -p1 %build python setup.py build @@ -68,6 +74,11 @@ PYTHONPATH="build/lib" python setup.py build_sphinx && rm build/sphinx/html/.bui %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%check +export LC_ALL=en_US.UTF-8 +export PYTHONPATH=src +py.test -m "not network" + %files %defattr(0644,root,root,0755) %doc LICENSE *.rst diff --git a/rsa128-i586.patch b/rsa128-i586.patch new file mode 100644 index 0000000..1cb3a11 --- /dev/null +++ b/rsa128-i586.patch @@ -0,0 +1,31 @@ +Index: pyOpenSSL-16.0.0/tests/test_ssl.py +=================================================================== +--- pyOpenSSL-16.0.0.orig/tests/test_ssl.py ++++ pyOpenSSL-16.0.0/tests/test_ssl.py +@@ -549,7 +549,7 @@ class ContextTests(TestCase, _LoopbackMi + instance. + """ + key = PKey() +- key.generate_key(TYPE_RSA, 128) ++ key.generate_key(TYPE_RSA, 2048) + ctx = Context(TLSv1_METHOD) + ctx.use_privatekey(key) + self.assertRaises(TypeError, ctx.use_privatekey, "") +@@ -569,7 +569,7 @@ class ContextTests(TestCase, _LoopbackMi + arguments does not raise an exception. + """ + key = PKey() +- key.generate_key(TYPE_RSA, 128) ++ key.generate_key(TYPE_RSA, 2048) + + with open(pemfile, "wt") as pem: + pem.write( +@@ -920,7 +920,7 @@ class ContextTests(TestCase, _LoopbackMi + passphrase. Return the path to the new file. + """ + key = PKey() +- key.generate_key(TYPE_RSA, 128) ++ key.generate_key(TYPE_RSA, 2048) + pemFile = self.mktemp() + fObj = open(pemFile, 'w') + pem = dump_privatekey(FILETYPE_PEM, key, "blowfish", passphrase) diff --git a/skip-networked-test.patch b/skip-networked-test.patch new file mode 100644 index 0000000..3671997 --- /dev/null +++ b/skip-networked-test.patch @@ -0,0 +1,12 @@ +Index: pyOpenSSL-16.0.0/tests/test_ssl.py +=================================================================== +--- pyOpenSSL-16.0.0.orig/tests/test_ssl.py ++++ pyOpenSSL-16.0.0/tests/test_ssl.py +@@ -1198,6 +1198,7 @@ class ContextTests(TestCase, _LoopbackMi + reason="set_default_verify_paths appears not to work on Windows. " + "See LP#404343 and LP#404344." + ) ++ @pytest.mark.network + def test_set_default_verify_paths(self): + """ + :py:obj:`Context.set_default_verify_paths` causes the