diff options
author | Ross Burton <ross.burton@arm.com> | 2023-09-23 14:04:09 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-09-26 10:25:42 +0100 |
commit | 17dbdc677a15b69a480a0e1aed5d077e02db8fb2 (patch) | |
tree | 1e60bb643722571a70dfca5f04a400234e97dea3 | |
parent | 50c637e6dc85168cefe0a6e87f39b4903e76efa4 (diff) | |
download | poky-17dbdc677a15b69a480a0e1aed5d077e02db8fb2.tar.gz |
oeqa/runtime/parselogs: move some variables out of global scope
errors and log_locations can be trivially set in the class directly,
instead of being defined in the module and then copied into the class.
(From OE-Core rev: dd1416b719a30b18f21916d50fa431a88503918f)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/runtime/cases/parselogs.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/meta/lib/oeqa/runtime/cases/parselogs.py b/meta/lib/oeqa/runtime/cases/parselogs.py index 0262f574d1..3f205661ea 100644 --- a/meta/lib/oeqa/runtime/cases/parselogs.py +++ b/meta/lib/oeqa/runtime/cases/parselogs.py | |||
@@ -11,9 +11,6 @@ from shutil import rmtree | |||
11 | from oeqa.runtime.case import OERuntimeTestCase | 11 | from oeqa.runtime.case import OERuntimeTestCase |
12 | from oeqa.core.decorator.depends import OETestDepends | 12 | from oeqa.core.decorator.depends import OETestDepends |
13 | 13 | ||
14 | #in the future these lists could be moved outside of module | ||
15 | errors = ["error", "cannot", "can\'t", "failed"] | ||
16 | |||
17 | common_errors = [ | 14 | common_errors = [ |
18 | "(WW) warning, (EE) error, (NI) not implemented, (??) unknown.", | 15 | "(WW) warning, (EE) error, (NI) not implemented, (??) unknown.", |
19 | "dma timeout", | 16 | "dma timeout", |
@@ -201,17 +198,19 @@ ignore_errors = { | |||
201 | ] + common_errors, | 198 | ] + common_errors, |
202 | } | 199 | } |
203 | 200 | ||
204 | log_locations = ["/var/log/","/var/log/dmesg", "/tmp/dmesg_output.log"] | ||
205 | |||
206 | class ParseLogsTest(OERuntimeTestCase): | 201 | class ParseLogsTest(OERuntimeTestCase): |
207 | 202 | ||
203 | # Which log files should be collected | ||
204 | log_locations = ["/var/log/", "/var/log/dmesg", "/tmp/dmesg_output.log"] | ||
205 | |||
206 | # The keywords that identify error messages in the log files | ||
207 | errors = ["error", "cannot", "can't", "failed"] | ||
208 | |||
208 | @classmethod | 209 | @classmethod |
209 | def setUpClass(cls): | 210 | def setUpClass(cls): |
210 | cls.errors = errors | ||
211 | |||
212 | # When systemd is enabled we need to notice errors on | 211 | # When systemd is enabled we need to notice errors on |
213 | # circular dependencies in units. | 212 | # circular dependencies in units. |
214 | if 'systemd' in cls.td.get('DISTRO_FEATURES', ''): | 213 | if 'systemd' in cls.td.get('DISTRO_FEATURES'): |
215 | cls.errors.extend([ | 214 | cls.errors.extend([ |
216 | 'Found ordering cycle on', | 215 | 'Found ordering cycle on', |
217 | 'Breaking ordering cycle by deleting job', | 216 | 'Breaking ordering cycle by deleting job', |
@@ -220,8 +219,6 @@ class ParseLogsTest(OERuntimeTestCase): | |||
220 | ]) | 219 | ]) |
221 | 220 | ||
222 | cls.ignore_errors = ignore_errors | 221 | cls.ignore_errors = ignore_errors |
223 | cls.log_locations = log_locations | ||
224 | cls.msg = '' | ||
225 | 222 | ||
226 | # Go through the log locations provided and if it's a folder | 223 | # Go through the log locations provided and if it's a folder |
227 | # create a list with all the .log files in it, if it's a file | 224 | # create a list with all the .log files in it, if it's a file |
@@ -338,7 +335,9 @@ class ParseLogsTest(OERuntimeTestCase): | |||
338 | self.write_dmesg() | 335 | self.write_dmesg() |
339 | log_list = self.get_local_log_list(self.log_locations) | 336 | log_list = self.get_local_log_list(self.log_locations) |
340 | result = self.parse_logs(log_list) | 337 | result = self.parse_logs(log_list) |
338 | |||
341 | errcount = 0 | 339 | errcount = 0 |
340 | self.msg = "" | ||
342 | for log in result: | 341 | for log in result: |
343 | self.msg += 'Log: ' + log + '\n' | 342 | self.msg += 'Log: ' + log + '\n' |
344 | self.msg += '-----------------------\n' | 343 | self.msg += '-----------------------\n' |