Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sw/device/lib/testing/json/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ cc_library(
name = "provisioning_data",
srcs = ["provisioning_data.c"],
hdrs = ["provisioning_data.h"],
# Instrumenting this module consumes about 29K RAM.
features = ["-coverage"],
deps = ["//sw/device/lib/ujson"],
)

Expand Down
3 changes: 3 additions & 0 deletions sw/device/silicon_creator/manuf/base/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ opentitan_binary(
name = "sram_cp_provision",
testonly = True,
srcs = ["sram_cp_provision.c"],
collect_code_coverage = 0,
exec_env = {
"//hw/top_earlgrey:sim_qemu_rom_with_fake_keys": None,
"//hw/top_earlgrey:fpga_hyper310_rom_with_fake_keys": None,
Expand Down Expand Up @@ -91,6 +92,7 @@ opentitan_binary(
name = "sram_cp_provision_functest",
testonly = True,
srcs = ["sram_cp_provision_functest.c"],
collect_code_coverage = 0,
exec_env = {
"//hw/top_earlgrey:sim_qemu_rom_with_fake_keys": None,
"//hw/top_earlgrey:fpga_hyper310_rom_with_fake_keys": None,
Expand Down Expand Up @@ -188,6 +190,7 @@ opentitan_test(
name = "sram_ft_individualize_{}{}".format(sku, variant),
testonly = True,
srcs = ["sram_ft_individualize.c"],
collect_code_coverage = 0,
exec_env = {
"//hw/top_earlgrey:fpga_hyper310_rom_with_fake_keys": None,
"//hw/top_earlgrey:fpga_cw340_rom_with_fake_keys": None,
Expand Down
4 changes: 4 additions & 0 deletions sw/host/provisioning/ft_lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,10 @@ pub fn run_ft_personalize(
response
.stats
.log_elapsed_time("second-bootstrap-done", second_t0);

#[cfg(feature = "ot_coverage_enabled")]
let _ = UartConsole::wait_for_coverage(spi_console, Duration::from_secs(10));

Ok(())
}

Expand Down
6 changes: 6 additions & 0 deletions sw/host/provisioning/orchestrator/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,16 @@ sh_test(
":orchestrator_{}_zip".format(fpga),
"@python3",
cfg["orchestrator_cfg"],
cfg["owner_fw"],
cfg["rom_ext"],
"//sw/host/provisioning/orchestrator/src:data_dependencies",
"//util/coverage/collect_cc_coverage",
],
env = {
"PYTHON": "$(location @python3//:python3)",
"SKU_CONFIG_PATH": "$(location {})".format(cfg["orchestrator_cfg"]),
"COLLECT_CC_COVERAGE": "$(location //util/coverage/collect_cc_coverage)",
"CC_CODE_COVERAGE_SCRIPT": "", # Disable built-in cc coverage
"FPGA": "{}".format(fpga),
},
tags = [
Expand Down
39 changes: 24 additions & 15 deletions sw/host/provisioning/orchestrator/tests/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,28 @@ cp sw/host/provisioning/orchestrator/src/orchestrator.zip $TEST_TMPDIR

ORCHESTRATOR_PATH=$TEST_TMPDIR/orchestrator.zip

# This script is run by a Bazel sh_test rule, which sets RUNFILES_DIR to point
# at the test's runfiles. However, if RUNFILES_DIR is set, orchestrator.zip will
# inherit its value instead of setting it to the proper directory. This breaks
# runfile resolution, so we unset this variable here.
unset RUNFILES_DIR
(
# This script is run by a Bazel sh_test rule, which sets RUNFILES_DIR to point
# at the test's runfiles. However, if RUNFILES_DIR is set, orchestrator.zip will
# inherit its value instead of setting it to the proper directory. This breaks
# runfile resolution, so we unset this variable here.
unset RUNFILES_DIR

# Run tool. The path to the --sku-config parameter is relative to the
# runfiles-dir.
$PYTHON ${ORCHESTRATOR_PATH} \
--sku-config=${SKU_CONFIG_PATH} \
--test-unlock-token="0x11111111_11111111_11111111_11111111" \
--test-exit-token="0x22222222_22222222_22222222_22222222" \
--fpga=${FPGA} \
--non-interactive \
"$@" \
--db-path=$TEST_TMPDIR/registry.sqlite
# Run tool. The path to the --sku-config parameter is relative to the
# runfiles-dir.
$PYTHON ${ORCHESTRATOR_PATH} \
--sku-config=${SKU_CONFIG_PATH} \
--test-unlock-token="0x11111111_11111111_11111111_11111111" \
--test-exit-token="0x22222222_22222222_22222222_22222222" \
--fpga=${FPGA} \
--non-interactive \
"$@" \
--db-path=$TEST_TMPDIR/registry.sqlite
)

# Post-process the coverage profile if coverage mode is enabled.
if [[ "$COVERAGE" == "1" ]]; then
export COLLECT_CC_COVERAGE="$PWD/$COLLECT_CC_COVERAGE"
cd "$ROOT"
"$COLLECT_CC_COVERAGE"
fi
Loading