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
=== modified file 'checkbox-old/debian/changelog'
--- checkbox-old/debian/changelog 2013-09-30 09:19:16 +0000
+++ checkbox-old/debian/changelog 2013-10-01 13:42:28 +0000
@@ -8,6 +8,8 @@
8 [ Brendan Donegan ] 8 [ Brendan Donegan ]
9 * scripts/virtualization - change kvm command to qemu-system-x86_64 as the 9 * scripts/virtualization - change kvm command to qemu-system-x86_64 as the
10 former is deprecated (LP: #1224854)10 former is deprecated (LP: #1224854)
11 * scripts/memory_test - use per-process memory limit if arch is ARM, except
12 for arm64 (LP: #1184688)
1113
12 -- Brendan Donegan <brendan.donegan@canonical.com> Fri, 20 Sep 2013 16:10:13 +010014 -- Brendan Donegan <brendan.donegan@canonical.com> Fri, 20 Sep 2013 16:10:13 +0100
1315
1416
=== modified file 'checkbox-old/scripts/memory_test'
--- checkbox-old/scripts/memory_test 2013-05-29 07:50:30 +0000
+++ checkbox-old/scripts/memory_test 2013-10-01 13:42:28 +0000
@@ -44,17 +44,17 @@
44 else:44 else:
45 break45 break
46 except Exception as e:46 except Exception as e:
47 print("ERROR: Unable to get data from /proc/meminfo", file=sys.stderr)47 print("ERROR: Unable to get data from /proc/meminfo",
48 file=sys.stderr)
48 print(e, file=sys.stderr)49 print(e, file=sys.stderr)
49 finally:50 finally:
50 mem_info.close()51 mem_info.close()
5152
52 def _command(self, command, shell=True):53 def _command(self, command, shell=True):
53 proc = Popen(command,54 proc = Popen(command,
54 shell=shell,55 shell=shell,
55 stdout=PIPE,56 stdout=PIPE,
56 stderr=PIPE57 stderr=PIPE)
57 )
58 return proc58 return proc
5959
60 def _command_out(self, command, shell=True):60 def _command_out(self, command, shell=True):
@@ -75,14 +75,16 @@
75 self.process_memory = self.free_memory75 self.process_memory = self.free_memory
76 try:76 try:
77 arch = self._command_out("arch").decode()77 arch = self._command_out("arch").decode()
78 if re.match(r"(i[0-9]86|s390)", arch) and self.free_memory > 1024:78 if (re.match(r"(i[0-9]86|s390|arm.*)", arch)
79 and self.free_memory > 1024):
79 self.is_process_limited = True80 self.is_process_limited = True
80 self.process_memory = 1024 # MB, due to 32-bit address space81 self.process_memory = 1024 # MB, due to 32-bit address space
81 print("%s arch, Limiting Process Memory: %u" % (arch,82 print("%s arch, Limiting Process Memory: %u" % (
82 self.process_memory))83 arch, self.process_memory))
83 # others? what about PAE kernel?84 # others? what about PAE kernel?
84 except Exception as e:85 except Exception as e:
85 print("ERROR: could not determine system architecture via arch", file=sys.stderr)86 print("ERROR: could not determine system architecture via arch",
87 file=sys.stderr)
86 print(e, file=sys.stderr)88 print(e, file=sys.stderr)
87 return False89 return False
88 return True90 return True
@@ -122,8 +124,8 @@
122 required_memory = self.process_memory * processes124 required_memory = self.process_memory * processes
123 if required_memory > self.system_memory + self.swap_memory:125 if required_memory > self.system_memory + self.swap_memory:
124 print("ERROR: this test requires a minimum of %u KB of swap "126 print("ERROR: this test requires a minimum of %u KB of swap "
125 "memory (%u configured)"127 "memory (%u configured)" % (
126 % (required_memory - self.system_memory,128 required_memory - self.system_memory,
127 self.swap_memory), file=sys.stderr)129 self.swap_memory), file=sys.stderr)
128 print("Testing memory with %u processes" % processes)130 print("Testing memory with %u processes" % processes)
129131
@@ -131,7 +133,8 @@
131 run_time = 60 # sec.133 run_time = 60 # sec.
132 if not self.run_processes(processes, "%s -qpv -m%um -t%u" % (134 if not self.run_processes(processes, "%s -qpv -m%um -t%u" % (
133 self.threaded_memtest_script, self.process_memory, run_time)):135 self.threaded_memtest_script, self.process_memory, run_time)):
134 print("Multi-process, threaded memory Test FAILED", file=sys.stderr)136 print("Multi-process, threaded memory Test FAILED",
137 file=sys.stderr)
135 return False138 return False
136139
137 return True140 return True
@@ -153,9 +156,9 @@
153 # is there enough swap memory for the test?156 # is there enough swap memory for the test?
154 if memory > self.system_memory + self.swap_memory:157 if memory > self.system_memory + self.swap_memory:
155 print("ERROR: this test requires a minimum of %u KB of swap "158 print("ERROR: this test requires a minimum of %u KB of swap "
156 "memory (%u configured)"159 "memory (%u configured)"
157 % (memory - self.system_memory, self.swap_memory),160 % (memory - self.system_memory, self.swap_memory),
158 file=sys.stderr)161 file=sys.stderr)
159 return False162 return False
160163
161 # otherwise164 # otherwise
@@ -170,7 +173,7 @@
170 process.communicate()173 process.communicate()
171 if process.returncode != 0:174 if process.returncode != 0:
172 print("%s returned code %s" % (self.threaded_memtest_script,175 print("%s returned code %s" % (self.threaded_memtest_script,
173 process.returncode), file=sys.stderr)176 process.returncode), file=sys.stderr)
174 print("More Than Free Memory Test failed", file=sys.stderr)177 print("More Than Free Memory Test failed", file=sys.stderr)
175 return False178 return False
176 print("More than free memory test complete.")179 print("More than free memory test complete.")
@@ -208,11 +211,11 @@
208 return_value = pipe[i].poll()211 return_value = pipe[i].poll()
209 if return_value != 0:212 if return_value != 0:
210 print("ERROR: process %u pid %u retuned %u"213 print("ERROR: process %u pid %u retuned %u"
211 % (i, pipe[i].pid, return_value),214 % (i, pipe[i].pid, return_value),
212 file=sys.stderr)215 file=sys.stderr)
213 passed = False216 passed = False
214 print("process %u pid %u returned success"217 print("process %u pid %u returned success"
215 % (i, pipe[i].pid))218 % (i, pipe[i].pid))
216 pipe[i] = None219 pipe[i] = None
217 sys.stdout.flush()220 sys.stdout.flush()
218 return passed221 return passed
@@ -221,7 +224,7 @@
221def main(args):224def main(args):
222 parser = ArgumentParser()225 parser = ArgumentParser()
223 parser.add_argument("-q", "--quiet", action="store_true",226 parser.add_argument("-q", "--quiet", action="store_true",
224 help="Suppress output.")227 help="Suppress output.")
225 args = parser.parse_args(args)228 args = parser.parse_args(args)
226229
227 if args.quiet:230 if args.quiet:

Subscribers

People subscribed via source and target branches