aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeikki Halmet <heikki.halmet@qt.io>2021-03-30 09:54:45 +0300
committerHeikki Halmet <heikki.halmet@qt.io>2021-04-13 07:46:42 +0300
commit4578721c383c5c6d0e31e904722beaed3ee35ba1 (patch)
tree0f6ae025cb64c0e6bae407dd610086ec6252c90d
parent47eb3746310465eb1f43d8ab69d753f9356e30fb (diff)
Provisioning: Reset Time Zone for macOS 10.14
Setting Time Zone for macOS 10.14 seems to be flaky. Let's reset it. If it still fails to set it then exit the script execution. Task-number: QTBUG-92174 Change-Id: I07b28d0511d8fc097a1da43b78de9a5131f6bfa7 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io> (cherry picked from commit ba149a162bb5683fbc139f57f4669f970f47f03d) Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io> (cherry picked from commit c84925c5122732d280837be444d82943c2f7bf73)
-rwxr-xr-xcoin/provisioning/qtci-macos-10.13-x86_64/05-systemsetup.sh14
-rwxr-xr-xcoin/provisioning/qtci-macos-10.14-x86_64/05-systemsetup.sh14
2 files changed, 26 insertions, 2 deletions
diff --git a/coin/provisioning/qtci-macos-10.13-x86_64/05-systemsetup.sh b/coin/provisioning/qtci-macos-10.13-x86_64/05-systemsetup.sh
index 95631107..9c4ea4a6 100755
--- a/coin/provisioning/qtci-macos-10.13-x86_64/05-systemsetup.sh
+++ b/coin/provisioning/qtci-macos-10.13-x86_64/05-systemsetup.sh
@@ -2,7 +2,7 @@
#############################################################################
##
-## Copyright (C) 2019 The Qt Company Ltd.
+## Copyright (C) 2021 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/
##
## This file is part of the provisioning scripts of the Qt Toolkit.
@@ -97,4 +97,16 @@ echo "Set Network Test Server address to $NTS_IP in /etc/hosts"
echo "$NTS_IP qt-test-server qt-test-server.qt-test-net" | sudo tee -a /etc/hosts
sudo systemsetup settimezone GMT
+# Setting Time Zone seems to be flaky in macOS 10.13 and in macOS 10.14. Checking that Time Zone is correct. If not, reset it.
+if [[ $(sudo systemsetup -gettimezone) = *GMT* ]]; then
+ echo "Time Zone is GMT"
+else
+ echo "Wrong Time Zone. Reset Time Zone to GMT"
+ sleep 5
+ sudo systemsetup settimezone GMT
+ if [[ $(sudo systemsetup -gettimezone) != *GMT* ]]; then
+ echo "Couldn't set Time Zone!"
+ exit 1
+ fi
+fi
sudo rm -f "$targetFile"
diff --git a/coin/provisioning/qtci-macos-10.14-x86_64/05-systemsetup.sh b/coin/provisioning/qtci-macos-10.14-x86_64/05-systemsetup.sh
index 79eba834..f5e85f5f 100755
--- a/coin/provisioning/qtci-macos-10.14-x86_64/05-systemsetup.sh
+++ b/coin/provisioning/qtci-macos-10.14-x86_64/05-systemsetup.sh
@@ -2,7 +2,7 @@
#############################################################################
##
-## Copyright (C) 2019 The Qt Company Ltd.
+## Copyright (C) 2021 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/
##
## This file is part of the provisioning scripts of the Qt Toolkit.
@@ -97,5 +97,17 @@ echo "Set Network Test Server address to $NTS_IP in /etc/hosts"
echo "$NTS_IP qt-test-server qt-test-server.qt-test-net" | sudo tee -a /etc/hosts
sudo systemsetup settimezone GMT
+# Setting Time Zone seems to be flaky in macOS 10.13 and in macOS 10.14. Checking that Time Zone is correct. If not, reset it.
+if [[ $(sudo systemsetup -gettimezone) = *GMT* ]]; then
+ echo "Time Zone is GMT"
+else
+ echo "Wrong Time Zone. Reset Time Zone to GMT"
+ sleep 5
+ sudo systemsetup settimezone GMT
+ if [[ $(sudo systemsetup -gettimezone) != *GMT* ]]; then
+ echo "Couldn't set Time Zone!"
+ exit 1
+ fi
+fi
sudo systemsetup setusingnetworktime off
sudo rm -f "$targetFile"