nixos/test-driver: replace termlib with socat
telnetlib does not handle unicode, which is annoying when using systemctl. Also this gives us a nice readline with history.
This commit is contained in:
@@ -462,9 +462,10 @@ class Machine:
|
||||
Should only be used during test development, not in the production test."""
|
||||
self.connect()
|
||||
self.log("Terminal is ready (there is no prompt):")
|
||||
telnet = telnetlib.Telnet()
|
||||
telnet.sock = self.shell # type: ignore
|
||||
telnet.interact()
|
||||
subprocess.run(
|
||||
["socat", "READLINE", f"FD:{self.shell.fileno()}"],
|
||||
pass_fds=[self.shell.fileno()],
|
||||
)
|
||||
|
||||
def succeed(self, *commands: str) -> str:
|
||||
"""Execute each command and check that it succeeds."""
|
||||
|
||||
Reference in New Issue
Block a user