Skip to content

Commit

Permalink
ta: os_test: fix TA time wrap test
Browse files Browse the repository at this point in the history
In the TA time wrap test, the TA time is set to its maximum value. After
one second delay, the TA time was compared to the system time.

The comparaison with the system time might not be pertinent as it is
most likely more than dozen seconds.

Compare the wrapped time to a fixed value instead.

Signed-off-by: Clement Faure <[email protected]>
  • Loading branch information
clementfaure committed Nov 6, 2023
1 parent eb88481 commit 23089c0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ta/os_test/os_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,9 @@ static TEE_Result test_time(void)
printf("TA time %u.%03u\n", (unsigned int)t.seconds,
(unsigned int)t.millis);

if (t.seconds > sys_t.seconds) {
EMSG("Unexpected wrapped time %u.%03u (sys_t %u.%03u)\n",
(unsigned int)t.seconds, (unsigned int)t.millis,
(unsigned int)sys_t.seconds, (unsigned int)sys_t.millis);
if (t.seconds > 1) {
EMSG("Unexpected wrapped time %u.%03u\n",
(unsigned int)t.seconds, (unsigned int)t.millis);
return TEE_ERROR_BAD_STATE;
}

Expand Down

0 comments on commit 23089c0

Please sign in to comment.