aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlias Apalodimas2023-02-18 17:21:22 +0200
committerIlias Apalodimas2023-02-28 09:44:28 +0200
commit1b11de766f053dceb785c1fb8f587638880396b2 (patch)
tree784f807d1de6e23ddc1c7e3ae3b1cbc923b8de70
parent87bc11d5e2d79e8269206cc7fc96af896a46f983 (diff)
test: add a test for the new tpm_auto_start() function
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. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
-rw-r--r--test/dm/tpm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/dm/tpm.c b/test/dm/tpm.c
index 0b46f799591..8ee17f6a9bc 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);