diff options
author | Tom Rini <trini@konsulko.com> | 2021-11-28 20:38:01 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-11-28 20:38:13 -0500 |
commit | c087b5ad974441d1408c028eb7087d86b6d127e9 (patch) | |
tree | 1d5efba0d146dcd1a6a449963ea738cc6e4ff73e /test/py/u_boot_utils.py | |
parent | 1943f2a2a7c58b76812fcad2d3012036af7464ce (diff) | |
parent | 452e8c9086a9f95739582da5ccc2130e4bf1ae8b (diff) |
Merge tag 'dm-pull-28nov21' of https://source.denx.de/u-boot/custodians/u-boot-dm into next
SPI flash documentation and tidy-ups
Various driver model enhancements
Fix up some missing unit tests with pytest
Diffstat (limited to 'test/py/u_boot_utils.py')
-rw-r--r-- | test/py/u_boot_utils.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/py/u_boot_utils.py b/test/py/u_boot_utils.py index e816c7fbb6..f44442e0c7 100644 --- a/test/py/u_boot_utils.py +++ b/test/py/u_boot_utils.py @@ -154,7 +154,7 @@ def wait_until_file_open_fails(fn, ignore_errors): return raise Exception('File can still be opened') -def run_and_log(u_boot_console, cmd, ignore_errors=False): +def run_and_log(u_boot_console, cmd, ignore_errors=False, stdin=None): """Run a command and log its output. Args: @@ -166,6 +166,7 @@ def run_and_log(u_boot_console, cmd, ignore_errors=False): will simply return if the command cannot be executed or exits with an error code, otherwise an exception will be raised if such problems occur. + stdin: Input string to pass to the command as stdin (or None) Returns: The output as a string. @@ -173,7 +174,7 @@ def run_and_log(u_boot_console, cmd, ignore_errors=False): if isinstance(cmd, str): cmd = cmd.split() runner = u_boot_console.log.get_runner(cmd[0], sys.stdout) - output = runner.run(cmd, ignore_errors=ignore_errors) + output = runner.run(cmd, ignore_errors=ignore_errors, stdin=stdin) runner.close() return output |