diff --git a/fix_test_suite.patch b/fix_test_suite.patch new file mode 100644 index 0000000..589b03d --- /dev/null +++ b/fix_test_suite.patch @@ -0,0 +1,29 @@ +--- a/tests/test_crypto.py ++++ b/tests/test_crypto.py +@@ -13,7 +13,7 @@ from datetime import datetime, timedelta + + import pytest + +-from six import binary_type ++from six import binary_type, PY3 + + from cryptography import x509 + from cryptography.hazmat.backends.openssl.backend import backend +@@ -3167,9 +3167,14 @@ class TestCRL(object): + # and with what certificate it was exported. + text.index(b'Serial Number: 03AB') + text.index(b'Superseded') +- text.index( +- b'Issuer: /C=US/ST=IL/L=Chicago/O=Testing/CN=Testing Root CA' +- ) ++ if PY3: ++ text.decode().translate(str.maketrans('','',',/ ')).index( ++ 'Issuer:C=USST=ILL=ChicagoO=TestingCN=TestingRootCA' ++ ) ++ else: ++ text.translate(None, ',/ ').index( ++ 'Issuer:C=USST=ILL=ChicagoO=TestingCN=TestingRootCA' ++ ) + + def test_export_der(self): + """ diff --git a/python-pyOpenSSL.changes b/python-pyOpenSSL.changes index 9b22064..e8f02cf 100644 --- a/python-pyOpenSSL.changes +++ b/python-pyOpenSSL.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Oct 30 01:06:28 CET 2018 - mcepl@suse.com + +- Add patch fix_test_suite.patch to allow test suite to pass with + OpenSSL 1.1.1. + ------------------------------------------------------------------- Fri Aug 24 09:08:36 UTC 2018 - tchvatal@suse.com diff --git a/python-pyOpenSSL.spec b/python-pyOpenSSL.spec index fdaaa33..bdb66a1 100644 --- a/python-pyOpenSSL.spec +++ b/python-pyOpenSSL.spec @@ -28,6 +28,7 @@ URL: https://github.com/pyca/pyopenssl Source: https://files.pythonhosted.org/packages/source/p/pyOpenSSL/pyOpenSSL-%{version}.tar.gz Patch1: skip-networked-test.patch Patch2: openssl-1.1.0i.patch +Patch3: fix_test_suite.patch BuildRequires: %{python_module cryptography >= 2.3.0} BuildRequires: %{python_module flaky} BuildRequires: %{python_module pretend}