diff options
author | Sylvain Pineau <sylvain.pineau@canonical.com> | 2020-10-07 11:37:32 +0200 |
---|---|---|
committer | Sylvain Pineau <sylvain.pineau@canonical.com> | 2020-10-07 11:37:32 +0200 |
commit | 45d62aff89eee775c96a0f5b793a966f24fac6d9 (patch) | |
tree | 2b4cd30a59d3475348a6e43dae09b1f5b60f3f76 /units/stress | |
parent | 2f8a7b7c905c1807639bb27468fb75c0cabd063f (diff) |
stress:s3s4: Fallback to rtcwake if fwts s3 is not supported (e.g on arm)
Diffstat (limited to 'units/stress')
-rw-r--r-- | units/stress/s3s4.pxu | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/units/stress/s3s4.pxu b/units/stress/s3s4.pxu index 0e349c3..b8fc25b 100644 --- a/units/stress/s3s4.pxu +++ b/units/stress/s3s4.pxu @@ -21,6 +21,7 @@ plugin: resource environ: STRESS_S3_ITERATIONS command: echo "s3_iterations: ${STRESS_S3_ITERATIONS:-30}" + python3 -c 'import platform;print("fwts: {}".format("supported" if platform.machine() in ["x86_64", "i386"] else "unsupported"))' estimated_duration: 1s flags: preserve-locale @@ -32,6 +33,7 @@ plugin: resource environ: STRESS_S4_ITERATIONS command: echo "s4_iterations: ${STRESS_S4_ITERATIONS:-30}" + python3 -c 'import platform;print("fwts: {}".format("supported" if platform.machine() in ["x86_64", "i386"] else "unsupported"))' estimated_duration: 1s flags: preserve-locale @@ -39,10 +41,11 @@ flags: preserve-locale unit: template template-resource: stress_s3_iterations template-unit: job +template-engine: jinja2 plugin: shell flags: preserve-locale category_id: stress-tests/suspend -id: stress-tests/suspend_{s3_iterations}_cycles +id: stress-tests/suspend_{{ s3_iterations }}_cycles imports: from com.canonical.certification import sleep from com.canonical.certification import rtc @@ -53,11 +56,19 @@ estimated_duration: 2400.0 environ: PLAINBOX_SESSION_SHARE STRESS_S3_SLEEP_DELAY STRESS_S3_WAIT_DELAY LD_LIBRARY_PATH user: root command: + {%- if fwts == "supported" %} export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/usr/lib/fwts" - set -o pipefail; checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/suspend_{s3_iterations}_cycles -f none -s s3 --s3-device-check --s3-device-check-delay="${{STRESS_S3_WAIT_DELAY:-45}}" --s3-sleep-delay="${{STRESS_S3_SLEEP_DELAY:-30}}" --s3-multiple={s3_iterations} -j "$SNAP"/share/fwts | tee "$PLAINBOX_SESSION_SHARE"/suspend_{s3_iterations}_cycles_times.log + set -o pipefail; checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/suspend_{{ s3_iterations }}_cycles -f none -s s3 --s3-device-check --s3-device-check-delay="${STRESS_S3_WAIT_DELAY:-45}" --s3-sleep-delay="${STRESS_S3_SLEEP_DELAY:-30}" --s3-multiple={{ s3_iterations }} -j "$SNAP"/share/fwts | tee "$PLAINBOX_SESSION_SHARE"/suspend_{{ s3_iterations }}_cycles_times.log + {%- else %} + for i in {1..{{ s3_iterations }}}; + do + echo "Iteration $i" + rtcwake -v -m mem -s "${STRESS_S3_SLEEP_DELAY:-30}" + done + {% endif -%} _description: PURPOSE: - This is an automated stress test that will force the system to suspend/resume for {s3_iterations} cycles. + This is an automated stress test that will force the system to suspend/resume for {{ s3_iterations }} cycles. unit: template template-resource: stress_s3_iterations @@ -67,6 +78,7 @@ flags: preserve-locale category_id: stress-tests/suspend id: stress-tests/suspend-{s3_iterations}-cycles-log-check after: stress-tests/suspend_{s3_iterations}_cycles +requires: cpuinfo.platform in ("i386", "x86_64") estimated_duration: 1.0 command: [ -e "$PLAINBOX_SESSION_SHARE"/suspend_{s3_iterations}_cycles.log ] && sleep_test_log_check.py -v s3 "$PLAINBOX_SESSION_SHARE"/suspend_{s3_iterations}_cycles.log _description: @@ -81,6 +93,7 @@ category_id: stress-tests/suspend id: stress-tests/suspend-{s3_iterations}-cycles-log-attach estimated_duration: 1.0 after: stress-tests/suspend_{s3_iterations}_cycles +requires: cpuinfo.platform in ("i386", "x86_64") command: [ -e "$PLAINBOX_SESSION_SHARE"/suspend_{s3_iterations}_cycles.log ] && cat "$PLAINBOX_SESSION_SHARE"/suspend_{s3_iterations}_cycles.log _description: Attaches the log from the {s3_iterations} cycles Suspend/Resume test if it exists @@ -89,10 +102,11 @@ _description: unit: template template-resource: stress_s4_iterations template-unit: job +template-engine: jinja2 plugin: shell flags: preserve-locale category_id: stress-tests/hibernate -id: stress-tests/hibernate_{s4_iterations}_cycles +id: stress-tests/hibernate_{{ s4_iterations }}_cycles imports: from com.canonical.certification import sleep from com.canonical.certification import rtc @@ -104,10 +118,10 @@ environ: PLAINBOX_SESSION_SHARE STRESS_S4_SLEEP_DELAY STRESS_S4_WAIT_DELAY LD_LI user: root command: export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/usr/lib/fwts" - checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/hibernate_{s4_iterations}_cycles -f none -s s4 --s4-device-check --s4-device-check-delay="${{STRESS_S4_WAIT_DELAY:-45}}" --s4-sleep-delay="${{STRESS_S4_SLEEP_DELAY:-120}}" --s4-multiple={s4_iterations} -j "$SNAP"/share/fwts + checkbox-support-fwts_test -l "$PLAINBOX_SESSION_SHARE"/hibernate_{{ s4_iterations }}_cycles -f none -s s4 --s4-device-check --s4-device-check-delay="${STRESS_S4_WAIT_DELAY:-45}" --s4-sleep-delay="${STRESS_S4_SLEEP_DELAY:-120}" --s4-multiple={{ s4_iterations }} -j "$SNAP"/share/fwts _description: PURPOSE: - This is an automated stress test that will force the system to hibernate/resume for {s4_iterations} cycles + This is an automated stress test that will force the system to hibernate/resume for {{ s4_iterations }} cycles unit: template template-resource: stress_s4_iterations @@ -117,6 +131,7 @@ flags: preserve-locale category_id: stress-tests/hibernate id: stress-tests/hibernate-{s4_iterations}-cycles-log-check after: stress-tests/hibernate_{s4_iterations}_cycles +requires: cpuinfo.platform in ("i386", "x86_64") estimated_duration: 1.0 command: [ -e "$PLAINBOX_SESSION_SHARE"/hibernate_{s4_iterations}_cycles.log ] && sleep_test_log_check.py -v s4 "$PLAINBOX_SESSION_SHARE"/hibernate_{s4_iterations}_cycles.log _description: @@ -131,6 +146,7 @@ category_id: stress-tests/hibernate id: stress-tests/hibernate-{s4_iterations}-cycles-log-attach estimated_duration: 1.0 after: stress-tests/hibernate_{s4_iterations}_cycles +requires: cpuinfo.platform in ("i386", "x86_64") command: [ -e "$PLAINBOX_SESSION_SHARE"/hibernate_{s4_iterations}_cycles.log ] && cat "$PLAINBOX_SESSION_SHARE"/hibernate_{s4_iterations}_cycles.log _description: Attaches the log from the {s4_iterations} cycles Hibernate/Resume test if it exists |