Merge ~sylvain-pineau/plainbox-provider-checkbox:stress_s3_arm_rtcwake into plainbox-provider-checkbox:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 45d62aff89eee775c96a0f5b793a966f24fac6d9
Merged at revision: 87b7dcd67ffa98b121d7cb15f9fe3e3ee89b49ae
Proposed branch: ~sylvain-pineau/plainbox-provider-checkbox:stress_s3_arm_rtcwake
Merge into: plainbox-provider-checkbox:master
Diff against target: 113 lines (+22/-6)
1 file modified
units/stress/s3s4.pxu (+22/-6)
Reviewer Review Type Date Requested Status
Jonathan Cave (community) Approve
Review via email: mp+391917@code.launchpad.net

Description of the change

Fix the S3 stress tests to run on arm where fwts s3 is not supported

Using jinja2 and a modified version of the stress_s3_iterations resource job, the template job command now looks like:

 {%- if fwts == "supported" %}
     fwts s3 loops on x86
 {%- else %}
     rtcwake loops
 {% endif -%}

To post a comment you must log in.
Revision history for this message
Jonathan Cave (jocave) wrote :

Quite an esoteric implementation, but looks like it should have the desired outcome :D

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/units/stress/s3s4.pxu b/units/stress/s3s4.pxu
2index 0e349c3..b8fc25b 100644
3--- a/units/stress/s3s4.pxu
4+++ b/units/stress/s3s4.pxu
5@@ -21,6 +21,7 @@ plugin: resource
6 environ: STRESS_S3_ITERATIONS
7 command:
8 echo "s3_iterations: ${STRESS_S3_ITERATIONS:-30}"
9+ python3 -c 'import platform;print("fwts: {}".format("supported" if platform.machine() in ["x86_64", "i386"] else "unsupported"))'
10 estimated_duration: 1s
11 flags: preserve-locale
12
13@@ -32,6 +33,7 @@ plugin: resource
14 environ: STRESS_S4_ITERATIONS
15 command:
16 echo "s4_iterations: ${STRESS_S4_ITERATIONS:-30}"
17+ python3 -c 'import platform;print("fwts: {}".format("supported" if platform.machine() in ["x86_64", "i386"] else "unsupported"))'
18 estimated_duration: 1s
19 flags: preserve-locale
20
21@@ -39,10 +41,11 @@ flags: preserve-locale
22 unit: template
23 template-resource: stress_s3_iterations
24 template-unit: job
25+template-engine: jinja2
26 plugin: shell
27 flags: preserve-locale
28 category_id: stress-tests/suspend
29-id: stress-tests/suspend_{s3_iterations}_cycles
30+id: stress-tests/suspend_{{ s3_iterations }}_cycles
31 imports:
32 from com.canonical.certification import sleep
33 from com.canonical.certification import rtc
34@@ -53,11 +56,19 @@ estimated_duration: 2400.0
35 environ: PLAINBOX_SESSION_SHARE STRESS_S3_SLEEP_DELAY STRESS_S3_WAIT_DELAY LD_LIBRARY_PATH
36 user: root
37 command:
38+ {%- if fwts == "supported" %}
39 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/usr/lib/fwts"
40- 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
41+ 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
42+ {%- else %}
43+ for i in {1..{{ s3_iterations }}};
44+ do
45+ echo "Iteration $i"
46+ rtcwake -v -m mem -s "${STRESS_S3_SLEEP_DELAY:-30}"
47+ done
48+ {% endif -%}
49 _description:
50 PURPOSE:
51- This is an automated stress test that will force the system to suspend/resume for {s3_iterations} cycles.
52+ This is an automated stress test that will force the system to suspend/resume for {{ s3_iterations }} cycles.
53
54 unit: template
55 template-resource: stress_s3_iterations
56@@ -67,6 +78,7 @@ flags: preserve-locale
57 category_id: stress-tests/suspend
58 id: stress-tests/suspend-{s3_iterations}-cycles-log-check
59 after: stress-tests/suspend_{s3_iterations}_cycles
60+requires: cpuinfo.platform in ("i386", "x86_64")
61 estimated_duration: 1.0
62 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
63 _description:
64@@ -81,6 +93,7 @@ category_id: stress-tests/suspend
65 id: stress-tests/suspend-{s3_iterations}-cycles-log-attach
66 estimated_duration: 1.0
67 after: stress-tests/suspend_{s3_iterations}_cycles
68+requires: cpuinfo.platform in ("i386", "x86_64")
69 command: [ -e "$PLAINBOX_SESSION_SHARE"/suspend_{s3_iterations}_cycles.log ] && cat "$PLAINBOX_SESSION_SHARE"/suspend_{s3_iterations}_cycles.log
70 _description:
71 Attaches the log from the {s3_iterations} cycles Suspend/Resume test if it exists
72@@ -89,10 +102,11 @@ _description:
73 unit: template
74 template-resource: stress_s4_iterations
75 template-unit: job
76+template-engine: jinja2
77 plugin: shell
78 flags: preserve-locale
79 category_id: stress-tests/hibernate
80-id: stress-tests/hibernate_{s4_iterations}_cycles
81+id: stress-tests/hibernate_{{ s4_iterations }}_cycles
82 imports:
83 from com.canonical.certification import sleep
84 from com.canonical.certification import rtc
85@@ -104,10 +118,10 @@ environ: PLAINBOX_SESSION_SHARE STRESS_S4_SLEEP_DELAY STRESS_S4_WAIT_DELAY LD_LI
86 user: root
87 command:
88 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/usr/lib/fwts"
89- 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
90+ 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
91 _description:
92 PURPOSE:
93- This is an automated stress test that will force the system to hibernate/resume for {s4_iterations} cycles
94+ This is an automated stress test that will force the system to hibernate/resume for {{ s4_iterations }} cycles
95
96 unit: template
97 template-resource: stress_s4_iterations
98@@ -117,6 +131,7 @@ flags: preserve-locale
99 category_id: stress-tests/hibernate
100 id: stress-tests/hibernate-{s4_iterations}-cycles-log-check
101 after: stress-tests/hibernate_{s4_iterations}_cycles
102+requires: cpuinfo.platform in ("i386", "x86_64")
103 estimated_duration: 1.0
104 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
105 _description:
106@@ -131,6 +146,7 @@ category_id: stress-tests/hibernate
107 id: stress-tests/hibernate-{s4_iterations}-cycles-log-attach
108 estimated_duration: 1.0
109 after: stress-tests/hibernate_{s4_iterations}_cycles
110+requires: cpuinfo.platform in ("i386", "x86_64")
111 command: [ -e "$PLAINBOX_SESSION_SHARE"/hibernate_{s4_iterations}_cycles.log ] && cat "$PLAINBOX_SESSION_SHARE"/hibernate_{s4_iterations}_cycles.log
112 _description:
113 Attaches the log from the {s4_iterations} cycles Hibernate/Resume test if it exists

Subscribers

People subscribed via source and target branches