From 4663cfc2cf7d2f049d22f42c57d689247cd269d5 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Mon, 15 Jan 2024 09:35:56 -0500 Subject: [PATCH] lava: Wait until time is synchronised during test suite cleanup Change-Id: I85d426b9167eb53777d0684d4f7f3249a6a48f3a Signed-off-by: Kienan Stewart --- scripts/system-tests/run-test-suites.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/system-tests/run-test-suites.sh b/scripts/system-tests/run-test-suites.sh index 62ab7d2..81be13f 100755 --- a/scripts/system-tests/run-test-suites.sh +++ b/scripts/system-tests/run-test-suites.sh @@ -71,6 +71,15 @@ verne() { function cleanup { timedatectl set-ntp true + # The false dates used in the tests are far in the past + # and it may take some time for the ntp update to actually + # happen. + # If the date is still in the past, it is possible that + # subsequent steps will fail (eg. TLS certificates cannot + # be validated). + while [[ "$(date +%Y)" -lt "2024" ]] ; do + sleep 1 + done } trap cleanup EXIT SIGINT SIGTERM @@ -107,5 +116,4 @@ if [[ "${failed_tests}" != "0" ]] ; then find tests/ -iname '*.trs' -print0 -or -iname '*.log' -print0 | tar czf /tmp/coredump/logs.tgz --null -T - fi -timedatectl set-ntp true exit $failed_tests -- 2.34.1