Skip to content

Commit

Permalink
[sw,e2e] Detect boot failure in provisioning e2e test
Browse files Browse the repository at this point in the history
This commit adds the BFV boot failure message to the test regex, which should
catch the error reported in PR 26452.

Change-Id: Ib0db4ebb477bee613b972c651dc6aceef4f5d3f2
Signed-off-by: Yi-Hsuan Deng <[email protected]>
  • Loading branch information
sasdf authored and timothytrippel committed Mar 5, 2025
1 parent 5095b45 commit a02c1b4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions sw/host/provisioning/ft_lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,8 @@ pub fn check_slot_b_boot_up(
// //sw/device/silicon_creator/lib/cert/dice_chain.c.
let rom_ext_failure_msg = r"UDS certificate not valid";

let error_code_msg = r"BFV:.*\r\n";

let anchor_text = if let Some(owner_anchor) = &owner_fw_success_string {
let full_owner_anchor = if response.seeds.number != 0 {
let seed0 = response.seeds.seed[0].as_slice();
Expand Down Expand Up @@ -630,9 +632,12 @@ pub fn check_slot_b_boot_up(
(*owner_anchor).clone()
};

format!(r"(?s)({}|{})", rom_ext_failure_msg, full_owner_anchor)
format!(
r"(?s)({}|{}|{})",
rom_ext_failure_msg, error_code_msg, full_owner_anchor
)
} else {
rom_ext_failure_msg.to_string()
format!(r"(?s)({}|{})", rom_ext_failure_msg, error_code_msg)
};

let result =
Expand All @@ -641,9 +646,11 @@ pub fn check_slot_b_boot_up(
match result {
Ok(captures) => {
if captures[0] == *rom_ext_failure_msg {
// Error message found.
bail!("Invalid UDS certificate detected!");
}
if captures[0].starts_with("BFV:") {
bail!("Error detected!");
}
}
Err(e) => {
if owner_fw_success_string.is_none() && e.to_string().contains("Timed Out") {
Expand Down

0 comments on commit a02c1b4

Please sign in to comment.