]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - test/py/u_boot_console_base.py
test/py: Add a helper to run a list of U-Boot commands
[karo-tx-uboot.git] / test / py / u_boot_console_base.py
index 815fa64d5ff344ba7dc6470e714862d6f59c568c..b5aad7cb94ad6a876aac51164fdc5e45b4632c0d 100644 (file)
@@ -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.