lava: Wait until time is synchronised during test suite cleanup
authorKienan Stewart <kstewart@efficios.com>
Mon, 15 Jan 2024 14:35:56 +0000 (09:35 -0500)
committerKienan Stewart <kstewart@efficios.com>
Wed, 17 Jan 2024 20:54:56 +0000 (15:54 -0500)
Change-Id: I85d426b9167eb53777d0684d4f7f3249a6a48f3a
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
scripts/system-tests/run-test-suites.sh

index 62ab7d24dcca4abccb6ee03ebb104620d5083a10..81be13f42c921d05b2a7988f5221c83d63d89de2 100755 (executable)
@@ -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
This page took 0.023216 seconds and 4 git commands to generate.