Skip to content

gh-149078: test_socket: verify runtime kernel support for UDPLite#149081

Open
mcepl wants to merge 1 commit intopython:mainfrom
openSUSE-Python:test_IPPROTO_UDPLITE
Open

gh-149078: test_socket: verify runtime kernel support for UDPLite#149081
mcepl wants to merge 1 commit intopython:mainfrom
openSUSE-Python:test_IPPROTO_UDPLITE

Conversation

@mcepl
Copy link
Copy Markdown
Contributor

@mcepl mcepl commented Apr 27, 2026

The test suite previously only checked for the existence of the socket.IPPROTO_UDPLITE constant. This caused test failures on systems where the constant is defined in headers (and thus present in the interpreter) but the protocol is not supported or enabled in the running kernel (e.g., restricted build environments).

This change adds a _have_socket_udplite() helper that performs a runtime check by attempting to create a UDPLite socket, aligning its behaviour with other optional protocols like RDS or AF_ALG.

Fixes: #149078

The test suite previously only checked for the existence of the
socket.IPPROTO_UDPLITE constant. This caused test failures on systems
where the constant is defined in headers (and thus present in the
interpreter) but the protocol is not supported or enabled in the
running kernel (e.g., restricted build environments).

This change adds a _have_socket_udplite() helper that performs a
runtime check by attempting to create a UDPLite socket, aligning its
behavior with other optional protocols like RDS or AF_ALG.
@mcepl mcepl force-pushed the test_IPPROTO_UDPLITE branch from 5316c65 to ec03728 Compare April 27, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_socket tests fail with kernel lacking support for IPPROTO_UDPLITE

1 participant