test/py: Add a helper to run a list of U-Boot commands
Some tests want to execute a sequence of commands. Add a helper for this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
This commit is contained in:
parent
9e17b0345a
commit
73a9054d0f
|
@ -216,6 +216,22 @@ class ConsoleBase(object):
|
||||||
self.cleanup_spawn()
|
self.cleanup_spawn()
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
def run_command_list(self, cmds):
|
||||||
|
"""Run a list of commands.
|
||||||
|
|
||||||
|
This is a helper function to call run_command() with default arguments
|
||||||
|
for each command in a list.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
cmd: List of commands (each a string)
|
||||||
|
Returns:
|
||||||
|
Combined output of all commands, as a string
|
||||||
|
"""
|
||||||
|
output = ''
|
||||||
|
for cmd in cmds:
|
||||||
|
output += self.run_command(cmd)
|
||||||
|
return output
|
||||||
|
|
||||||
def ctrlc(self):
|
def ctrlc(self):
|
||||||
"""Send a CTRL-C character to U-Boot.
|
"""Send a CTRL-C character to U-Boot.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue