ci/bare-metal: Try harder to do NTP
authorDaniel Stone <daniels@collabora.com>
Fri, 11 Jun 2021 14:45:44 +0000 (15:45 +0100)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Tue, 15 Jun 2021 12:02:44 +0000 (14:02 +0200)
Same as LAVA does.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

.gitlab-ci/bare-metal/init.sh

index b8b41b4..50d1730 100755 (executable)
@@ -18,8 +18,9 @@ export XDG_CACHE_HOME=/tmp
 
 echo "nameserver 8.8.8.8" > /etc/resolv.conf
 
-# Not all DUTs have network
-sntp -sS pool.ntp.org || true
+# Set the time so we can validate certificates before we fetch anything;
+# however as not all DUTs have network, make this non-fatal.
+for i in 1 2 3; do sntp -sS pool.ntp.org && break || sleep 2; done || true
 
 # Start a little daemon to capture the first devcoredump we encounter.  (They
 # expire after 5 minutes, so we poll for them).