From 23089c08eebc6990d73b78467515ac7210e756da Mon Sep 17 00:00:00 2001 From: Clement Faure Date: Mon, 6 Nov 2023 09:42:53 +0100 Subject: [PATCH] ta: os_test: fix TA time wrap test 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 --- ta/os_test/os_test.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ta/os_test/os_test.c b/ta/os_test/os_test.c index d6edb3df9..d40e8f91b 100644 --- a/ta/os_test/os_test.c +++ b/ta/os_test/os_test.c @@ -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; }