From 0f774a684066636c6f81aa36149f831f69bd77416e357e14d3b7eed0796e3b87 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 29 Oct 2020 15:28:58 +0000 Subject: [PATCH 1/3] Accepting request 844561 from home:PSuarezHernandez:branches:devel:languages:python - Do not build Python2 subpackage since 3.2.0 does not support Python2 - Adjust skipped SSH unit tests when paramiko <= 2.7.0 - Add: * skip-some-tests-for-older-paramiko-versions.patch OBS-URL: https://build.opensuse.org/request/show/844561 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-apache-libcloud?expand=0&rev=105 --- python-apache-libcloud.changes | 9 ++++++ python-apache-libcloud.spec | 9 ++++-- ...me-tests-for-older-paramiko-versions.patch | 31 +++++++++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 skip-some-tests-for-older-paramiko-versions.patch diff --git a/python-apache-libcloud.changes b/python-apache-libcloud.changes index 1e7a99c..62bda1d 100644 --- a/python-apache-libcloud.changes +++ b/python-apache-libcloud.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Oct 28 13:45:19 UTC 2020 - Pablo Suárez Hernández + +- Do not build Python2 subpackage since 3.2.0 does not support Python2 +- Adjust skipped SSH unit tests when paramiko <= 2.7.0 + +- Add: + * skip-some-tests-for-older-paramiko-versions.patch + ------------------------------------------------------------------- Wed Oct 21 01:17:39 UTC 2020 - Steve Kowalik diff --git a/python-apache-libcloud.spec b/python-apache-libcloud.spec index 3bb4344..b1a286f 100644 --- a/python-apache-libcloud.spec +++ b/python-apache-libcloud.spec @@ -16,6 +16,9 @@ # +# No longer build for python2 +%define skip_python2 1 + %{?!python_module:%define python_module() python-%{**} python3-%{**}} %bcond_without python2 Name: python-apache-libcloud @@ -23,10 +26,13 @@ Version: 3.2.0 Release: 0 Summary: Abstraction over multiple cloud provider APIs License: Apache-2.0 +Group: Development/Languages/Python URL: https://libcloud.apache.org Source0: https://files.pythonhosted.org/packages/source/a/apache-libcloud/apache-libcloud-%{version}.tar.gz Patch1: gce_image_projects.patch Patch2: ec2_create_node.patch +Patch3: skip-some-tests-for-older-paramiko-versions.patch + BuildRequires: %{python_module libvirt-python} BuildRequires: %{python_module lockfile} BuildRequires: %{python_module lxml} @@ -51,8 +57,6 @@ BuildArch: noarch %if %{with python2} BuildRequires: python-backports.ssl_match_hostname BuildRequires: python2 -%endif -%ifpython2 Requires: python-backports.ssl_match_hostname %endif %python_subpackages @@ -65,6 +69,7 @@ differences among multiple cloud provider APIs. %setup -q -n apache-libcloud-%{version} %patch1 -p1 %patch2 -p1 +%patch3 -p1 sed -i '/^#!/d' demos/gce_demo.py chmod a-x demos/gce_demo.py # Setup tests diff --git a/skip-some-tests-for-older-paramiko-versions.patch b/skip-some-tests-for-older-paramiko-versions.patch new file mode 100644 index 0000000..1852b92 --- /dev/null +++ b/skip-some-tests-for-older-paramiko-versions.patch @@ -0,0 +1,31 @@ +Index: apache-libcloud-3.2.0/libcloud/test/compute/test_ssh_client.py +=================================================================== +--- apache-libcloud-3.2.0.orig/libcloud/test/compute/test_ssh_client.py ++++ apache-libcloud-3.2.0/libcloud/test/compute/test_ssh_client.py +@@ -168,6 +168,8 @@ class ParamikoSSHClientTests(LibcloudTes + expected_msg, mock.connect) + + @patch('paramiko.SSHClient', Mock) ++ @unittest.skipIf(paramiko_version < '2.7.0', ++ 'Old versions of paramiko do not support OPENSSH key format') + def test_password_protected_key_no_password_provided_1(self): + path = os.path.join(os.path.dirname(__file__), + 'fixtures', 'misc', +@@ -198,6 +200,8 @@ class ParamikoSSHClientTests(LibcloudTes + expected_msg, mock.connect) + + @patch('paramiko.SSHClient', Mock) ++ @unittest.skipIf(paramiko_version < '2.7.0', ++ 'Old versions of paramiko do not support OPENSSH key format') + def test_password_protected_key_no_password_provided_2(self): + path = os.path.join(os.path.dirname(__file__), + 'fixtures', 'misc', +@@ -219,6 +223,8 @@ class ParamikoSSHClientTests(LibcloudTes + expected_msg, mock.connect) + + @patch('paramiko.SSHClient', Mock) ++ @unittest.skipIf(paramiko_version < '2.7.0', ++ 'Old versions of paramiko do not support OPENSSH key format') + def test_password_protected_key_valid_password_provided(self): + path = os.path.join(os.path.dirname(__file__), + 'fixtures', 'misc', From f2ce52a468fe7590bd0ffc990825b4b31967bf45b2416a6d28d68ffa198c49ba Mon Sep 17 00:00:00 2001 From: Alexander Graul Date: Fri, 30 Oct 2020 11:45:28 +0000 Subject: [PATCH 2/3] Accepting request 845007 from home:PSuarezHernandez:branches:devel:languages:python - Add pyOpenSSL as build dependency to allow tests to pass on SLE15 family OBS-URL: https://build.opensuse.org/request/show/845007 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-apache-libcloud?expand=0&rev=106 --- python-apache-libcloud.changes | 5 +++++ python-apache-libcloud.spec | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/python-apache-libcloud.changes b/python-apache-libcloud.changes index 62bda1d..07f3443 100644 --- a/python-apache-libcloud.changes +++ b/python-apache-libcloud.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Oct 30 09:26:42 UTC 2020 - Pablo Suárez Hernández + +- Add pyOpenSSL as build dependency to allow tests to pass on SLE15 family + ------------------------------------------------------------------- Wed Oct 28 13:45:19 UTC 2020 - Pablo Suárez Hernández diff --git a/python-apache-libcloud.spec b/python-apache-libcloud.spec index b1a286f..6793a4f 100644 --- a/python-apache-libcloud.spec +++ b/python-apache-libcloud.spec @@ -38,6 +38,7 @@ BuildRequires: %{python_module lockfile} BuildRequires: %{python_module lxml} BuildRequires: %{python_module mock} BuildRequires: %{python_module paramiko} +BuildRequires: %{python_module pyOpenSSL} BuildRequires: %{python_module pytest-runner} BuildRequires: %{python_module pytest} BuildRequires: %{python_module requests-mock} @@ -88,8 +89,8 @@ find %{buildroot} -name '*.pem' -size 0 -delete %check # Skip ShellOutSSHClientTests tests which attempt to ssh to localhost -# Note these two extra py3 failures are undesirable and should be fixed -%pytest -k '(not test_consume_stderr_chunk_contains_part_of_multi_byte_utf8_character and not test_consume_stdout_chunk_contains_part_of_multi_byte_utf8_character and not ShellOutSSHClientTests and not ElasticContainerDriverTestCase)' +# Note these four extra py3 failures are undesirable and should be fixed: fail in s390 and ppc64 +%pytest -k '(not test_consume_stderr_chunk_contains_part_of_multi_byte_utf8_character and not test_consume_stdout_chunk_contains_part_of_multi_byte_utf8_character and not test_consume_stdout_chunk_contains_non_utf8_character and not test_consume_stderr_chunk_contains_non_utf8_character and not ShellOutSSHClientTests and not ElasticContainerDriverTestCase)' %files %{python_files} %license LICENSE From c5a7f9c3ecd4b8a9ee416531b44ebd0b525f91db9811a6833ef6cb793ec13970 Mon Sep 17 00:00:00 2001 From: Alexander Graul Date: Fri, 30 Oct 2020 14:58:04 +0000 Subject: [PATCH 3/3] Accepting request 845048 from home:PSuarezHernandez:branches:devel:languages:python - Skip conflictive 'ParamikoSSHClientTests.test_key_file_non_pem_format_error' test since our SLE python-paramiko package already has OpenSSH support on version < 2.7.0 OBS-URL: https://build.opensuse.org/request/show/845048 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-apache-libcloud?expand=0&rev=107 --- python-apache-libcloud.changes | 6 ++++++ python-apache-libcloud.spec | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/python-apache-libcloud.changes b/python-apache-libcloud.changes index 07f3443..6ee6b91 100644 --- a/python-apache-libcloud.changes +++ b/python-apache-libcloud.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Oct 30 12:47:57 UTC 2020 - Pablo Suárez Hernández + +- Skip conflictive 'ParamikoSSHClientTests.test_key_file_non_pem_format_error' test + since our SLE python-paramiko package already has OpenSSH support on version < 2.7.0 + ------------------------------------------------------------------- Fri Oct 30 09:26:42 UTC 2020 - Pablo Suárez Hernández diff --git a/python-apache-libcloud.spec b/python-apache-libcloud.spec index 6793a4f..93694e2 100644 --- a/python-apache-libcloud.spec +++ b/python-apache-libcloud.spec @@ -89,8 +89,9 @@ find %{buildroot} -name '*.pem' -size 0 -delete %check # Skip ShellOutSSHClientTests tests which attempt to ssh to localhost +# Skip test_key_file_non_pem_format_error since OpenSSH support is backported for SLE python-paramiko < 2.7.0 # Note these four extra py3 failures are undesirable and should be fixed: fail in s390 and ppc64 -%pytest -k '(not test_consume_stderr_chunk_contains_part_of_multi_byte_utf8_character and not test_consume_stdout_chunk_contains_part_of_multi_byte_utf8_character and not test_consume_stdout_chunk_contains_non_utf8_character and not test_consume_stderr_chunk_contains_non_utf8_character and not ShellOutSSHClientTests and not ElasticContainerDriverTestCase)' +%pytest -k '(not test_consume_stderr_chunk_contains_part_of_multi_byte_utf8_character and not test_consume_stdout_chunk_contains_part_of_multi_byte_utf8_character and not test_consume_stdout_chunk_contains_non_utf8_character and not test_consume_stderr_chunk_contains_non_utf8_character and not test_key_file_non_pem_format_error and not ShellOutSSHClientTests and not ElasticContainerDriverTestCase)' %files %{python_files} %license LICENSE