Commit 1dbd699
committed
driver/sshdriver: redirect /dev/null to stdin on run()
By default, no redirection will occur. That means a command run on the
target consumes the stdin of our process. That is especially unfortunate
if we expect interactive input, such as for the ManualPowerDriver,
ManualSwitchDriver or in a REPL:
shell.run_check("sleep 100 &")
pidfile = "/tmp/pidfile"
shell.run_check(f"pgrep sleep > {pidfile}")
try:
ssh.run(f"pwait --pidfile {pidfile}", timeout=1)
except:
from IPython import embed
embed()
This example shows that not all input reaches the IPython REPL.
Fix this by redirecting /dev/null to stdin, so the command run via SSH
do not receive unexpected input and do not compete over it.
Signed-off-by: Bastian Krause <[email protected]>1 parent a3c068f commit 1dbd699
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| |||
0 commit comments