From 51ff0a89f169bbf8e06acb49b31db555e99fefb6 Mon Sep 17 00:00:00 2001 From: Nick Quarton <139178705+nquarton@users.noreply.github.com> Date: Fri, 19 Jul 2024 09:41:46 -0700 Subject: [PATCH] Changing FIPS tests expected ROM to 1_0_1 for 1.0 nightly testing --- .github/workflows/fpga.yml | 1 + .github/workflows/fw-test-emu.yml | 1 + runtime/tests/runtime_integration_tests/test_boot.rs | 7 ++++--- runtime/tests/runtime_integration_tests/test_fips.rs | 10 +++++++--- test/tests/fips_test_suite/services.rs | 3 --- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/fpga.yml b/.github/workflows/fpga.yml index ff359795a1..84c84388b1 100644 --- a/.github/workflows/fpga.yml +++ b/.github/workflows/fpga.yml @@ -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 diff --git a/.github/workflows/fw-test-emu.yml b/.github/workflows/fw-test-emu.yml index 6ef6609823..06fdfca5df 100644 --- a/.github/workflows/fw-test-emu.yml +++ b/.github/workflows/fw-test-emu.yml @@ -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 diff --git a/runtime/tests/runtime_integration_tests/test_boot.rs b/runtime/tests/runtime_integration_tests/test_boot.rs index c5f4bb818b..5ffdb27caa 100644 --- a/runtime/tests/runtime_integration_tests/test_boot.rs +++ b/runtime/tests/runtime_integration_tests/test_boot.rs @@ -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}, @@ -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); } diff --git a/runtime/tests/runtime_integration_tests/test_fips.rs b/runtime/tests/runtime_integration_tests/test_fips.rs index a8756aa8bc..16108c4392 100644 --- a/runtime/tests/runtime_integration_tests/test_fips.rs +++ b/runtime/tests/runtime_integration_tests/test_fips.rs @@ -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, diff --git a/test/tests/fips_test_suite/services.rs b/test/tests/fips_test_suite/services.rs index ff4105686c..e05788902c 100755 --- a/test/tests/fips_test_suite/services.rs +++ b/test/tests/fips_test_suite/services.rs @@ -45,9 +45,6 @@ pub fn exec_cmd_version(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 =