test/py: Add an option to execute a string containing a command
It is sometimes inconvenient to convert a string into a list for execution with run_and_log(). Provide a helper function to do this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
This commit is contained in:
parent
f3d3e95ce5
commit
8b304a37df
|
@ -173,6 +173,18 @@ def run_and_log(u_boot_console, cmd, ignore_errors=False):
|
||||||
runner.close()
|
runner.close()
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
def cmd(u_boot_console, cmd_str):
|
||||||
|
"""Run a single command string and log its output.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
u_boot_console: A console connection to U-Boot.
|
||||||
|
cmd: The command to run, as a string.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The output as a string.
|
||||||
|
"""
|
||||||
|
return run_and_log(u_boot_console, cmd_str.split())
|
||||||
|
|
||||||
ram_base = None
|
ram_base = None
|
||||||
def find_ram_base(u_boot_console):
|
def find_ram_base(u_boot_console):
|
||||||
"""Find the running U-Boot's RAM location.
|
"""Find the running U-Boot's RAM location.
|
||||||
|
|
Loading…
Reference in New Issue