X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=test%2Fpy%2Fu_boot_console_base.py;h=4606ad48bf5d49d7c90c2ade5418347f08b577bf;hb=ebe621d5fb2f5c15aff50e0610372f2751fd152f;hp=815fa64d5ff344ba7dc6470e714862d6f59c568c;hpb=87861c1970d9e1c475e62304b8e249aa3edf8c39;p=platform%2Fkernel%2Fu-boot.git diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py index 815fa64..4606ad4 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. @@ -329,7 +345,7 @@ class ConsoleBase(object): m = self.p.expect([pattern_u_boot_spl_signon] + self.bad_patterns) if m != 0: - raise Exception('Bad pattern found on console: ' + + raise Exception('Bad pattern found on SPL console: ' + self.bad_pattern_ids[m - 1]) m = self.p.expect([pattern_u_boot_main_signon] + self.bad_patterns) if m != 0: @@ -377,6 +393,16 @@ class ConsoleBase(object): pass self.p = None + def get_spawn_output(self): + """Return the start-up output from U-Boot + + Returns: + The output produced by ensure_spawed(), as a string. + """ + if self.p: + return self.p.get_expect_output() + return None + def validate_version_string_in_text(self, text): """Assert that a command's output includes the U-Boot signon message.