diff options
| -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' |
