Skip to content

Commit

Permalink
tests: skip 'net_if_addrs' in test_serialization QEMU on s390x musl libc
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeut committed Jun 15, 2024
1 parent d57d70d commit 6a81bf3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion psutil/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions psutil/tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 6a81bf3

Please sign in to comment.