Merge lp:~brendan-donegan/checkbox/bug1184688 into lp:checkbox

Proposed by Brendan Donegan
Status: Merged
Approved by: Zygmunt Krynicki
Approved revision: 2405
Merged at revision: 2407
Proposed branch: lp:~brendan-donegan/checkbox/bug1184688
Merge into: lp:checkbox
Diff against target: 127 lines (+25/-20)
2 files modified
checkbox-old/debian/changelog (+2/-0)
checkbox-old/scripts/memory_test (+23/-20)
To merge this branch: bzr merge lp:~brendan-donegan/checkbox/bug1184688
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Review via email: mp+188600@code.launchpad.net

Description of the change

Because ARM wasn't included when considering whether to impose a 32-bit per process memory limit in this test, the threaded_memtest app was being instructed to address more memory than it was able to. We just add 'arm.*' as an arch that should have this limit imposed. This works because the arch for ARM 64-bit is 'aarch64', so it won't match with 'arm.*'

To post a comment you must log in.
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

a15 has pae support so we may want to take this into account as well, although i note that pae is not recognized by the script anyway so that might be something we take care of later.

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 'checkbox-old/debian/changelog'
2--- checkbox-old/debian/changelog 2013-09-30 09:19:16 +0000
3+++ checkbox-old/debian/changelog 2013-10-01 13:42:28 +0000
4@@ -8,6 +8,8 @@
5 [ Brendan Donegan ]
6 * scripts/virtualization - change kvm command to qemu-system-x86_64 as the
7 former is deprecated (LP: #1224854)
8+ * scripts/memory_test - use per-process memory limit if arch is ARM, except
9+ for arm64 (LP: #1184688)
10
11 -- Brendan Donegan <brendan.donegan@canonical.com> Fri, 20 Sep 2013 16:10:13 +0100
12
13
14=== modified file 'checkbox-old/scripts/memory_test'
15--- checkbox-old/scripts/memory_test 2013-05-29 07:50:30 +0000
16+++ checkbox-old/scripts/memory_test 2013-10-01 13:42:28 +0000
17@@ -44,17 +44,17 @@
18 else:
19 break
20 except Exception as e:
21- print("ERROR: Unable to get data from /proc/meminfo", file=sys.stderr)
22+ print("ERROR: Unable to get data from /proc/meminfo",
23+ file=sys.stderr)
24 print(e, file=sys.stderr)
25 finally:
26 mem_info.close()
27
28 def _command(self, command, shell=True):
29 proc = Popen(command,
30- shell=shell,
31- stdout=PIPE,
32- stderr=PIPE
33- )
34+ shell=shell,
35+ stdout=PIPE,
36+ stderr=PIPE)
37 return proc
38
39 def _command_out(self, command, shell=True):
40@@ -75,14 +75,16 @@
41 self.process_memory = self.free_memory
42 try:
43 arch = self._command_out("arch").decode()
44- if re.match(r"(i[0-9]86|s390)", arch) and self.free_memory > 1024:
45+ if (re.match(r"(i[0-9]86|s390|arm.*)", arch)
46+ and self.free_memory > 1024):
47 self.is_process_limited = True
48 self.process_memory = 1024 # MB, due to 32-bit address space
49- print("%s arch, Limiting Process Memory: %u" % (arch,
50- self.process_memory))
51+ print("%s arch, Limiting Process Memory: %u" % (
52+ arch, self.process_memory))
53 # others? what about PAE kernel?
54 except Exception as e:
55- print("ERROR: could not determine system architecture via arch", file=sys.stderr)
56+ print("ERROR: could not determine system architecture via arch",
57+ file=sys.stderr)
58 print(e, file=sys.stderr)
59 return False
60 return True
61@@ -122,8 +124,8 @@
62 required_memory = self.process_memory * processes
63 if required_memory > self.system_memory + self.swap_memory:
64 print("ERROR: this test requires a minimum of %u KB of swap "
65- "memory (%u configured)"
66- % (required_memory - self.system_memory,
67+ "memory (%u configured)" % (
68+ required_memory - self.system_memory,
69 self.swap_memory), file=sys.stderr)
70 print("Testing memory with %u processes" % processes)
71
72@@ -131,7 +133,8 @@
73 run_time = 60 # sec.
74 if not self.run_processes(processes, "%s -qpv -m%um -t%u" % (
75 self.threaded_memtest_script, self.process_memory, run_time)):
76- print("Multi-process, threaded memory Test FAILED", file=sys.stderr)
77+ print("Multi-process, threaded memory Test FAILED",
78+ file=sys.stderr)
79 return False
80
81 return True
82@@ -153,9 +156,9 @@
83 # is there enough swap memory for the test?
84 if memory > self.system_memory + self.swap_memory:
85 print("ERROR: this test requires a minimum of %u KB of swap "
86- "memory (%u configured)"
87- % (memory - self.system_memory, self.swap_memory),
88- file=sys.stderr)
89+ "memory (%u configured)"
90+ % (memory - self.system_memory, self.swap_memory),
91+ file=sys.stderr)
92 return False
93
94 # otherwise
95@@ -170,7 +173,7 @@
96 process.communicate()
97 if process.returncode != 0:
98 print("%s returned code %s" % (self.threaded_memtest_script,
99- process.returncode), file=sys.stderr)
100+ process.returncode), file=sys.stderr)
101 print("More Than Free Memory Test failed", file=sys.stderr)
102 return False
103 print("More than free memory test complete.")
104@@ -208,11 +211,11 @@
105 return_value = pipe[i].poll()
106 if return_value != 0:
107 print("ERROR: process %u pid %u retuned %u"
108- % (i, pipe[i].pid, return_value),
109- file=sys.stderr)
110+ % (i, pipe[i].pid, return_value),
111+ file=sys.stderr)
112 passed = False
113 print("process %u pid %u returned success"
114- % (i, pipe[i].pid))
115+ % (i, pipe[i].pid))
116 pipe[i] = None
117 sys.stdout.flush()
118 return passed
119@@ -221,7 +224,7 @@
120 def main(args):
121 parser = ArgumentParser()
122 parser.add_argument("-q", "--quiet", action="store_true",
123- help="Suppress output.")
124+ help="Suppress output.")
125 args = parser.parse_args(args)
126
127 if args.quiet:

Subscribers

People subscribed via source and target branches