Skip to content

Commit cd24921

Browse files
committed
[bazel,test] Apply new testopt to tests
Change-Id: Ic05c77684e2d7577bcd328872a230d396035847d Signed-off-by: Yi-Hsuan Deng <[email protected]>
1 parent a3e47b4 commit cd24921

File tree

3 files changed

+9
-28
lines changed
  • sw/device/silicon_creator/rom/e2e

3 files changed

+9
-28
lines changed

sw/device/silicon_creator/rom/e2e/BUILD

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -458,14 +458,7 @@ opentitan_test(
458458
exit_success = "min_security_version_rom_ext:0(?s:.*)min_security_version_rom_ext:1(?s:.*)" + MSG_TEMPLATE_BFV.format(hex_digits(CONST.BFV.BOOT_POLICY.ROLLBACK)),
459459
# We clear the bitstream to force any subsequent test to load a
460460
# fresh bitstream and clear all memories (ie: flash-based boot policy).
461-
test_cmd = """
462-
--exec="transport init"
463-
--exec="fpga load-bitstream {bitstream}"
464-
--exec="bootstrap --clear-uart=true {firmware}"
465-
--exec="console --non-interactive --exit-success='{exit_success}' --exit-failure='{exit_failure}'"
466-
--exec="fpga clear-bitstream\"
467-
no-op
468-
""",
461+
testopt_clear_after_test = "True",
469462
),
470463
linker_script = "//sw/device/lib/testing/test_framework:ottf_ld_silicon_creator_slot_a",
471464
deps = [

sw/device/silicon_creator/rom/e2e/reset_reason/BUILD

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ RESET_CORRUPTION_SCENARIOS = [
6767
"otp": 0,
6868
"exit_success": DEFAULT_TEST_SUCCESS_MSG,
6969
"exit_failure": DEFAULT_TEST_FAILURE_MSG,
70-
"test_cmd": "",
70+
"testopt_bootstrap": "True",
7171
},
7272
{
7373
"name": "check_disabled_no_fault",
7474
"otp": CONST.HARDENED_FALSE << 16 | CONST.HARDENED_FALSE,
7575
"exit_success": DEFAULT_TEST_SUCCESS_MSG,
7676
"exit_failure": DEFAULT_TEST_FAILURE_MSG,
77-
"test_cmd": "",
77+
"testopt_bootstrap": "True",
7878
},
7979
{
8080
"name": "check_disabled_with_fault",
@@ -84,14 +84,14 @@ RESET_CORRUPTION_SCENARIOS = [
8484
"otp": CONST.HARDENED_FALSE << 16 | 0,
8585
"exit_success": DEFAULT_TEST_SUCCESS_MSG,
8686
"exit_failure": DEFAULT_TEST_FAILURE_MSG,
87-
"test_cmd": "",
87+
"testopt_bootstrap": "True",
8888
},
8989
{
9090
"name": "check_enabled_no_fault",
9191
"otp": CONST.HARDENED_TRUE << 16 | CONST.HARDENED_TRUE,
9292
"exit_success": DEFAULT_TEST_SUCCESS_MSG,
9393
"exit_failure": DEFAULT_TEST_FAILURE_MSG,
94-
"test_cmd": "",
94+
"testopt_bootstrap": "True",
9595
},
9696
{
9797
"name": "check_enabled_with_fault",
@@ -104,12 +104,7 @@ RESET_CORRUPTION_SCENARIOS = [
104104
"exit_failure": DEFAULT_TEST_SUCCESS_MSG,
105105
# This test will fault before bootstrap straps are read, so simply
106106
# start the console and look for the fault message.
107-
"test_cmd": """
108-
--exec="transport init"
109-
--exec="fpga load-bitstream {bitstream}"
110-
--exec="console --non-interactive --exit-success='{exit_success}' --exit-failure='{exit_failure}'"
111-
no-op
112-
""",
107+
"testopt_bootstrap": "False",
113108
},
114109
]
115110

@@ -150,7 +145,7 @@ RESET_CORRUPTION_SCENARIOS = [
150145
exit_failure = t["exit_failure"],
151146
exit_success = t["exit_success"],
152147
otp = ":otp_img_reset_reason_{}".format(t["name"]),
153-
test_cmd = t["test_cmd"],
148+
testopt_bootstrap = t["testopt_bootstrap"],
154149
),
155150
deps = [
156151
"//sw/device/lib/testing/test_framework:ottf_main",

sw/device/silicon_creator/rom/e2e/rom_ext_upgrade_interrupt/BUILD

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,8 @@ otp_json(
7272
fpga = fpga_params(
7373
otp = ":otp_img_rom_ext_upgrade_interrupt_{}".format(lc_state),
7474
tags = maybe_skip_in_ci(lc_state_val),
75-
test_cmd = """
76-
--exec="transport init"
77-
--exec="fpga clear-bitstream"
78-
--exec="fpga load-bitstream {bitstream}"
79-
--exec="bootstrap --clear-uart=true {firmware}"
80-
--exec="console --non-interactive --exit-success='{exit_success}' --exit-failure='{exit_failure}'"
81-
--exec="fpga clear-bitstream"
82-
no-op
83-
""",
75+
testopt_clear_after_test = "True",
76+
testopt_clear_before_test = "True",
8477
),
8578
manifest = ":manifest_rom_ext_upgrade_interrupt",
8679
deps = [

0 commit comments

Comments
 (0)