diff --git a/opensuse-fix-tests-1-core.patch b/opensuse-fix-tests-1-core.patch new file mode 100644 index 0000000..fa1fc32 --- /dev/null +++ b/opensuse-fix-tests-1-core.patch @@ -0,0 +1,18 @@ +Index: python_gvm-24.8.0/tests/connections/test_unix_socket_connection.py +=================================================================== +--- python_gvm-24.8.0.orig/tests/connections/test_unix_socket_connection.py ++++ python_gvm-24.8.0/tests/connections/test_unix_socket_connection.py +@@ -62,6 +62,13 @@ class UnixSocketConnectionTestCase(unitt + connection.disconnect() + + def test_unix_socket_connection_connect_send_bytes_read(self): ++ # Add sleep to make sure setup theading server is up and ++ # running even with limited resources, bsc#1233398 ++ import time ++ import multiprocessing ++ if multiprocessing.cpu_count() == 1: ++ time.sleep(2) ++ + connection = UnixSocketConnection( + path=self.socket_name, timeout=DEFAULT_TIMEOUT + ) diff --git a/python-python-gvm.changes b/python-python-gvm.changes index 310ef98..3ee7b67 100644 --- a/python-python-gvm.changes +++ b/python-python-gvm.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Nov 25 10:29:53 UTC 2024 - Daniel Garcia + +- Add opensuse-fix-tests-1-core.patch custom patch to fix tests + running in OBS with limited resources, running on 1-core-VM. + bsc#1233398 + ------------------------------------------------------------------- Wed Nov 13 12:28:07 UTC 2024 - Markéta Machová diff --git a/python-python-gvm.spec b/python-python-gvm.spec index 42a9752..32161ce 100644 --- a/python-python-gvm.spec +++ b/python-python-gvm.spec @@ -25,6 +25,9 @@ License: GPL-3.0-only Group: Development/Languages/Python URL: https://github.com/greenbone/python-gvm Source: https://files.pythonhosted.org/packages/source/p/python_gvm/python_gvm-%{version}.tar.gz +# PATCH-FIX-OPENSUSE opensuse-fix-tests-1-core.patch -- bsc#1233398 +# Fix tests running with 1 core in VM +Patch: opensuse-fix-tests-1-core.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module poetry-core} BuildRequires: %{python_module setuptools} @@ -49,7 +52,7 @@ Manager (GSM) appliance and its underlying Greenbone Vulnerability Manager Greenbone Management Protocol (GMP) and Open Scanner Protocol (OSP). %prep -%setup -q -n python_gvm-%{version} +%autosetup -p1 -n python_gvm-%{version} %build %pyproject_wheel