diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py index b039cc04d..88f5f39a3 100644 --- a/psutil/tests/__init__.py +++ b/psutil/tests/__init__.py @@ -87,7 +87,7 @@ "HAS_IONICE", "HAS_MEMORY_MAPS", "HAS_PROC_CPU_NUM", "HAS_RLIMIT", "HAS_SENSORS_BATTERY", "HAS_BATTERY", "HAS_SENSORS_FANS", "HAS_SENSORS_TEMPERATURES", "HAS_NET_CONNECTIONS_UNIX", "MACOS_11PLUS", - "MACOS_12PLUS", "QEMU_USER", "COVERAGE", 'AARCH64', 'S390X', + "MACOS_12PLUS", "QEMU_USER", "COVERAGE", 'AARCH64', 'S390X', 'LIBC', # subprocesses 'pyrun', 'terminate', 'reap_children', 'spawn_testproc', 'spawn_zombie', 'spawn_children_pair', @@ -137,6 +137,7 @@ IS_64BIT = sys.maxsize > 2**32 AARCH64 = platform.machine() == "aarch64" S390X = platform.machine() == "s390x" +LIBC, _ = platform.libc_ver() if LINUX else "", "" @memoize diff --git a/psutil/tests/test_misc.py b/psutil/tests/test_misc.py index 5c05d1764..ef297149f 100755 --- a/psutil/tests/test_misc.py +++ b/psutil/tests/test_misc.py @@ -41,9 +41,11 @@ from psutil.tests import HAS_SENSORS_BATTERY from psutil.tests import HAS_SENSORS_FANS from psutil.tests import HAS_SENSORS_TEMPERATURES +from psutil.tests import LIBC from psutil.tests import PYTHON_EXE from psutil.tests import PYTHON_EXE_ENV from psutil.tests import QEMU_USER +from psutil.tests import S390X from psutil.tests import SCRIPTS_DIR from psutil.tests import PsutilTestCase from psutil.tests import mock @@ -289,9 +291,13 @@ def check(ret): for fun, name in ns.iter(ns.getters): if name in {"win_service_iter", "win_service_get"}: continue - if QEMU_USER and name == "net_if_stats": - # OSError: [Errno 38] ioctl(SIOCETHTOOL) not implemented - continue + if QEMU_USER: + if name == "net_if_stats": + # OSError: [Errno 38] ioctl(SIOCETHTOOL) not implemented + continue + if S390X and LIBC != "glibc" and name == "net_if_addrs": + # deadlock with QEMU on s390x musl libc + continue with self.subTest(name=name): try: ret = fun()