Merge lp:~bladernr/checkbox/1072666-improve-memory-info-output into lp:checkbox

Proposed by Jeff Lane 
Status: Merged
Approved by: Zygmunt Krynicki
Approved revision: 2093
Merged at revision: 2095
Proposed branch: lp:~bladernr/checkbox/1072666-improve-memory-info-output
Merge into: lp:checkbox
Diff against target: 43 lines (+8/-3)
2 files modified
debian/changelog (+2/-0)
scripts/memory_compare (+6/-3)
To merge this branch: bzr merge lp:~bladernr/checkbox/1072666-improve-memory-info-output
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Jeff Lane  Needs Resubmitting
Review via email: mp+161027@code.launchpad.net

Description of the change

Improved the output of memory_compare to make it a bit easier to parse as well as making the final ruling more explanatory. The original text was a bit confusing.

To post a comment you must log in.
2088. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

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

Obviously there is a rebase necessary

Thanks
ZK

review: Needs Fixing
2089. By Brendan Donegan

"[r=zkrynicki][bug=1173103][author=brendan-donegan] automatic merge by tarmac"

2090. By Daniel Manrique

"[r=zkrynicki][bug=][author=roadmr] plainbox sru: Better handling of server return data, particularly to output the submission status URL if it's in the response"

2091. By Brendan Donegan

Incremented version in changelog

2092. By Zygmunt Krynicki

"[r=zkrynicki][bug=1172835][author=roadmr] xml: Set OPTION_WITH_COMMENTS so they get exported. Actually set the comment when a job has OUTCOME_NOT_SUPPORTED."

2093. By Jeff Lane 

rebased

Revision history for this message
Jeff Lane  (bladernr) wrote :

rebased

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

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-04-26 17:26:20 +0000
3+++ debian/changelog 2013-04-30 19:59:26 +0000
4@@ -31,6 +31,8 @@
5 the dpkg bit verifies obexftp is installed (LP: #1169488)
6 * jobs/networking.txt.in: fixed networking/info jobs that were not being run
7 because $output was being resolved too early (LP: #1065983)
8+ * scripts/memory_compare: cleaned up the output to be more explanatory and
9+ easier to visually parse (LP: #1072666)
10
11 [ Daniel Manrique ]
12 * scripts/alsa_record_playback: Replaced alsasrc with autoaudiosrc
13
14=== modified file 'scripts/memory_compare'
15--- scripts/memory_compare 2012-12-11 18:16:13 +0000
16+++ scripts/memory_compare 2013-04-30 19:59:26 +0000
17@@ -55,20 +55,23 @@
18 try:
19 percentage = difference / installed_memory * 100
20 except ZeroDivisionError:
21- print("FAIL: Either dmi or /proc/meminfo returned a memory size of 0 kB", file=sys.stderr)
22+ print("Results:")
23 print("\t/proc/meminfo reports:\t%s kB" % visible_memory, file=sys.stderr)
24 print("\tdmi reports:\t%s kB" % installed_memory, file=sys.stderr)
25+ print("\nFAIL: Either dmi or /proc/meminfo returned a memory size of 0 kB", file=sys.stderr)
26 return 1
27
28 if percentage <= THRESHOLD:
29- print("PASS: Difference is %d bytes (%.2f%%) and less than the %d%% threshold." % (difference, percentage, THRESHOLD))
30+ print("Results:")
31 print("\t/proc/meminfo reports:\t%s kB" % visible_memory)
32 print("\tdmi reports:\t%s kB" % installed_memory)
33+ print("\nPASS: Meminfo reports %d bytes less than DMI, a difference of %.2f%%. This is less than the %d%% variance allowed." % (difference, percentage, THRESHOLD))
34 return 0
35 else:
36- print("FAIL: Difference is %d bytes (%.2f%%) and greater than the %d%% threshold." % (difference, percentage, THRESHOLD), file=sys.stderr)
37+ print("Results")
38 print("\t/proc/meminfo reports:\t%s kB" % visible_memory, file=sys.stderr)
39 print("\tdmi reports:\t%s kB" % installed_memory, file=sys.stderr)
40+ print("\nFAIL: Meminfo reports %d bytes less than DMI, a difference of %.2f%%. Only a variance of %d%% in reported memory is allowed." % (difference, percentage, THRESHOLD), file=sys.stderr)
41 return 1
42
43 if __name__ == "__main__":

Subscribers

People subscribed via source and target branches