Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <bst@pengutronix.de>
- Loading branch information