From 95765c04189cb33be8f15925bc3b8db474a118a5 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Wed, 21 Aug 2024 12:43:57 +0200 Subject: [PATCH] Fix treating sockets as paths in tests Resolves: RHEL-58359 --- python-psutil-sockets-are-not-paths.patch | 13 +++++++++++++ python-psutil.spec | 6 ++++++ 2 files changed, 19 insertions(+) create mode 100644 python-psutil-sockets-are-not-paths.patch diff --git a/python-psutil-sockets-are-not-paths.patch b/python-psutil-sockets-are-not-paths.patch new file mode 100644 index 0000000..f273948 --- /dev/null +++ b/python-psutil-sockets-are-not-paths.patch @@ -0,0 +1,13 @@ +diff --git a/psutil/tests/test_process_all.py b/psutil/tests/test_process_all.py +index afb3195..fd9c96c 100755 +--- a/psutil/tests/test_process_all.py ++++ b/psutil/tests/test_process_all.py +@@ -404,7 +404,7 @@ class TestFetchAllProcesses(PsutilTestCase): + for fname in nt._fields: + value = getattr(nt, fname) + if fname == 'path': +- if not value.startswith(("[", "anon_inode:")): ++ if not value.startswith(("[", "anon_inode:", "socket:")): + assert os.path.isabs(nt.path), nt.path + # commented as on Linux we might get + # '/foo/bar (deleted)' diff --git a/python-psutil.spec b/python-psutil.spec index dd8d3d3..eb634aa 100644 --- a/python-psutil.spec +++ b/python-psutil.spec @@ -29,6 +29,11 @@ Patch: python-psutil-skip-test_debug.patch # Failure reported upstream: https://github.com/giampaolo/psutil/issues/2434 # Patch: python-psutil-skip-test-sensors-temperatures.patch +# +# Don't treat sockets as paths +# Reported upstream: https://github.com/giampaolo/psutil/pull/2435 +# +Patch: python-psutil-sockets-are-not-paths.patch BuildRequires: gcc BuildRequires: sed @@ -119,6 +124,7 @@ APPVEYOR=1 %{py3_test_envvars} %{python3} psutil/tests/runner.py %changelog * Tue Aug 20 2024 Karolina Surma - 5.9.8-4 - Skip unreliable test_sensors_temperatures +- Don't treat sockets as paths in tests * Mon Jun 24 2024 Troy Dawson - 5.9.8-3 - Bump release for June 2024 mass rebuild