]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-119461: Restore the testSocket VSOCK skipUnless removed by PR #119465 (#129561)
authorGregory P. Smith <greg@krypto.org>
Sun, 2 Feb 2025 04:46:56 +0000 (20:46 -0800)
committerGitHub <noreply@github.com>
Sun, 2 Feb 2025 04:46:56 +0000 (20:46 -0800)
Restore the skipUnless removed by #119465.

This test can only pass on virtual machines, not actual machines.

actual machines see:

```
    self.cli.connect((cid, VSOCKPORT))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: [Errno 19] No such device
```

Reproduced on (Linux) Ubuntu 24.04.1 running 6.8.0-52-generic.

Lib/test/test_socket.py

index faf326d9164e1bbf8ad3ec8b7b154b1947a07660..b77fa3cb21512a2029f7bdc649d47e49bacc5e04 100644 (file)
@@ -520,6 +520,8 @@ class ThreadedRDSSocketTest(SocketRDSTest, ThreadableTest):
 @unittest.skipIf(WSL, 'VSOCK does not work on Microsoft WSL')
 @unittest.skipUnless(HAVE_SOCKET_VSOCK,
           'VSOCK sockets required for this test.')
+@unittest.skipUnless(get_cid() != 2,  # VMADDR_CID_HOST
+                     "This test can only be run on a virtual guest.")
 class ThreadedVSOCKSocketStreamTest(unittest.TestCase, ThreadableTest):
 
     def __init__(self, methodName='runTest'):