Skip to content

Commit

Permalink
regression_1041: increase ftpm timeout to 20 seconds
Browse files Browse the repository at this point in the history
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 <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
  • Loading branch information
jenswi-linaro committed Feb 5, 2025
1 parent 86b5734 commit 5cc52ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion host/xtest/regression_1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)) {
Expand Down

0 comments on commit 5cc52ac

Please sign in to comment.