[3.12] gh-145548: Use VMADDR_CID_LOCAL in VSOCK socket tests (GH-145589)#145809
[3.12] gh-145548: Use VMADDR_CID_LOCAL in VSOCK socket tests (GH-145589)#145809encukou wants to merge 2 commits intopython:3.12from
Conversation
…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>
…honGH-145735) VMADDR_CID_LOCAL was added to `socekt` in 3.14. The test needs a local constant in setUp(), as in clientSetUp().
vstinner
left a comment
There was a problem hiding this comment.
LGTM. I tested the change manually on Fedora Stable x86-64, ./python -m test test_socket -m ThreadedVSOCKSocketStreamTest -v pass successfully, and ./python -m test.pythoninfo works as expected (it logs test_socket.get_cid: 4294967295).
|
The test also exists on 3.10 and 3.11, we might need to backport the change there as well. |
Yes. I set the labels here, so that miss-islington includes the fix-up. |
|
Hiya @encukou |
I added |
|
Ah, Thank you for the clarification :) I just realised that I didn't see the 3.12 tag |
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)
Includes fix-up from 26326a0 (GH-145735)
Co-authored-by: Victor Stinner vstinner@python.org