Skip to content

Commit

Permalink
[manuf] Verify ROM_EXT UDS cert after personalization
Browse files Browse the repository at this point in the history
This enhances the E2E perso flow test to verify that UDS certificate
is not invalid when the ROM_EXT first boots after personalization.

Signed-off-by: Anthony Chen <[email protected]>
(cherry picked from commit 79fdcc9)
  • Loading branch information
anthonychen1251 authored and timothytrippel committed Nov 19, 2024
1 parent e7b6d64 commit c5984f8
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions sw/host/provisioning/ft_lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,5 +498,30 @@ pub fn check_rom_ext_boot_up(
let uart_console = transport.uart("console")?;
let _ = UartConsole::wait_for(&*uart_console, r"Starting ROM_EXT.*\r\n", timeout)?;

// Timeout for waiting for a potential error message indicating invalid UDS certificate.
// This value is tested on fpga cw340 and could be potentially fine-tuned.
const UDS_CERT_INVALID_TIMEOUT: Duration = Duration::from_millis(200);

let result = UartConsole::wait_for(
&*uart_console,
r".*UDS certificate not valid.",
UDS_CERT_INVALID_TIMEOUT,
);

match result {
Ok(_captures) => {
// Error message found.
bail!("Invalid UDS certificate detected!");
}
Err(e) => {
if e.to_string().contains("Timed Out") {
// Error message not found after timeout. This is the expected behavior.
} else {
// An unexpected error occurred while waiting for the console output.
bail!(e);
}
}
}

Ok(())
}

0 comments on commit c5984f8

Please sign in to comment.