git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #127763 from Mic92/test-driver-shell

nixos/test-driver: replace termlib with socat

commit243f958b402bdd9988bcddb9c47a87f7d3217747 authorJacek Galowicz <jacek@galowicz.de> dateTue 22 Jun 2021, 10:32 (5 years ago) parent5f44b4248aec70
2 files changed+5−4
nixos/lib/test-driver/test-driver.py+4−3 nixos/lib/testing-python.nix+1−1
nixos/lib/test-driver/test-driver.py+4−3
@@ -462,9 +462,10 @@ class Machine:
462462 Should only be used during test development, not in the production test."""
463463 self.connect()
464464 self.log("Terminal is ready (there is no prompt):")
465− telnet = telnetlib.Telnet()
466− telnet.sock = self.shell # type: ignore
467− telnet.interact()
465+ subprocess.run(
466+ ["socat", "READLINE", f"FD:{self.shell.fileno()}"],
467+ pass_fds=[self.shell.fileno()],
468+ )
468469
469470 def succeed(self, *commands: str) -> str:
470471 """Execute each command and check that it succeeds."""
nixos/lib/testing-python.nix+1−1
@@ -64,7 +64,7 @@ rec {
6464
6565 wrapProgram $out/bin/nixos-test-driver \
6666 --argv0 ${name} \
67− --prefix PATH : "${lib.makeBinPath [ qemu_pkg vde2 netpbm coreutils ]}" \
67+ --prefix PATH : "${lib.makeBinPath [ qemu_pkg vde2 netpbm coreutils socat ]}" \
6868 ${lib.optionalString enableOCR
6969 "--prefix PATH : '${ocrProg}/bin:${imagemagick_tiff}/bin'"} \
7070