mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-25 06:46:00 +00:00
test: Allow signaling that U-Boot is ready
When Labgrid is used, it can get U-Boot ready for running tests. It prints a message when it has done so. Add logic to detect this message and accept it. Note that this does not change pytest, which still (also) looks for the U-Boot banner. This change merely makes it possible for pytest to believe Labgrid when it says that the board is ready for use. In several cases, the board starts up and Labgrid receives some initial output, then pytest starts and misses some of that output, because it came in while Labgrid had the console open. Then pytest fails because it doesn't see the expected banners. With this change, Labgrid handles getting U-Boot to a prompt, in a fully reliable manner. Then pytest starts up and can simply start running its tests. But, again, this does not prevent pytest from handling a banner if one is provided (e.g. if not using the Labgrid integration). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
f9cfc47a83
commit
8344038a93
1 changed files with 5 additions and 4 deletions
|
@ -23,6 +23,7 @@ pattern_stop_autoboot_prompt = re.compile('Hit any key to stop autoboot: ')
|
|||
pattern_unknown_command = re.compile('Unknown command \'.*\' - try \'help\'')
|
||||
pattern_error_notification = re.compile('## Error: ')
|
||||
pattern_error_please_reset = re.compile('### ERROR ### Please RESET the board ###')
|
||||
pattern_ready_prompt = re.compile('U-Boot is ready')
|
||||
|
||||
PAT_ID = 0
|
||||
PAT_RE = 1
|
||||
|
@ -200,15 +201,15 @@ class ConsoleBase(object):
|
|||
self.bad_pattern_ids[m - 1])
|
||||
self.u_boot_version_string = self.p.after
|
||||
while True:
|
||||
m = self.p.expect([self.prompt_compiled,
|
||||
m = self.p.expect([self.prompt_compiled, pattern_ready_prompt,
|
||||
pattern_stop_autoboot_prompt] + self.bad_patterns)
|
||||
if m == 0:
|
||||
if m == 0 or m == 1:
|
||||
break
|
||||
if m == 1:
|
||||
if m == 2:
|
||||
self.p.send(' ')
|
||||
continue
|
||||
raise BootFail('Bad pattern found on console: ' +
|
||||
self.bad_pattern_ids[m - 2])
|
||||
self.bad_pattern_ids[m - 3])
|
||||
|
||||
finally:
|
||||
self.log.timestamp()
|
||||
|
|
Loading…
Add table
Reference in a new issue