Skip to content

Commit 05fd823

Browse files
committed
skip test_aead_aes_gcm if the underlying kernel issue is not resolved
1 parent 46a1f0a commit 05fd823

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Lib/test/support/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,16 @@ def requires(resource, msg=None):
310310
if resource == 'gui' and not _is_gui_available():
311311
raise ResourceDenied(_is_gui_available.reason)
312312

313+
def _get_kernel_version(sysname="Linux"):
314+
import platform
315+
if platform.system() != sysname:
316+
return None
317+
version_txt = platform.release().split('-', 1)[0]
318+
try:
319+
return tuple(map(int, version_txt.split('.')))
320+
except ValueError:
321+
return None
322+
313323
def _requires_unix_version(sysname, min_version):
314324
"""Decorator raising SkipTest if the OS is `sysname` and the version is less
315325
than `min_version`.

Lib/test/test_socket.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7139,8 +7139,14 @@ def test_aes_cbc(self):
71397139
self.assertEqual(len(dec), msglen * multiplier)
71407140
self.assertEqual(dec, msg * multiplier)
71417141

7142-
@support.requires_linux_version(4, 9) # see issue29324
7142+
@support.requires_linux_version(4, 9) # see gh-73510
71437143
def test_aead_aes_gcm(self):
7144+
kernel_version = support._get_kernel_version("Linux")
7145+
if kernel_version is not None:
7146+
if kernel_version >= (6, 16) and kernel_version < (6, 18):
7147+
# See https://github.com/python/cpython/issues/139310.
7148+
self.skipTest("upstream Linux kernel issue")
7149+
71447150
key = bytes.fromhex('c939cc13397c1d37de6ae0e1cb7c423c')
71457151
iv = bytes.fromhex('b3d8cc017cbb89b39e0f67e2')
71467152
plain = bytes.fromhex('c3b3c41f113a31b73d9a5cd432103069')

0 commit comments

Comments
 (0)