Skip to content

Commit 7e5d47d

Browse files
[3.13] gh-139310: skip test_aead_aes_gcm for Linux kernel between 6.16.0 and 6.17.x (GH-139552) (#139593)
gh-139310: skip `test_aead_aes_gcm` for Linux kernel between 6.16.0 and 6.17.x (GH-139552) Currently, Fedora 42 uses a custom Linux Kernel 6.16.9 that backported an upstream change from 6.17-rc7 [1,3] but not its subsequent fix [2]. Until the issue is resolved upstream, we skip the failing test `test_socket.test_aead_aes_gcm` for kernel versions between 6.16 and 6.17.x. [1] torvalds/linux@1b34cbb [2] torvalds/linux@d0ca0df [3] https://gitlab.com/cki-project/kernel-ark/-/commit/45bcf60fe49b37daab1acee57b27211ad1574042 (cherry picked from commit 41712c4) Co-authored-by: Bénédikt Tran <[email protected]>
1 parent 1a16059 commit 7e5d47d

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
@@ -305,6 +305,16 @@ def requires(resource, msg=None):
305305
if resource == 'gui' and not _is_gui_available():
306306
raise ResourceDenied(_is_gui_available.reason)
307307

308+
def _get_kernel_version(sysname="Linux"):
309+
import platform
310+
if platform.system() != sysname:
311+
return None
312+
version_txt = platform.release().split('-', 1)[0]
313+
try:
314+
return tuple(map(int, version_txt.split('.')))
315+
except ValueError:
316+
return None
317+
308318
def _requires_unix_version(sysname, min_version):
309319
"""Decorator raising SkipTest if the OS is `sysname` and the version is less
310320
than `min_version`.

Lib/test/test_socket.py

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

6927-
@support.requires_linux_version(4, 9) # see issue29324
6927+
@support.requires_linux_version(4, 9) # see gh-73510
69286928
def test_aead_aes_gcm(self):
6929+
kernel_version = support._get_kernel_version("Linux")
6930+
if kernel_version is not None:
6931+
if kernel_version >= (6, 16) and kernel_version < (6, 18):
6932+
# See https://github.com/python/cpython/issues/139310.
6933+
self.skipTest("upstream Linux kernel issue")
6934+
69296935
key = bytes.fromhex('c939cc13397c1d37de6ae0e1cb7c423c')
69306936
iv = bytes.fromhex('b3d8cc017cbb89b39e0f67e2')
69316937
plain = bytes.fromhex('c3b3c41f113a31b73d9a5cd432103069')

0 commit comments

Comments
 (0)