From 5cc52ac3448e8af9a676e3446a112391430165b2 Mon Sep 17 00:00:00 2001 From: Jens Wiklander Date: Tue, 4 Feb 2025 14:43:20 +0100 Subject: [PATCH] regression_1041: increase ftpm timeout to 20 seconds The timeout for /dev/tpm0 to appear was previously 5 seconds, but that's not always enough so increase it to 20 seconds to have a larger margin. Signed-off-by: Jens Wiklander Reviewed-by: Jerome Forissier --- host/xtest/regression_1000.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/host/xtest/regression_1000.c b/host/xtest/regression_1000.c index 322ce9300..9bcff163c 100644 --- a/host/xtest/regression_1000.c +++ b/host/xtest/regression_1000.c @@ -3372,6 +3372,7 @@ static void xtest_tee_test_1041(ADBG_Case_t *c) uint32_t ret_orig = 0; struct stat sb = { }; bool found = false; + int max_wait = 20; int i = 0; res = xtest_teec_open_session(&sess, &(const TEEC_UUID)TA_FTPM_UUID, @@ -3388,11 +3389,12 @@ static void xtest_tee_test_1041(ADBG_Case_t *c) * (5 seconds) otherwise the test may fail if run immediately after * boot. */ - for (i = 0; i < 5; i++) { + for (i = 0; i < max_wait; i++) { if (stat(fname, &sb) == 0) { found = true; break; } + Do_ADBG_Log("Waiting for TPM device %d / %d", i, max_wait); sleep(1); } if (!ADBG_EXPECT_TRUE(c, found)) {