forked from mirrors/nixpkgs
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:
parent
a95eebd1cd
commit
48aec70ea1
|
@ -462,9 +462,10 @@ class Machine:
|
||||||
Should only be used during test development, not in the production test."""
|
Should only be used during test development, not in the production test."""
|
||||||
self.connect()
|
self.connect()
|
||||||
self.log("Terminal is ready (there is no prompt):")
|
self.log("Terminal is ready (there is no prompt):")
|
||||||
telnet = telnetlib.Telnet()
|
subprocess.run(
|
||||||
telnet.sock = self.shell # type: ignore
|
["socat", "READLINE", f"FD:{self.shell.fileno()}"],
|
||||||
telnet.interact()
|
pass_fds=[self.shell.fileno()],
|
||||||
|
)
|
||||||
|
|
||||||
def succeed(self, *commands: str) -> str:
|
def succeed(self, *commands: str) -> str:
|
||||||
"""Execute each command and check that it succeeds."""
|
"""Execute each command and check that it succeeds."""
|
||||||
|
|
|
@ -64,7 +64,7 @@ rec {
|
||||||
|
|
||||||
wrapProgram $out/bin/nixos-test-driver \
|
wrapProgram $out/bin/nixos-test-driver \
|
||||||
--argv0 ${name} \
|
--argv0 ${name} \
|
||||||
--prefix PATH : "${lib.makeBinPath [ qemu_pkg vde2 netpbm coreutils ]}" \
|
--prefix PATH : "${lib.makeBinPath [ qemu_pkg vde2 netpbm coreutils socat ]}" \
|
||||||
${lib.optionalString enableOCR
|
${lib.optionalString enableOCR
|
||||||
"--prefix PATH : '${ocrProg}/bin:${imagemagick_tiff}/bin'"} \
|
"--prefix PATH : '${ocrProg}/bin:${imagemagick_tiff}/bin'"} \
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue