Skip to content

Commit

Permalink
Changing FIPS tests expected ROM to 1_0_1 for 1.0 nightly testing
Browse files Browse the repository at this point in the history
  • Loading branch information
nquarton authored and jhand2 committed Jul 19, 2024
1 parent 089266b commit 51ff0a8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/fpga.yml
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ jobs:
if [[ "${{ inputs.workflow_call }}" && "${{ inputs.hw-version }}" != "latest" ]]; then
VARS+=" FIPS_TEST_HW_EXP_VERSION=1_0_0"
VARS+=" FIPS_TEST_ROM_EXP_VERSION=1_0_1"
fi
if [ "${{ inputs.rom-logging }}" == "true" ] || [ -z "${{ inputs.rom-logging }}" ]; then
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/fw-test-emu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
if [[ ${{ inputs.extra-features }} == *"hw-1.0"* ]]; then
export FIPS_TEST_HW_EXP_VERSION=1_0_0
export FIPS_TEST_ROM_EXP_VERSION=1_0_1
fi
# Workaround https://github.com/nextest-rs/nextest/issues/267
Expand Down
7 changes: 4 additions & 3 deletions runtime/tests/runtime_integration_tests/test_boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use caliptra_builder::{
firmware::{self, APP_WITH_UART, FMC_WITH_UART},
version, ImageOptions,
ImageOptions,
};
use caliptra_common::{
mailbox_api::{CommandId, MailboxReq, MailboxReqHeader, StashMeasurementReq},
Expand Down Expand Up @@ -52,9 +52,10 @@ fn test_fw_version() {

let fw_rev = model.soc_ifc().cptra_fw_rev_id().read();
// fw_rev[0] is FMC version at 31:16 and ROM version at 15:0
// Ignore ROM version since this test is for runtime
assert_eq!(
fw_rev[0],
((DEFAULT_FMC_VERSION as u32) << 16) | (version::get_rom_version() as u32)
fw_rev[0] & 0xFFFF0000, // Mask out the ROM version
(DEFAULT_FMC_VERSION as u32) << 16
);
assert_eq!(fw_rev[1], DEFAULT_APP_VERSION);
}
Expand Down
10 changes: 7 additions & 3 deletions runtime/tests/runtime_integration_tests/test_fips.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ fn test_fips_version() {
);
assert_eq!(fips_version.mode, FipsVersionCmd::MODE);
// fw_rev[0] is FMC version at 31:16 and ROM version at 15:0
let fw_version_0_expected =
((version::get_fmc_version() as u32) << 16) | (version::get_rom_version() as u32);
// Ignore ROM version since this test is for runtime
let fw_version_0_expected = (version::get_fmc_version() as u32) << 16;
assert_eq!(
fips_version.fips_rev,
[
fips_version.fips_rev[0],
fips_version.fips_rev[1] & 0xFFFF0000, // Mask out the ROM version
fips_version.fips_rev[2],
],
[
HW_REV_ID,
fw_version_0_expected,
Expand Down
3 changes: 0 additions & 3 deletions test/tests/fips_test_suite/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ pub fn exec_cmd_version<T: HwModel>(hw: &mut T, fmc_version: u16, app_version: u
)
.unwrap();

println!("Expecting app version of {}", app_version);
println!("Received version of of {:?}", version_resp.fips_rev);

// Verify command-specific response data
assert_eq!(version_resp.mode, FipsVersionCmd::MODE);
let fw_version_0_expected =
Expand Down

0 comments on commit 51ff0a8

Please sign in to comment.