diff mbox series

[styhead] arm/lib: Relax "Listening for serial connection" regex

Message ID 20241218102304.3034598-1-peter.hoyes@arm.com
State New
Headers show
Series [styhead] arm/lib: Relax "Listening for serial connection" regex | expand

Commit Message

Peter Hoyes Dec. 18, 2024, 10:23 a.m. UTC
Newer versions of the FVP now contain a full log entry for the
"Listening for serial connection on port" regex of the form:

INFO: FVP_NAME: terminal_uart: Listening for serial connection...

Relax the regex to support this new logging format and change from
re.match to re.search as the regex may not appear at the start of the
line.

This change is backwards-compatible with older versions of the FVP.

Signed-off-by: Peter Hoyes <peter.hoyes@arm.com>
---
 meta-arm/lib/fvp/runner.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jon Mason Dec. 23, 2024, 5:45 a.m. UTC | #1
On Wed, 18 Dec 2024 10:23:04 +0000, Peter Hoyes wrote:
> Newer versions of the FVP now contain a full log entry for the
> "Listening for serial connection on port" regex of the form:
> 
> INFO: FVP_NAME: terminal_uart: Listening for serial connection...
> 
> Relax the regex to support this new logging format and change from
> re.match to re.search as the regex may not appear at the start of the
> line.
> 
> [...]

Applied, thanks!

[1/1] arm/lib: Relax "Listening for serial connection" regex
      commit: 5adb3155179b1b618a4c59911ada7659e1bee619

Best regards,
diff mbox series

Patch

diff --git a/meta-arm/lib/fvp/runner.py b/meta-arm/lib/fvp/runner.py
index 4e414e99..8dba545a 100644
--- a/meta-arm/lib/fvp/runner.py
+++ b/meta-arm/lib/fvp/runner.py
@@ -57,7 +57,7 @@  class ConsolePortParser:
         while True:
             try:
                 line = next(self._lines).strip().decode(errors='ignore')
-                m = re.match(r"^(\S+): Listening for serial connection on port (\d+)$", line)
+                m = re.search(r"(\S+): Listening for serial connection on port (\d+)$", line)
                 if m:
                     matched_console = m.group(1)
                     matched_port = int(m.group(2))