]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-119461: Restore the testSocket VSOCK skipUnless removed by PR GH-119465...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 13 Feb 2025 01:32:37 +0000 (02:32 +0100)
committerGitHub <noreply@github.com>
Thu, 13 Feb 2025 01:32:37 +0000 (01:32 +0000)
gh-119461: Restore the testSocket VSOCK skipUnless removed by PR GH-119465 (GH-129561)

Restore the skipUnless removed by GH-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.
(cherry picked from commit e1006ce1ded1b18972888ef057718dba6f2c7edd)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Lib/test/test_socket.py

index 267d81294be43c7296d85789690d7a2619eee947..91980b7688aa4c6142b6eeae4f7d3f0056d95db6 100644 (file)
@@ -472,6 +472,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'):