Merge pull request #154804 from Mic92/tests-prompt

nixos/tests: add prompt to shell_interact()
This commit is contained in:
Lassulus
2022-02-02 18:50:46 +01:00
committed by GitHub

View File

@@ -543,11 +543,11 @@ 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 initial prompt):")
assert self.shell assert self.shell
subprocess.run( subprocess.run(
["socat", "READLINE", f"FD:{self.shell.fileno()}"], ["socat", "READLINE,prompt=$ ", f"FD:{self.shell.fileno()}"],
pass_fds=[self.shell.fileno()], pass_fds=[self.shell.fileno()],
) )