waypipe: only supported on Linux
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import contextlib
|
import contextlib
|
||||||
|
import platform
|
||||||
import socket
|
import socket
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
@@ -11,6 +12,9 @@ VMADDR_CID_HYPERVISOR = 2
|
|||||||
|
|
||||||
|
|
||||||
def test_vsock_port(port: int) -> bool:
|
def test_vsock_port(port: int) -> bool:
|
||||||
|
if platform.system() != "Linux":
|
||||||
|
msg = "vsock is only supported on Linux"
|
||||||
|
raise NotImplementedError(msg)
|
||||||
try:
|
try:
|
||||||
s = socket.socket(socket.AF_VSOCK, socket.SOCK_STREAM)
|
s = socket.socket(socket.AF_VSOCK, socket.SOCK_STREAM)
|
||||||
s.connect((VMADDR_CID_HYPERVISOR, port))
|
s.connect((VMADDR_CID_HYPERVISOR, port))
|
||||||
|
|||||||
Reference in New Issue
Block a user