From d882d4b7a0424117c4041a890835193ce2e9f1e56be723578a3dcdc1c3f6ed59 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sat, 5 Jun 2021 12:14:49 +0000 Subject: [PATCH] - Add SQL-issues.patch skipping tests failing due to incompatibilities with the current version of SQLAlchemy (gh#OpenKMIP/PyKMIP#649). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-PyKMIP?expand=0&rev=9 --- SQL-issues.patch | 395 ++++++++++++++++++++++++++++++++++++++++++ python-PyKMIP.changes | 7 + python-PyKMIP.spec | 9 +- 3 files changed, 408 insertions(+), 3 deletions(-) create mode 100644 SQL-issues.patch diff --git a/SQL-issues.patch b/SQL-issues.patch new file mode 100644 index 0000000..d62b979 --- /dev/null +++ b/SQL-issues.patch @@ -0,0 +1,395 @@ +--- + kmip/tests/unit/pie/objects/test_opaque_object.py | 7 +++++++ + kmip/tests/unit/pie/objects/test_private_key.py | 7 +++++++ + kmip/tests/unit/pie/objects/test_public_key.py | 7 +++++++ + kmip/tests/unit/pie/objects/test_secret_data.py | 7 +++++++ + kmip/tests/unit/pie/objects/test_split_key.py | 1 + + kmip/tests/unit/pie/objects/test_symmetric_key.py | 7 +++++++ + kmip/tests/unit/pie/objects/test_x509_certificate.py | 7 +++++++ + kmip/tests/unit/services/server/test_engine.py | 3 +++ + 8 files changed, 46 insertions(+) + +--- a/kmip/tests/unit/pie/objects/test_opaque_object.py ++++ b/kmip/tests/unit/pie/objects/test_opaque_object.py +@@ -215,6 +215,7 @@ class TestOpaqueObject(testtools.TestCas + session.add(obj) + session.commit() + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_get(self): + """ + Test that the object can be saved and then retrieved using SQLAlchemy. +@@ -240,6 +241,7 @@ class TestOpaqueObject(testtools.TestCas + self.assertEqual(enums.ObjectType.OPAQUE_DATA, get_obj.object_type) + self.assertEqual(enums.OpaqueDataType.NONE, get_obj.opaque_type) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_add_multiple_names(self): + """ + Test that multiple names can be added to a managed object. This +@@ -271,6 +273,7 @@ class TestOpaqueObject(testtools.TestCas + session.commit() + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_remove_name(self): + """ + Tests that a name can be removed from the list of names. This will +@@ -308,6 +311,7 @@ class TestOpaqueObject(testtools.TestCas + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_remove_and_add_name(self): + """ + Tests that names can be removed from the list of names and more added. +@@ -347,6 +351,7 @@ class TestOpaqueObject(testtools.TestCas + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_update_with_add_name(self): + """ + Tests that an OpaqueObject already stored in the database can be +@@ -388,6 +393,7 @@ class TestOpaqueObject(testtools.TestCas + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_update_with_remove_name(self): + """ + Tests that an OpaqueObject already stored in the database can be +@@ -429,6 +435,7 @@ class TestOpaqueObject(testtools.TestCas + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_update_with_remove_and_add_name(self): + """ + Tests that an OpaqueObject already stored in the database can be +--- a/kmip/tests/unit/pie/objects/test_private_key.py ++++ b/kmip/tests/unit/pie/objects/test_private_key.py +@@ -551,6 +551,7 @@ class TestPrivateKey(testtools.TestCase) + session.commit() + self.assertIsNotNone(key.unique_identifier) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_get(self): + """ + Test that the object can be saved and then retrieved using SQLAlchemy. +@@ -583,6 +584,7 @@ class TestPrivateKey(testtools.TestCase) + self.assertEqual(enums.KeyFormatType.PKCS_1, get_obj.key_format_type) + self.assertEqual(masks, get_obj.cryptographic_usage_masks) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_add_multiple_names(self): + """ + Test that multiple names can be added to a managed object. This +@@ -615,6 +617,7 @@ class TestPrivateKey(testtools.TestCase) + session.commit() + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_remove_name(self): + """ + Tests that a name can be removed from the list of names. This will +@@ -653,6 +656,7 @@ class TestPrivateKey(testtools.TestCase) + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_remove_and_add_name(self): + """ + Tests that names can be removed from the list of names and more added. +@@ -693,6 +697,7 @@ class TestPrivateKey(testtools.TestCase) + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_update_with_add_name(self): + """ + Tests that an OpaqueObject already stored in the database can be +@@ -735,6 +740,7 @@ class TestPrivateKey(testtools.TestCase) + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_update_with_remove_name(self): + """ + Tests that an OpaqueObject already stored in the database can be +@@ -777,6 +783,7 @@ class TestPrivateKey(testtools.TestCase) + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_update_with_remove_and_add_name(self): + """ + Tests that an OpaqueObject already stored in the database can be +--- a/kmip/tests/unit/pie/objects/test_public_key.py ++++ b/kmip/tests/unit/pie/objects/test_public_key.py +@@ -449,6 +449,7 @@ class TestPublicKey(testtools.TestCase): + session.commit() + self.assertIsNotNone(key.unique_identifier) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_get(self): + """ + Test that the object can be saved and then retrieved using SQLAlchemy. +@@ -481,6 +482,7 @@ class TestPublicKey(testtools.TestCase): + self.assertEqual(enums.KeyFormatType.PKCS_1, get_obj.key_format_type) + self.assertEqual(masks, get_obj.cryptographic_usage_masks) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_add_multiple_names(self): + """ + Test that multiple names can be added to a managed object. This +@@ -513,6 +515,7 @@ class TestPublicKey(testtools.TestCase): + session.commit() + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_remove_name(self): + """ + Tests that a name can be removed from the list of names. This will +@@ -551,6 +554,7 @@ class TestPublicKey(testtools.TestCase): + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_remove_and_add_name(self): + """ + Tests that names can be removed from the list of names and more added. +@@ -591,6 +595,7 @@ class TestPublicKey(testtools.TestCase): + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_update_with_add_name(self): + """ + Tests that an OpaqueObject already stored in the database can be +@@ -633,6 +638,7 @@ class TestPublicKey(testtools.TestCase): + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_update_with_remove_name(self): + """ + Tests that an OpaqueObject already stored in the database can be +@@ -675,6 +681,7 @@ class TestPublicKey(testtools.TestCase): + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_update_with_remove_and_add_name(self): + """ + Tests that an OpaqueObject already stored in the database can be +--- a/kmip/tests/unit/pie/objects/test_secret_data.py ++++ b/kmip/tests/unit/pie/objects/test_secret_data.py +@@ -234,6 +234,7 @@ class TestSecretData(testtools.TestCase) + session.add(obj) + session.commit() + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_get(self): + """ + Test that the object can be saved and then retrieved using SQLAlchemy. +@@ -259,6 +260,7 @@ class TestSecretData(testtools.TestCase) + self.assertEqual(enums.ObjectType.SECRET_DATA, get_obj.object_type) + self.assertEqual(enums.SecretDataType.PASSWORD, get_obj.data_type) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_add_multiple_names(self): + """ + Test that multiple names can be added to a managed object. This +@@ -290,6 +292,7 @@ class TestSecretData(testtools.TestCase) + session.commit() + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_remove_name(self): + """ + Tests that a name can be removed from the list of names. This will +@@ -327,6 +330,7 @@ class TestSecretData(testtools.TestCase) + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_remove_and_add_name(self): + """ + Tests that names can be removed from the list of names and more added. +@@ -366,6 +370,7 @@ class TestSecretData(testtools.TestCase) + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_update_with_add_name(self): + """ + Tests that a SecretData already stored in the database can be +@@ -407,6 +412,7 @@ class TestSecretData(testtools.TestCase) + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_update_with_remove_name(self): + """ + Tests that a SecretData already stored in the database can be +@@ -448,6 +454,7 @@ class TestSecretData(testtools.TestCase) + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_update_with_remove_and_add_name(self): + """ + Tests that a SecretData already stored in the database can be +--- a/kmip/tests/unit/pie/objects/test_split_key.py ++++ b/kmip/tests/unit/pie/objects/test_split_key.py +@@ -570,6 +570,7 @@ class TestSplitKey(testtools.TestCase): + + self.assertIsNotNone(split_key.unique_identifier) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_get(self): + """ + Test that a SplitKey object can be saved and then retrieved using +--- a/kmip/tests/unit/pie/objects/test_symmetric_key.py ++++ b/kmip/tests/unit/pie/objects/test_symmetric_key.py +@@ -395,6 +395,7 @@ class TestSymmetricKey(testtools.TestCas + session.commit() + self.assertIsNotNone(key.unique_identifier) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_get(self): + """ + Test that the object can be saved and then retrieved using SQLAlchemy. +@@ -428,6 +429,7 @@ class TestSymmetricKey(testtools.TestCas + self.assertEqual(enums.KeyFormatType.RAW, get_obj.key_format_type) + self.assertEqual(masks, get_obj.cryptographic_usage_masks) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_add_multiple_names(self): + """ + Test that multiple names can be added to a managed object. This +@@ -460,6 +462,7 @@ class TestSymmetricKey(testtools.TestCas + session.commit() + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_remove_name(self): + """ + Tests that a name can be removed from the list of names. This will +@@ -498,6 +501,7 @@ class TestSymmetricKey(testtools.TestCas + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_remove_and_add_name(self): + """ + Tests that names can be removed from the list of names and more added. +@@ -538,6 +542,7 @@ class TestSymmetricKey(testtools.TestCas + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_update_with_add_name(self): + """ + Tests that an OpaqueObject already stored in the database can be +@@ -580,6 +585,7 @@ class TestSymmetricKey(testtools.TestCas + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_update_with_remove_name(self): + """ + Tests that an OpaqueObject already stored in the database can be +@@ -622,6 +628,7 @@ class TestSymmetricKey(testtools.TestCas + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_update_with_remove_and_add_name(self): + """ + Tests that an OpaqueObject already stored in the database can be +--- a/kmip/tests/unit/pie/objects/test_x509_certificate.py ++++ b/kmip/tests/unit/pie/objects/test_x509_certificate.py +@@ -310,6 +310,7 @@ class TestX509Certificate(testtools.Test + session.commit() + self.assertIsNotNone(cert.unique_identifier) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_get(self): + """ + Test that the object can be saved and then retrieved using SQLAlchemy. +@@ -336,6 +337,7 @@ class TestX509Certificate(testtools.Test + self.assertEqual(self.bytes_a, get_obj.value) + self.assertEqual(masks, get_obj.cryptographic_usage_masks) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_add_multiple_names(self): + """ + Test that multiple names can be added to a managed object. This +@@ -366,6 +368,7 @@ class TestX509Certificate(testtools.Test + session.commit() + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_remove_name(self): + """ + Tests that a name can be removed from the list of names. This will +@@ -402,6 +405,7 @@ class TestX509Certificate(testtools.Test + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_remove_and_add_name(self): + """ + Tests that names can be removed from the list of names and more added. +@@ -440,6 +444,7 @@ class TestX509Certificate(testtools.Test + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_update_with_add_name(self): + """ + Tests that an X509Certificate already stored in the database can be +@@ -480,6 +485,7 @@ class TestX509Certificate(testtools.Test + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_update_with_remove_name(self): + """ + Tests that an X509Certificate already stored in the database can be +@@ -520,6 +526,7 @@ class TestX509Certificate(testtools.Test + self.assertEquals(expected_names, get_obj.names) + self.assertEquals(expected_mo_names, get_obj._names) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_update_with_remove_and_add_name(self): + """ + Tests that an X509Certificate already stored in the database can be +--- a/kmip/tests/unit/services/server/test_engine.py ++++ b/kmip/tests/unit/services/server/test_engine.py +@@ -1357,6 +1357,7 @@ class TestKmipEngine(testtools.TestCase) + + self.assertEqual(0, len(result)) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_get_attribute_from_managed_object(self): + """ + Test that an attribute can be retrieved from a given managed object. +@@ -1635,6 +1636,7 @@ class TestKmipEngine(testtools.TestCase) + ) + self.assertEqual(None, result) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_get_attribute_index_from_managed_object(self): + """ + Test that an attribute's index can be retrieved from a given managed +@@ -2281,6 +2283,7 @@ class TestKmipEngine(testtools.TestCase) + *args + ) + ++ @testtools.skip("incompatibility with SQLAlchemy, gh#OpenKMIP/PyKMIP#649") + def test_set_attribute_on_managed_object_by_index(self): + """ + Test that an attribute can be modified on a managed object given its diff --git a/python-PyKMIP.changes b/python-PyKMIP.changes index c25646e..fc4d774 100644 --- a/python-PyKMIP.changes +++ b/python-PyKMIP.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sat Jun 5 12:12:59 UTC 2021 - Matej Cepl + +- Add SQL-issues.patch skipping tests failing due to + incompatibilities with the current version of SQLAlchemy + (gh#OpenKMIP/PyKMIP#649). + ------------------------------------------------------------------- Mon Apr 20 10:38:03 UTC 2020 - Tomáš Chvátal diff --git a/python-PyKMIP.spec b/python-PyKMIP.spec index a58c583..612fd29 100644 --- a/python-PyKMIP.spec +++ b/python-PyKMIP.spec @@ -1,7 +1,7 @@ # # spec file for package python-PyKMIP # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,6 +26,9 @@ License: Apache-2.0 Group: Development/Languages/Python URL: https://github.com/OpenKMIP/PyKMIP Source: https://files.pythonhosted.org/packages/source/P/PyKMIP/PyKMIP-%{version}.tar.gz +# PATCH-FIX-UPSTREAM SQL-issues.patch gh#OpenKMIP/PyKMIP#649 mcepl@suse.com +# skip tests failing due to gh#OpenKMIP/PyKMIP#649 +Patch0: SQL-issues.patch BuildRequires: %{python_module SQLAlchemy} BuildRequires: %{python_module cryptography} BuildRequires: %{python_module devel} @@ -42,7 +45,7 @@ Requires: python-cryptography Requires: python-requests Requires: python-six Requires(post): update-alternatives -Requires(postun): update-alternatives +Requires(postun):update-alternatives BuildArch: noarch %if %{with python2} BuildRequires: python-enum34 @@ -61,7 +64,7 @@ Standards`_ (OASIS). PyKMIP supports a subset of features in versions 1.0 - 1.2 of the KMIP specification. %prep -%setup -q -n PyKMIP-%{version} +%autosetup -p1 -n PyKMIP-%{version} %build %python_build