Merge lp:~pieq/checkbox/add-30suspend-1reboot-cycles-support into lp:checkbox

Proposed by Pierre Equoy
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 4036
Merged at revision: 4036
Proposed branch: lp:~pieq/checkbox/add-30suspend-1reboot-cycles-support
Merge into: lp:checkbox
Diff against target: 110 lines (+41/-5)
3 files modified
providers/plainbox-provider-checkbox/bin/pm_test (+4/-1)
providers/plainbox-provider-checkbox/bin/sleep_time_check (+9/-3)
providers/plainbox-provider-checkbox/jobs/stress.txt.in (+28/-1)
To merge this branch: bzr merge lp:~pieq/checkbox/add-30suspend-1reboot-cycles-support
Reviewer Review Type Date Requested Status
Sylvain Pineau Approve
Review via email: mp+273033@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

tested ok on my own system too. Thanks the new jobs work flawlessly

review: Approve
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Hi

Could you please land a patch on top of this merge requests that uses
"after" rather than "depends" for each attachment. Depends will skip
adding the attachment. We should either use just attachment jobs for
everything or shell jobs that log to a file that have an "after" job
that collects the attachment.

On Thu, Oct 1, 2015 at 1:51 PM, <email address hidden> wrote:
> The proposal to merge lp:~pierre-equoy/checkbox/add-30suspend-1reboot-cycles-support into lp:checkbox has been updated.
>
> Status: Approved => Merged
>
> For more details, see:
> https://code.launchpad.net/~pierre-equoy/checkbox/add-30suspend-1reboot-cycles-support/+merge/273033
> --
> You are subscribed to branch lp:checkbox.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'providers/plainbox-provider-checkbox/bin/pm_test'
2--- providers/plainbox-provider-checkbox/bin/pm_test 2015-09-04 06:15:05 +0000
3+++ providers/plainbox-provider-checkbox/bin/pm_test 2015-10-01 09:27:23 +0000
4@@ -163,7 +163,10 @@
5 sleep_test_path, cycles_count)
6 logging.info('Running suspend/resume cycles')
7 logging.debug('Executing: {0!r}...'.format(command_str))
8- subprocess.check_call(command_str, shell=True)
9+ # We call sleep_test script and log its output as it contains
10+ # average times we need to compute global average times later.
11+ logging.info(subprocess.check_output(command_str,
12+ universal_newlines=True, shell=True))
13
14 def summary(self):
15 """
16
17=== modified file 'providers/plainbox-provider-checkbox/bin/sleep_time_check'
18--- providers/plainbox-provider-checkbox/bin/sleep_time_check 2015-04-17 17:56:29 +0000
19+++ providers/plainbox-provider-checkbox/bin/sleep_time_check 2015-10-01 09:27:23 +0000
20@@ -2,6 +2,7 @@
21
22 import sys
23 import argparse
24+from statistics import mean
25
26
27 def main():
28@@ -35,20 +36,25 @@
29 return False
30
31 sleep_time = None
32+ sleep_times = []
33 resume_time = None
34+ resume_times = []
35 # find our times
36 for line in lines:
37 if "Average time to sleep" in line:
38 sleep_time = float(line.split(':')[1].strip())
39+ sleep_times.append(sleep_time)
40 elif "Average time to resume" in line:
41 resume_time = float(line.split(':')[1].strip())
42+ resume_times.append(resume_time)
43
44- if sleep_time is None or resume_time is None:
45+ if (sleep_time is None or resume_time is None) or \
46+ (len(sleep_times) != len(resume_times)):
47 print("ERROR: One or more times was not reported correctly")
48 return False
49
50- print("Average time to enter sleep state: %s seconds" % sleep_time)
51- print("Average time to resume from sleep state: %s seconds" % resume_time)
52+ print("Average time to enter sleep state: %.4f seconds" % mean(sleep_times))
53+ print("Average time to resume from sleep state: %.4f seconds" % mean(resume_times))
54
55 failed = False
56 if sleep_time > args.sleep_threshold:
57
58=== modified file 'providers/plainbox-provider-checkbox/jobs/stress.txt.in'
59--- providers/plainbox-provider-checkbox/jobs/stress.txt.in 2015-09-08 22:04:46 +0000
60+++ providers/plainbox-provider-checkbox/jobs/stress.txt.in 2015-10-01 09:27:23 +0000
61@@ -90,7 +90,16 @@
62 estimated_duration: 1.0
63 command: [ -e $PLAINBOX_SESSION_SHARE/suspend_30_cycles.log ] && sleep_test_log_check -v s3 $PLAINBOX_SESSION_SHARE/suspend_30_cycles.log
64 _description:
65- Automated check of the 30 cycle hibernate log for errors detected by fwts.
66+ Automated check of the 30 cycle suspend log for errors detected by fwts.
67+
68+plugin: shell
69+category_id: 2013.com.canonical.plainbox::stress
70+id: power-management/suspend-30-cycles-log-check-with-reboots
71+depends: power-management/suspend_30_cycles_with_reboots
72+estimated_duration: 1.0
73+command: [ -e $PLAINBOX_SESSION_SHARE/pm_test.reboot.3.log ] && sleep_test_log_check -v s3 $PLAINBOX_SESSION_SHARE/pm_test.reboot.3.log
74+_description:
75+ Automated check of the '30 cycle suspend and 1 reboot times 3' logs for errors detected by fwts.
76
77 plugin: attachment
78 category_id: 2013.com.canonical.plainbox::stress
79@@ -101,6 +110,15 @@
80 _description:
81 Attaches the log from the 30 cycle Suspend/Resume test if it exists
82
83+plugin: attachment
84+category_id: 2013.com.canonical.plainbox::stress
85+id: power-management/suspend-30-cycle-log-attach-with-reboots
86+estimated_duration: 1.0
87+depends: power-management/suspend_30_cycles_with_reboots
88+command: [ -e $PLAINBOX_SESSION_SHARE/pm_test.reboot.3.log ] && cat $PLAINBOX_SESSION_SHARE/pm_test.reboot.3.log
89+_description:
90+ Attaches the log from the '30 cycle Suspend/Resume and one reboot times 3' test if it exists
91+
92 plugin: shell
93 category_id: 2013.com.canonical.plainbox::stress
94 id: power-management/suspend-30-cycles-time-check
95@@ -112,6 +130,15 @@
96
97 plugin: shell
98 category_id: 2013.com.canonical.plainbox::stress
99+id: power-management/suspend-30-cycles-time-check-with-reboots
100+estimated_duration: 1.0
101+depends: power-management/suspend_30_cycles_with_reboots
102+command: [ -e $PLAINBOX_SESSION_SHARE/pm_test.reboot.3.log ] && sleep_time_check $PLAINBOX_SESSION_SHARE/pm_test.reboot.3.log
103+_description:
104+ Checks the sleep times to ensure that a machine suspends and resumes within a given threshold
105+
106+plugin: shell
107+category_id: 2013.com.canonical.plainbox::stress
108 id: stress/hibernate_250_cycles
109 estimated_duration: 43400.0
110 depends: power-management/rtc

Subscribers

People subscribed via source and target branches