From 41d1d902d23ca8c835b1e47cfcea4d1d93025515 Mon Sep 17 00:00:00 2001 From: Chris Frantz Date: Fri, 17 Nov 2023 14:19:45 -0800 Subject: [PATCH] [bazel] Convert sigverify_key_validity to the new rules. Fixes: #20098 Signed-off-by: Chris Frantz --- .../silicon_creator/rom/e2e/empty_test.c | 4 ++- .../rom/e2e/sigverify_key_validity/BUILD | 36 ++++++------------- 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/sw/device/silicon_creator/rom/e2e/empty_test.c b/sw/device/silicon_creator/rom/e2e/empty_test.c index d631278fa0beba..6fe9fc045acf7d 100644 --- a/sw/device/silicon_creator/rom/e2e/empty_test.c +++ b/sw/device/silicon_creator/rom/e2e/empty_test.c @@ -4,14 +4,16 @@ #include -#include "sw/device/lib/runtime/log.h" #include "sw/device/lib/testing/test_framework/ottf_main.h" +#ifdef EMPTY_TEST_LOG +#include "sw/device/lib/runtime/log.h" #include "sw/device/silicon_creator/lib/drivers/lifecycle.h" #include "sw/device/silicon_creator/lib/drivers/otp.h" #include "sw/device/silicon_creator/lib/manifest_def.h" #include "sw/device/silicon_creator/lib/sigverify/spx_verify.h" #include "otp_ctrl_regs.h" +#endif OTTF_DEFINE_TEST_CONFIG(); diff --git a/sw/device/silicon_creator/rom/e2e/sigverify_key_validity/BUILD b/sw/device/silicon_creator/rom/e2e/sigverify_key_validity/BUILD index 246e6f7061dd95..785c1a8584eb4c 100644 --- a/sw/device/silicon_creator/rom/e2e/sigverify_key_validity/BUILD +++ b/sw/device/silicon_creator/rom/e2e/sigverify_key_validity/BUILD @@ -3,9 +3,9 @@ # SPDX-License-Identifier: Apache-2.0 load( - "//rules:opentitan_test.bzl", + "//rules/opentitan:defs.bzl", "cw310_params", - "opentitan_functest", + "opentitan_test", ) load( "//rules:const.bzl", @@ -75,30 +75,13 @@ otp_json( ] [ - bitstream_splice( - name = "bitstream_sigverify_key_validity_{}".format( - lc_state, - ), - src = "//hw/bitstream:rom_with_fake_keys", - data = ":otp_img_sigverify_key_validity_{}".format( - lc_state, - ), - meminfo = "//hw/bitstream:otp_mmi", - tags = maybe_skip_in_ci(lc_state_val), - update_usr_access = True, - visibility = ["//visibility:private"], - ) - for lc_state, lc_state_val in get_lc_items() -] - -[ - opentitan_functest( + opentitan_test( name = "sigverify_key_validity_{}_{}".format( lc_state, key.rsa.name, ), + srcs = ["//sw/device/silicon_creator/rom/e2e:empty_test"], cw310 = cw310_params( - bitstream = ":bitstream_sigverify_key_validity_{}".format(lc_state), exit_failure = MSG_PASS if lc_state_val != CONST.LCV.TEST_UNLOCKED0 else MSG_TEMPLATE_BFV_LCV.format( hex_digits(CONST.BFV.SIGVERIFY.BAD_RSA_KEY), hex_digits(lc_state_val), @@ -107,12 +90,15 @@ otp_json( hex_digits(CONST.BFV.SIGVERIFY.BAD_RSA_KEY), hex_digits(lc_state_val), ) if lc_state_val != CONST.LCV.TEST_UNLOCKED0 else MSG_PASS, + otp = ":otp_img_sigverify_key_validity_{}".format(lc_state), tags = maybe_skip_in_ci(lc_state_val), ), - key_struct = key, - ot_flash_binary = "//sw/device/silicon_creator/rom/e2e:empty_test_slot_a", - targets = [ - "cw310_rom_with_fake_keys", + exec_env = { + "//hw/top_earlgrey:fpga_cw310_rom_with_fake_keys": None, + }, + rsa_key = {key.rsa.label: key.rsa.name}, + deps = [ + "//sw/device/lib/testing/test_framework:ottf_main", ], ) for lc_state, lc_state_val in get_lc_items()