Skip to content

gh-145548: Use VMADDR_CID_LOCAL in VSOCK socket tests#145589

Merged
vstinner merged 2 commits intopython:mainfrom
vstinner:vsock
Mar 6, 2026
Merged

gh-145548: Use VMADDR_CID_LOCAL in VSOCK socket tests#145589
vstinner merged 2 commits intopython:mainfrom
vstinner:vsock

Conversation

@vstinner
Copy link
Copy Markdown
Member

@vstinner vstinner commented Mar 6, 2026

Prefer VMADDR_CID_LOCAL instead of VMADDR_CID_ANY for bind() in the server. Skip the test if bind() fails with EADDRNOTAVAIL.

Prefer VMADDR_CID_LOCAL instead of VMADDR_CID_ANY for bind() in the
server. Skip the test if bind() fails with EADDRNOTAVAIL.
@vstinner
Copy link
Copy Markdown
Member Author

vstinner commented Mar 6, 2026

This change fix AMD64 Fedora Stable 3.x and PPC64LE Fedora Stable 3.x where test_socket fails without this change. On these two buildbot workers, the test is now skipped with:

$ ./python -m test -v test_socket -m ThreadedVSOCKSocketStreamTest -v
...
testStream (test.test_socket.ThreadedVSOCKSocketStreamTest.testStream) ... skipped "bind() failed with OSError(99, 'Cannot assign requested address')"

On s390x Fedora Stable 3.x, test_socket pass without this change, and still pass with this change.

$ ./python -m test test_socket -m ThreadedVSOCKSocketStreamTest -v
...
testStream (test.test_socket.ThreadedVSOCKSocketStreamTest.testStream) ... ok

@vstinner vstinner added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Mar 6, 2026
@bedevere-bot
Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @vstinner for commit 4d24cb3 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F145589%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Mar 6, 2026
@vstinner vstinner merged commit 6c8c72f into python:main Mar 6, 2026
88 of 94 checks passed
@vstinner vstinner deleted the vsock branch March 6, 2026 15:51
@miss-islington-app
Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 6, 2026
…-145589)

Prefer VMADDR_CID_LOCAL instead of VMADDR_CID_ANY for bind() in the
server. Skip the test if bind() fails with EADDRNOTAVAIL.

Log vsock CID in test.pythoninfo.
(cherry picked from commit 6c8c72f)

Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Mar 6, 2026

GH-145593 is a backport of this pull request to the 3.14 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 6, 2026
…-145589)

Prefer VMADDR_CID_LOCAL instead of VMADDR_CID_ANY for bind() in the
server. Skip the test if bind() fails with EADDRNOTAVAIL.

Log vsock CID in test.pythoninfo.
(cherry picked from commit 6c8c72f)

Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Mar 6, 2026
@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Mar 6, 2026

GH-145594 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Mar 6, 2026
vstinner added a commit that referenced this pull request Mar 6, 2026
…) (#145593)

gh-145548: Use VMADDR_CID_LOCAL in VSOCK socket tests (GH-145589)

Prefer VMADDR_CID_LOCAL instead of VMADDR_CID_ANY for bind() in the
server. Skip the test if bind() fails with EADDRNOTAVAIL.

Log vsock CID in test.pythoninfo.
(cherry picked from commit 6c8c72f)

Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit that referenced this pull request Mar 6, 2026
…) (#145594)

gh-145548: Use VMADDR_CID_LOCAL in VSOCK socket tests (GH-145589)

Prefer VMADDR_CID_LOCAL instead of VMADDR_CID_ANY for bind() in the
server. Skip the test if bind() fails with EADDRNOTAVAIL.

Log vsock CID in test.pythoninfo.
(cherry picked from commit 6c8c72f)

Co-authored-by: Victor Stinner <vstinner@python.org>
encukou pushed a commit to encukou/cpython that referenced this pull request Mar 11, 2026
…ythonGH-145589) (pythonGH-145594)

pythongh-145548: Use VMADDR_CID_LOCAL in VSOCK socket tests (pythonGH-145589)

Prefer VMADDR_CID_LOCAL instead of VMADDR_CID_ANY for bind() in the
server. Skip the test if bind() fails with EADDRNOTAVAIL.

Log vsock CID in test.pythoninfo.
(cherry picked from commit 6c8c72f)
(cherry picked from commit 16dbbe5)

Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Mar 11, 2026

GH-145809 is a backport of this pull request to the 3.12 branch.

Yhg1s pushed a commit that referenced this pull request Apr 15, 2026
…) (#145809)

* [3.12] gh-145548: Use VMADDR_CID_LOCAL in VSOCK socket tests (GH-145589) (GH-145594)

Prefer VMADDR_CID_LOCAL instead of VMADDR_CID_ANY for bind() in the
server. Skip the test if bind() fails with EADDRNOTAVAIL.

Log vsock CID in test.pythoninfo.
(cherry picked from commit 6c8c72f)
(cherry picked from commit 16dbbe5)

* [3.13] gh-145548: Don't use VMADDR_CID_LOCAL from `socket` (GH-145735)

VMADDR_CID_LOCAL was added to `socekt` in 3.14. The test needs a
local constant in setUp(), as in clientSetUp().

Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
miss-islington added a commit to miss-islington/cpython that referenced this pull request Apr 15, 2026
…ythonGH-145589) (pythonGH-145809)

* [3.12] pythongh-145548: Use VMADDR_CID_LOCAL in VSOCK socket tests (pythonGH-145589) (pythonGH-145594)

Prefer VMADDR_CID_LOCAL instead of VMADDR_CID_ANY for bind() in the
server. Skip the test if bind() fails with EADDRNOTAVAIL.

Log vsock CID in test.pythoninfo.
(cherry picked from commit 6c8c72f)
(cherry picked from commit 16dbbe5)

* [3.13] pythongh-145548: Don't use VMADDR_CID_LOCAL from `socket` (pythonGH-145735)

VMADDR_CID_LOCAL was added to `socekt` in 3.14. The test needs a
local constant in setUp(), as in clientSetUp().
(cherry picked from commit e378eda)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
miss-islington added a commit to miss-islington/cpython that referenced this pull request Apr 15, 2026
…ythonGH-145589) (pythonGH-145809)

* [3.12] pythongh-145548: Use VMADDR_CID_LOCAL in VSOCK socket tests (pythonGH-145589) (pythonGH-145594)

Prefer VMADDR_CID_LOCAL instead of VMADDR_CID_ANY for bind() in the
server. Skip the test if bind() fails with EADDRNOTAVAIL.

Log vsock CID in test.pythoninfo.
(cherry picked from commit 6c8c72f)
(cherry picked from commit 16dbbe5)

* [3.13] pythongh-145548: Don't use VMADDR_CID_LOCAL from `socket` (pythonGH-145735)

VMADDR_CID_LOCAL was added to `socekt` in 3.14. The test needs a
local constant in setUp(), as in clientSetUp().
(cherry picked from commit e378eda)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants