Skip to content

Commit 7003e3b

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

File tree

25 files changed

+124
-448
lines changed

25 files changed

+124
-448
lines changed

sw/device/lib/testing/test_framework/BUILD

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,6 @@ opentitan_test(
358358
fpga = fpga_params(
359359
flow_control_message = _FLOW_CONTROL_MESSAGE,
360360
test_cmd = """
361-
--exec="transport init"
362-
--exec="fpga load-bitstream {bitstream}"
363-
--exec="bootstrap --clear-uart=true {firmware}"
364361
--exec="console --non-interactive --exit-success=WAIT --exit-failure=PASS|FAIL --flow-control"
365362
console
366363
--flow-control

sw/device/silicon_creator/lib/drivers/BUILD

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -983,9 +983,6 @@ opentitan_test(
983983
EARLGREY_SILICON_OWNER_ROM_EXT_ENVS,
984984
),
985985
fpga = fpga_params(
986-
test_cmd = """
987-
--bootstrap={firmware}
988-
""",
989986
test_harness = "//sw/host/tests/chip/usb:silicon_creator_harness",
990987
),
991988
silicon = silicon_params(

sw/device/silicon_creator/lib/sigverify/sigverify_tests/BUILD

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ opentitan_test(
3131
fpga = fpga_params(
3232
timeout = "moderate",
3333
data = _TEST_VECTORS,
34-
test_cmd = """
35-
--bootstrap={firmware}
36-
""" + _TEST_ARGS,
34+
test_cmd = _TEST_ARGS,
3735
test_harness = "//sw/host/tests/crypto/ecdsa_kat:harness",
3836
),
3937
deps = [

sw/device/silicon_creator/manuf/base/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ opentitan_test(
147147
--test-sram-elf={sram_cp_provision_functest}
148148
""",
149149
test_harness = "//sw/host/tests/manuf/cp_provision_functest",
150+
testopt_bootstrap = "False",
150151
),
151152
)
152153

sw/device/silicon_creator/manuf/tests/BUILD

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,9 @@ _MANUF_TEST_LOCKED_KEY = None
8888
needs_jtag = True,
8989
otp = "//hw/ip/otp_ctrl/data:img_{}".format(lc_state.lower()),
9090
tags = ["manuf"],
91-
test_cmd = (
92-
"" if (
93-
(lc_state, lc_val) in _TEST_LOCKED_LC_ITEMS
94-
) else "--bootstrap={firmware}"
95-
) + " --initial-lc-state={lc_state}",
91+
test_cmd = "--initial-lc-state={lc_state}",
9692
test_harness = "//sw/host/tests/manuf/manuf_scrap",
93+
testopt_bootstrap = str((lc_state, lc_val) not in _TEST_LOCKED_LC_ITEMS),
9794
),
9895
deps = [
9996
"//sw/device/lib/runtime:log",
@@ -129,6 +126,7 @@ opentitan_test(
129126
otp = "//hw/ip/otp_ctrl/data:img_raw",
130127
tags = ["manuf"],
131128
test_harness = "//sw/host/tests/manuf/manuf_cp_unlock_raw",
129+
testopt_bootstrap = "False",
132130
),
133131
deps = [
134132
"//hw/ip/otp_ctrl/data:otp_ctrl_c_regs",
@@ -151,6 +149,7 @@ opentitan_test(
151149
otp = "//hw/ip/otp_ctrl/data:img_raw",
152150
tags = ["manuf"],
153151
test_harness = "//sw/host/tests/manuf/manuf_cp_volatile_unlock_raw",
152+
testopt_bootstrap = "False",
154153
),
155154
deps = [
156155
"//hw/ip/otp_ctrl/data:otp_ctrl_c_regs",
@@ -191,6 +190,7 @@ opentitan_test(
191190
tags = ["manuf"],
192191
test_cmd = "--initial-lc-state={lc_state}",
193192
test_harness = "//sw/host/tests/manuf/manuf_cp_yield_test",
193+
testopt_bootstrap = "False",
194194
),
195195
deps = [
196196
"//hw/ip/otp_ctrl/data:otp_ctrl_c_regs",
@@ -262,6 +262,7 @@ cc_library(
262262
tags = ["manuf"],
263263
test_cmd = "--elf={firmware}",
264264
test_harness = "//sw/host/tests/manuf/manuf_sram_program_crc_check",
265+
testopt_bootstrap = "False",
265266
),
266267
kind = "ram",
267268
linker_script = "//sw/device/silicon_creator/manuf/lib:sram_program_linker_script",
@@ -360,6 +361,7 @@ opentitan_binary(
360361
--elf={sram_program}
361362
""",
362363
test_harness = "//sw/host/tests/manuf/manuf_cp_device_info_flash_wr",
364+
testopt_bootstrap = "False",
363365
),
364366
spx_key = spx_key_for_lc_state(
365367
ECDSA_SPX_KEY_STRUCTS,
@@ -440,6 +442,7 @@ opentitan_binary(
440442
--elf={sram_program}
441443
""",
442444
test_harness = "//sw/host/tests/manuf/manuf_cp_ast_test_execution",
445+
testopt_bootstrap = "False",
443446
),
444447
deps = [
445448
"//sw/device/lib/runtime:log",
@@ -473,6 +476,7 @@ opentitan_test(
473476
otp = ":otp_img_otp_ctrl_functest",
474477
tags = ["manuf"],
475478
test_harness = "//sw/host/tests/manuf/manuf_cp_test_lock",
479+
testopt_bootstrap = "False",
476480
),
477481
deps = [
478482
"//hw/ip/otp_ctrl/data:otp_ctrl_c_regs",
@@ -501,6 +505,7 @@ opentitan_test(
501505
otp = ":otp_img_otp_ctrl_functest",
502506
tags = ["manuf"],
503507
test_harness = "//sw/host/tests/manuf/otp_ctrl:otp_ctrl",
508+
testopt_bootstrap = "False",
504509
),
505510
deps = [
506511
"//hw/ip/otp_ctrl/data:otp_ctrl_c_regs",
@@ -557,9 +562,6 @@ opentitan_test(
557562
},
558563
fpga = fpga_params(
559564
tags = ["manuf"],
560-
test_cmd = """
561-
--bootstrap={firmware}
562-
""",
563565
test_harness = "//sw/host/tests/manuf/manuf_ujson_msg_size",
564566
),
565567
deps = [
@@ -579,9 +581,6 @@ opentitan_test(
579581
},
580582
fpga = fpga_params(
581583
tags = ["manuf"],
582-
test_cmd = """
583-
--bootstrap={firmware}
584-
""",
585584
test_harness = "//sw/host/tests/manuf/manuf_ujson_msg_padding",
586585
),
587586
deps = [

sw/device/silicon_creator/rom/BUILD

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,9 +554,6 @@ opentitan_test(
554554
# This is a manual test. Run it with:
555555
# --test_output=streamed --copt=-DSTACK_UTILIZATION_CHECK
556556
###########################################################################'"
557-
--exec="transport init"
558-
--exec="fpga load-bitstream {bitstream}"
559-
560557
--exec="no-op --info '### Measuring stack utilization for bootstrap slot A'"
561558
--exec="bootstrap --clear-uart=true --leave-in-bootstrap {good_a}"
562559
--exec="console --non-interactive --exit-success='{stack_usage}' --exit-failure='{exit_failure}'"
@@ -598,6 +595,7 @@ opentitan_test(
598595
--exec="console --non-interactive --exit-success='{stack_usage}' --exit-failure='PASS|FAIL'"
599596
no-op
600597
""",
598+
testopt_bootstrap = "False",
601599
),
602600
exec_env = {
603601
"//hw/top_earlgrey:fpga_cw310_rom_with_fake_keys": None,

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/bootstrap/BUILD

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ opentitan_test(
7777
changes_otp = True,
7878
needs_jtag = True,
7979
otp = "otp_img_bootstrap_rma",
80-
test_cmd = """
81-
--bootstrap="{firmware}"
82-
""",
8380
test_harness = "//sw/host/tests/rom/e2e_bootstrap_rma",
8481
),
8582
deps = [
@@ -105,6 +102,7 @@ opentitan_test(
105102
},
106103
otp = "//hw/ip/otp_ctrl/data:img_bootstrap_disabled",
107104
test_harness = "//sw/host/tests/rom/e2e_bootstrap_disabled",
105+
testopt_bootstrap = "False",
108106
),
109107
manifest = None,
110108
)

sw/device/silicon_creator/rom/e2e/chip_specific_startup/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ package(default_visibility = ["//visibility:public"])
3030
otp = "//sw/device/silicon_creator/rom/e2e/rom_e2e_bootstrap_entry:otp_img_e2e_bootstrap_entry_{}".format(lc_state),
3131
tags = maybe_skip_in_ci(lc_state_val),
3232
test_cmd = """
33-
--bootstrap="{firmware}"
3433
--otp-unprogrammed
3534
""",
3635
test_harness = "//sw/host/tests/rom/e2e_chip_specific_startup",

sw/device/silicon_creator/rom/e2e/jtag_inject/BUILD

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ package(default_visibility = ["//visibility:public"])
5555
--elf={sram_program}
5656
""",
5757
test_harness = "//sw/host/tests/chip/jtag:sram_load",
58+
testopt_bootstrap = "False",
5859
),
5960
deps = [
6061
"//sw/device/lib/runtime:log",
@@ -96,6 +97,7 @@ test_suite(
9697
otp = ":img_{}_exec_disabled".format(lc_state),
9798
test_cmd = " --elf={rom:elf}",
9899
test_harness = "//sw/host/tests/rom/e2e_openocd_debug_test:asm_interrupt_handler",
100+
testopt_bootstrap = "False",
99101
),
100102
deps = [
101103
"//sw/device/lib/runtime:log",
@@ -137,6 +139,7 @@ test_suite(
137139
otp = ":img_{}_exec_disabled".format(lc_state),
138140
test_cmd = " --elf={rom:elf}",
139141
test_harness = "//sw/host/tests/rom/e2e_openocd_debug_test:shutdown_execution_asm",
142+
testopt_bootstrap = "False",
140143
),
141144
deps = [
142145
"//sw/device/lib/runtime:log",
@@ -179,6 +182,7 @@ test_suite(
179182
tags = ["broken"],
180183
test_cmd = " --elf={rom:elf}",
181184
test_harness = "//sw/host/tests/rom/e2e_openocd_debug_test:asm_watchdog_bark",
185+
testopt_bootstrap = "False",
182186
),
183187
deps = [
184188
"//sw/device/lib/runtime:log",
@@ -221,6 +225,7 @@ test_suite(
221225
tags = ["broken"],
222226
test_cmd = " --elf={rom:elf}",
223227
test_harness = "//sw/host/tests/rom/e2e_openocd_debug_test:asm_watchdog_bite",
228+
testopt_bootstrap = "False",
224229
),
225230
deps = [
226231
"//sw/device/lib/runtime:log",
@@ -269,6 +274,7 @@ LC_STATES_DEBUG_DISALLOWED = [
269274
otp = ":img_{}_exec_disabled".format(lc_state),
270275
test_cmd = " --elf={rom:elf}" + (" --expect-fail" if lc_state_val in LC_STATES_DEBUG_DISALLOWED else " "),
271276
test_harness = "//sw/host/tests/rom/e2e_openocd_debug_test:debug_test",
277+
testopt_bootstrap = "False",
272278
),
273279
deps = [
274280
"//sw/device/lib/runtime:log",

0 commit comments

Comments
 (0)