File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
jumpstarter/drivers/dutlink Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change
1
+ import socket
2
+ from pathlib import Path
3
+ from tempfile import TemporaryDirectory
1
4
from time import sleep
2
5
6
+ import anyio
7
+ from pexpect .fdpexpect import fdspawn
8
+
3
9
from jumpstarter .common .utils import serve
4
10
from jumpstarter .drivers .dutlink .base import Dutlink
5
11
@@ -23,5 +29,15 @@ def test_drivers_dutlink():
23
29
24
30
client .storage .write ("/dev/null" )
25
31
26
- with client .console .connect () as stream :
27
- pass
32
+ with TemporaryDirectory () as tempdir :
33
+ socketpath = Path (tempdir ) / "socket"
34
+
35
+ listener = client .portal .call (anyio .create_unix_listener , socketpath )
36
+
37
+ with client .console .portforward (listener ):
38
+ with socket .socket (socket .AF_UNIX , socket .SOCK_STREAM ) as s :
39
+ s .connect (str (socketpath ))
40
+
41
+ expect = fdspawn (s )
42
+ expect .send ("about\r \n " )
43
+ expect .expect ("Jumpstarter test-harness" )
You can’t perform that action at this time.
0 commit comments