diff mbox series

[4/4,v4] test: add a test for the new tpm_auto_start() function

Message ID 20230218152741.528191-4-ilias.apalodimas@linaro.org
State New
Headers show
Series [1/4,v4] tpm: add a function that performs selftest + startup | expand

Commit Message

Ilias Apalodimas Feb. 18, 2023, 3:27 p.m. UTC
A prior patch adds a new API function for TPM2.0, which performs
the full startup sequence of the TPM.  Add a selftest for that.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
---
Changes since v4:
- New patch

 test/dm/tpm.c | 5 +++++
 1 file changed, 5 insertions(+)

--
2.39.2

Comments

Simon Glass Feb. 21, 2023, 7:35 p.m. UTC | #1
On Sat, 18 Feb 2023 at 08:27, Ilias Apalodimas
<ilias.apalodimas@linaro.org> wrote:
>
> A prior patch adds a new API function for TPM2.0, which performs
> the full startup sequence of the TPM.  Add a selftest for that.
>
> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> ---
> Changes since v4:
> - New patch
>
>  test/dm/tpm.c | 5 +++++
>  1 file changed, 5 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>
(with my patches on top)
diff mbox series

Patch

diff --git a/test/dm/tpm.c b/test/dm/tpm.c
index 0b46f799591f..8ee17f6a9bc3 100644
--- a/test/dm/tpm.c
+++ b/test/dm/tpm.c
@@ -25,6 +25,11 @@  static int dm_test_tpm(struct unit_test_state *uts)
 	ut_asserteq_str("init_done=0", buf);

 	ut_assertok(tpm_init(dev));
+	 /*
+	  * tpm_auto_start will rerun tpm_init, but handles the
+	  * -EBUSY return code internally.
+	  */
+	ut_assertok(tpm_auto_start(dev));

 	ut_assert(tpm_report_state(dev, buf, sizeof(buf)));
 	ut_asserteq_str("init_done=1", buf);