summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoni Jantti <joni.jantti@qt.io>2018-02-06 15:39:57 +0200
committerLiang Qi <liang.qi@qt.io>2018-02-08 08:04:47 +0000
commitcadedac3b4ae9ea0b7a500accf0d1e3eeae47bd9 (patch)
tree5d0f96979aeb88c4a6b3b32b806177c2c15e32f8
parentaf55ddc91349d408775bef8d29db7dabae7aef72 (diff)
Provisioning: osx-10.11 - Disable sleep
Display sleep and system sleep need to be disabled to prevent the machine from going to sleep during RTA testing. Task-number: QTQAINFRA-1588 Change-Id: Idc91d77388ed9bc6df5f3c1aceca515f6308c618 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
-rwxr-xr-xcoin/provisioning/qtci-osx-10.11-x86_64/05-systemsetup.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/coin/provisioning/qtci-osx-10.11-x86_64/05-systemsetup.sh b/coin/provisioning/qtci-osx-10.11-x86_64/05-systemsetup.sh
index 5cb067a7..994dedf4 100755
--- a/coin/provisioning/qtci-osx-10.11-x86_64/05-systemsetup.sh
+++ b/coin/provisioning/qtci-osx-10.11-x86_64/05-systemsetup.sh
@@ -49,6 +49,7 @@ ExceptionSetDelay=102
ExceptionVNC=103
ExceptionNTS=104
ExceptionDisableScreensaverPassword=105
+ExceptionDisableSleep=106
try
(
@@ -56,6 +57,9 @@ try
# For current session
defaults -currentHost write com.apple.screensaver idleTime 0 || throw $ExceptionDisableScreensaver
+ echo "Disable sleep"
+ sudo pmset sleep 0 displaysleep 0 || throw $ExceptionDisableSleep
+
# For session after a reboot
mkdir -p "$HOME/Library/LaunchAgents" || throw $ExceptionDisableScreensaver
(
@@ -126,6 +130,11 @@ catch || {
echo "Failed to disable requiring of password after screensaver is enabled."
exit 1;
;;
+ $ExceptionDisableSleep)
+ echo "Failed to disable sleep."
+ exit 1;
+ ;;
+
esac
}