Skip to content

zephyr: test: userspace: do not run standalone suites twice - #11409

Open
kv2019i wants to merge 1 commit into
thesofproject:mainfrom
kv2019i:202611-standalone-tests-run-once
Open

kv2019i wants to merge 1 commit into
thesofproject:mainfrom
kv2019i:202611-standalone-tests-run-once

Conversation

@kv2019i

@kv2019i kv2019i commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

The standalone userspace test suites run themselves from a SYS_INIT hook with ztest_run_test_suite(). Since sof_run_boot_tests() is also called from test_main() on CONFIG_SOF_BOOT_TEST_STANDALONE builds, its ztest_run_all() call runs every suite a second time.

Not all suites can be rerun. On PTL the second run of the SSP DAI test finds HDA link DMA state left over from the first run, fails its assertion in the user thread and halts the firmware.

Add a ZTEST_SUITE() predicate that always returns false and use it for the self-running suites. ztest_run_test_suite() does not check the predicate, but ztest_run_all() does, so each suite runs once.

The standalone userspace test suites run themselves from a SYS_INIT
hook with ztest_run_test_suite(). Since sof_run_boot_tests() is also
called from test_main() on CONFIG_SOF_BOOT_TEST_STANDALONE builds, its
ztest_run_all() call runs every suite a second time.

Not all suites can be rerun. On PTL the second run of the SSP DAI test
finds HDA link DMA state left over from the first run, fails its
assertion in the user thread and halts the firmware.

Add a ZTEST_SUITE() predicate that always returns false and use it for
the self-running suites. ztest_run_test_suite() does not check the
predicate, but ztest_run_all() does, so each suite runs once.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Copilot AI balanced review requested due to automatic review settings November 6, 2026 12:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the change preventing duplicate execution of standalone userspace test suites.

No open issues 🎉

What changed in this PR

Prevents standalone userspace test suites from running twice during boot, avoiding failures caused by leftover hardware state, including the SSP DAI failure on PTL.

Changes:

  • Adds a documented, always-false suite predicate to exclude self-running suites from ztest_run_all().
  • Applies the predicate to four userspace suites while preserving their explicit execution from SYS_INIT hooks.
File Description
zephyr/​test/​userspace/​test_mailbox.c Prevents automatic reruns of the mailbox suite.
zephyr/​test/​userspace/​test_ll_task.c Prevents automatic reruns of the low-latency task suite.
zephyr/​test/​userspace/​test_intel_ssp_dai.c Prevents automatic reruns of the SSP DAI suite.
zephyr/​test/​userspace/​test_intel_hda_dma.c Prevents automatic reruns of the HDA DMA suite.
src/​include/​sof/​boot_test.h Defines and documents the shared standalone-suite predicate.

Review effort: Balanced

@intel-sofci

Copy link
Copy Markdown

PR 11409: test results

Run date: 2026-11-06 13:26 UTC

Tested commit: a3b0201bf0b7cda9850a67cb311d16a72881ee60

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants