aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Gmeiner <[email protected]>2020-04-27 09:53:07 +0200
committerMarge Bot <[email protected]>2020-04-28 07:17:24 +0000
commit7d476a1360d3615f510719174887b9004dfdff48 (patch)
tree0a394c6ef043b5a24679d8f142e9c08accc8556b
parentb4cc116339f4eec9ddeba2b2efc9b07f06ae6d40 (diff)
ci: bare-metal: power down device after tests
Helps to save electricity. Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4754>
-rwxr-xr-x.gitlab-ci/bare-metal/fastboot.sh9
-rwxr-xr-x.gitlab-ci/bare-metal/google-power-down.sh10
2 files changed, 19 insertions, 0 deletions
diff --git a/.gitlab-ci/bare-metal/fastboot.sh b/.gitlab-ci/bare-metal/fastboot.sh
index f2693c6b384..5e57639c476 100755
--- a/.gitlab-ci/bare-metal/fastboot.sh
+++ b/.gitlab-ci/bare-metal/fastboot.sh
@@ -15,6 +15,12 @@ if [ -z "$BM_POWERUP" ]; then
exit 1
fi
+if [ -z "$BM_POWERDOWN" ]; then
+ echo "Must set BM_POWERDOWN in your gitlab-runner config.toml [[runners]] environment"
+ echo "This is a shell script that should power off the device."
+ exit 1
+fi
+
if [ -z "$BM_FASTBOOT_SERIAL" ]; then
echo "Must set BM_FASTBOOT_SERIAL in your gitlab-runner config.toml [[runners]] environment"
echo "This must be the a stable-across-resets fastboot serial number."
@@ -90,6 +96,9 @@ fastboot boot -s $BM_FASTBOOT_SERIAL artifacts/fastboot.img
# Wait for the device to complete the deqp run
$BM/expect-output.sh artifacts/serial-output.txt "DEQP RESULT"
+# power down the device
+PATH=$BM:$PATH $BM_POWERDOWN
+
set +e
if grep -q "DEQP RESULT: pass" artifacts/serial-output.txt; then
exit 0
diff --git a/.gitlab-ci/bare-metal/google-power-down.sh b/.gitlab-ci/bare-metal/google-power-down.sh
new file mode 100755
index 00000000000..ffb6b4cc6df
--- /dev/null
+++ b/.gitlab-ci/bare-metal/google-power-down.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+relay=$1
+
+if [ -z "$relay" ]; then
+ echo "Must supply a relay arg"
+ exit 1
+fi
+
+$CI_PROJECT_DIR/.gitlab-ci/bare-metal/google-power-relay.py off $relay