Commit 13292cac authored by Corentin LABBE's avatar Corentin LABBE Committed by Paweł Wieczorek
Browse files

boot: detect error message in final phase

This commit adds error message detection in the final bootloader-commands action.

Closes: #308
parent d9d9785e
......@@ -960,7 +960,14 @@ class BootloaderCommandsAction(Action):
for (index, line) in enumerate(commands):
connection.sendline(line, delay=self.character_delay)
if index + 1 == len(commands):
if final_message and self.expect_final:
connection.prompt_str = final_message
if error_messages:
if isinstance(connection.prompt_str, str):
connection.prompt_str = [connection.prompt_str]
connection.prompt_str = connection.prompt_str + error_messages
res = self.wait(connection, max_end_time)
if res != 0:
msg = "matched a bootloader error message: '%s' (%d)" % (
......@@ -969,10 +976,6 @@ class BootloaderCommandsAction(Action):
raise InfrastructureError(msg)
if final_message and self.expect_final:
connection.prompt_str = [final_message]
self.wait(connection, max_end_time)
action="shared", label="shared", key="connection", value=connection
booti 0x84000000 0x88300000 0x88000000
Bad Linux RISCV Image magic!
......@@ -22,6 +22,7 @@ import os
import time
import pexpect
from lava_common.constants import KERNEL_FREE_INIT_MSG
from lava_common.exceptions import InfrastructureError
from lava_common.exceptions import JobError
from lava_dispatcher.action import Action
from lava_dispatcher.utils.messages import LinuxKernelMessages
......@@ -172,3 +173,12 @@ class TestBootMessages(StdoutTestCase):
results = LinuxKernelMessages.parse_failures(
connection, action=Action(), max_end_time=self.max_end_time, fail_msg=""
def test_kernel_5(self):
logfile = os.path.join(os.path.dirname(__file__), "kernel-5.txt")
child = pexpect.spawn("cat", [logfile])
message_list = LinuxKernelMessages.get_init_prompts()
connection = FakeConnection(child, message_list)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment