summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-07-03 09:40:42 -0600
committerTom Rini <trini@konsulko.com>2016-07-14 18:22:36 -0400
commit73a9054d0f33dc4612a13200c6f3af00d2a1fcda (patch)
tree2c9580136826321a7f74aa7e89e770c526ee2ade /test
parent9e17b0345afe198490689d9f36fab3849e9ef69a (diff)
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>
Diffstat (limited to 'test')
-rw-r--r--test/py/u_boot_console_base.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py
index 815fa64d5ff..b5aad7cb94a 100644
--- a/test/py/u_boot_console_base.py
+++ b/test/py/u_boot_console_base.py
@@ -216,6 +216,22 @@ class ConsoleBase(object):
self.cleanup_spawn()
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):
"""Send a CTRL-C character to U-Boot.