[PATCH v3 0/4] tpm: Start to tidy up TPM tests

Simon Glass sjg at chromium.org
Sat May 24 15:06:33 CEST 2025


This series is a starting point only. It tries to provide some direction
for how the TPM tests should be run on real hardware and on sandbox.

For sandbox, things are relatively easy since the TPM is reset before
each test. Tests should start up the TPM before doing anything. Tests
can be run in parallel, which is fine because tests are independent.

For real hardware, tests cannot be made independent, other than by
resetting the board, which if the hardware is correct, resets the TPM.
So there may be more work to do to figure that out. The approach taken
in this series for real hardware is to have a few tests which do init,
then have the rest of the tests assume that the init is done. Tests
that depend on the TPM already being inited can use 'tpm autostart'
which works OK on sandbox and real hardware.

Changes in v3:
- Use 'check' instead of 'test' when naming test helpers
- Add missing tpm_self_test_full() call
- Add new patch to skip failing tests on coral

Changes in v2:
- Keep test_tpm2_continue_self_test()

Simon Glass (4):
  tpm: sandbox: Support self-test continue in emulator
  tpm: Convert sandbox-focussed tests to C
  tpm: Drop unwanted special cases for sandbox
  test: tpm: Skip failing tests on coral

 drivers/tpm/tpm_tis_sandbox.c |  1 +
 test/dm/tpm.c                 | 77 ++++++++++++++++++++++++++++++-
 test/py/tests/test_tpm2.py    | 86 ++++++-----------------------------
 3 files changed, 89 insertions(+), 75 deletions(-)

-- 
2.43.0

base-commit: e3ced530e543c9f24cbc66430abc6109ce8df015
branch: tpm3


More information about the U-Boot mailing list