summaryrefslogtreecommitdiff
path: root/units/suspend
diff options
authorJenkins <jenkins@cert-jenkins-master-201506-18558.maas>2021-11-08 12:57:51 +0000
committerJenkins <jenkins@cert-jenkins-master-201506-18558.maas>2021-11-08 12:57:51 +0000
commitcc7b00192b1d005ce6a0a857c3c63d0ed9174734 (patch)
tree8719129f76299213451c0806e50bb97cbc72509a /units/suspend
parent367bac112ba08007d31fdff293610f34a091642b (diff)
Import plainbox-provider-checkbox_0.60.0~rc1.orig.tar.gzupstream-0.60.0_rc1patched-0.60.0_rc1-1
Diffstat (limited to 'units/suspend')
-rw-r--r--units/suspend/suspend.pxu34
1 files changed, 24 insertions, 10 deletions
diff --git a/units/suspend/suspend.pxu b/units/suspend/suspend.pxu
index a2830d4..8c25a91 100644
--- a/units/suspend/suspend.pxu
+++ b/units/suspend/suspend.pxu
@@ -189,17 +189,27 @@ requires:
sleep.mem == 'supported'
rtc.state == 'supported'
user: root
-environ: PLAINBOX_SESSION_SHARE
+environ: PLAINBOX_SESSION_SHARE RTC_DEVICE_FILE
command:
if type -P fwts >/dev/null; then
- echo "Calling fwts"
- if [[ -v SNAP ]]; then
- export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/usr/lib/fwts"
- fi
- set -o pipefail; checkbox-support-fwts_test -f none -l "$PLAINBOX_SESSION_SHARE"/suspend_single -s s3 --s3-sleep-delay=30 --s3-device-check --s3-device-check-delay=45 | tee "$PLAINBOX_SESSION_SHARE"/suspend_single_times.log
+ echo "Calling fwts"
+ if [[ -v SNAP ]]; then
+ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/usr/lib/fwts"
+ fi
+ if fwts --show-tests-categories | grep -q 's3 '; then
+ echo "Calling fwts"
+ set -o pipefail; checkbox-support-fwts_test -f none -l "$PLAINBOX_SESSION_SHARE"/suspend_single -s s3 --s3-sleep-delay=30 --s3-device-check --s3-device-check-delay=45 | tee "$PLAINBOX_SESSION_SHARE"/suspend_single_times.log
+ else
+ echo "Calling rtcwake"
+ if [ -z "$RTC_DEVICE_FILE" ]; then
+ rtcwake -m mem -s 30
+ else
+ rtcwake -d "$RTC_DEVICE_FILE" -m mem -s 30
+ fi
+ fi
else
- echo "Calling sleep_test.py"
- set -o pipefail; sleep_test.py -p | tee "$PLAINBOX_SESSION_SHARE"/2_suspend_single_times.log
+ echo "Calling sleep_test.py"
+ set -o pipefail; sleep_test.py -p | tee "$PLAINBOX_SESSION_SHARE"/2_suspend_single_times.log
fi
estimated_duration: 90.0
_summary: Manual test of suspend function
@@ -263,7 +273,7 @@ _summary: Automated test of suspend function
_description:
This is the automated version of suspend/suspend_advanced.
user: root
-environ: PLAINBOX_SESSION_SHARE
+environ: PLAINBOX_SESSION_SHARE RTC_DEVICE_FILE
command:
if [[ -v SNAP ]]; then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/usr/lib/fwts"
@@ -274,7 +284,11 @@ command:
set -o pipefail; checkbox-support-fwts_test -f none -l "$PLAINBOX_SESSION_SHARE"/suspend_single -s s3 --s3-sleep-delay=30 --s3-device-check --s3-device-check-delay=45 | tee "$PLAINBOX_SESSION_SHARE"/suspend_single_times.log
else
echo "Calling rtcwake"
- rtcwake -m mem -s 30
+ if [ -z "$RTC_DEVICE_FILE" ]; then
+ rtcwake -m mem -s 30
+ else
+ rtcwake -d "$RTC_DEVICE_FILE" -m mem -s 30
+ fi
fi
estimated_duration: 90.000