mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 21:21:37 +00:00
test/py: capture the entire U-Boot version at boot
The existing regex simply ensures that the captured version string doesn't go past the end of a line. We really want to grab as much as possible. Do this by explicitly including a ) character at the end of the regex to match the last character of the version test. Signed-off-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
parent
d8926811fd
commit
c82ce04a3f
1 changed files with 3 additions and 8 deletions
|
@ -17,8 +17,8 @@ import sys
|
||||||
import u_boot_spawn
|
import u_boot_spawn
|
||||||
|
|
||||||
# Regexes for text we expect U-Boot to send to the console.
|
# Regexes for text we expect U-Boot to send to the console.
|
||||||
pattern_u_boot_spl_signon = re.compile('(U-Boot SPL \\d{4}\\.\\d{2}-[^\r\n]*)')
|
pattern_u_boot_spl_signon = re.compile('(U-Boot SPL \\d{4}\\.\\d{2}[^\r\n]*\\))')
|
||||||
pattern_u_boot_main_signon = re.compile('(U-Boot \\d{4}\\.\\d{2}-[^\r\n]*)')
|
pattern_u_boot_main_signon = re.compile('(U-Boot \\d{4}\\.\\d{2}[^\r\n]*\\))')
|
||||||
pattern_stop_autoboot_prompt = re.compile('Hit any key to stop autoboot: ')
|
pattern_stop_autoboot_prompt = re.compile('Hit any key to stop autoboot: ')
|
||||||
pattern_unknown_command = re.compile('Unknown command \'.*\' - try \'help\'')
|
pattern_unknown_command = re.compile('Unknown command \'.*\' - try \'help\'')
|
||||||
pattern_error_notification = re.compile('## Error: ')
|
pattern_error_notification = re.compile('## Error: ')
|
||||||
|
@ -312,12 +312,7 @@ class ConsoleBase(object):
|
||||||
if m != 0:
|
if m != 0:
|
||||||
raise Exception('Bad pattern found on console: ' +
|
raise Exception('Bad pattern found on console: ' +
|
||||||
self.bad_pattern_ids[m - 1])
|
self.bad_pattern_ids[m - 1])
|
||||||
signon = self.p.after
|
self.u_boot_version_string = self.p.after
|
||||||
build_idx = signon.find(', Build:')
|
|
||||||
if build_idx == -1:
|
|
||||||
self.u_boot_version_string = signon
|
|
||||||
else:
|
|
||||||
self.u_boot_version_string = signon[:build_idx]
|
|
||||||
while True:
|
while True:
|
||||||
m = self.p.expect([self.prompt_escaped,
|
m = self.p.expect([self.prompt_escaped,
|
||||||
pattern_stop_autoboot_prompt] + self.bad_patterns)
|
pattern_stop_autoboot_prompt] + self.bad_patterns)
|
||||||
|
|
Loading…
Add table
Reference in a new issue