diff options
| author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-01-27 11:20:02 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-02-01 07:31:18 +0000 |
| commit | 98deacdb55780232d958d9b10ce8feeebc870802 (patch) | |
| tree | b4dd1719fd62b4af14e8f2873a3caec40a956ce8 /meta/lib/oeqa/utils/logparser.py | |
| parent | 064ca10c503a7c1c27534233cca701e69ac43401 (diff) | |
| download | poky-98deacdb55780232d958d9b10ce8feeebc870802.tar.gz | |
ltp: update 20210927 -> 20220121
The ltp compliancy parser is rewritten to actually
match the logs: they seem to be unstructured, test case names
are not printed and the only indication of failure is appearance of
FAIL[ED] somewhere.
(From OE-Core rev: 52766561dbfee625c89393905a85e10d85f69c6c)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils/logparser.py')
| -rw-r--r-- | meta/lib/oeqa/utils/logparser.py | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/meta/lib/oeqa/utils/logparser.py b/meta/lib/oeqa/utils/logparser.py index 60e16d500e..879aefca33 100644 --- a/meta/lib/oeqa/utils/logparser.py +++ b/meta/lib/oeqa/utils/logparser.py | |||
| @@ -135,30 +135,27 @@ class LtpComplianceParser(object): | |||
| 135 | 135 | ||
| 136 | def parse(self, logfile): | 136 | def parse(self, logfile): |
| 137 | test_regex = {} | 137 | test_regex = {} |
| 138 | test_regex['PASSED'] = re.compile(r"^PASS") | 138 | test_regex['FAILED'] = re.compile(r"FAIL") |
| 139 | test_regex['FAILED'] = re.compile(r"^FAIL") | ||
| 140 | test_regex['SKIPPED'] = re.compile(r"(?:UNTESTED)|(?:UNSUPPORTED)") | ||
| 141 | 139 | ||
| 142 | section_regex = {} | 140 | section_regex = {} |
| 143 | section_regex['test'] = re.compile(r"^Testing") | 141 | section_regex['test'] = re.compile(r"^Executing") |
| 144 | 142 | ||
| 145 | with open(logfile, errors='replace') as f: | 143 | with open(logfile, errors='replace') as f: |
| 144 | name = logfile | ||
| 145 | result = "PASSED" | ||
| 146 | for line in f: | 146 | for line in f: |
| 147 | result = section_regex['test'].search(line) | 147 | regex_result = section_regex['test'].search(line) |
| 148 | if result: | 148 | if regex_result: |
| 149 | self.name = "" | 149 | name = line.split()[1].strip() |
| 150 | self.name = line.split()[1].strip() | ||
| 151 | self.results[self.name] = "PASSED" | ||
| 152 | failed = 0 | ||
| 153 | 150 | ||
| 154 | failed_result = test_regex['FAILED'].search(line) | 151 | regex_result = test_regex['FAILED'].search(line) |
| 155 | if failed_result: | 152 | if regex_result: |
| 156 | failed = line.split()[1].strip() | 153 | result = "FAILED" |
| 157 | if int(failed) > 0: | 154 | self.results[name] = result |
| 158 | self.results[self.name] = "FAILED" | ||
| 159 | 155 | ||
| 160 | for test in self.results: | 156 | for test in self.results: |
| 161 | result = self.results[test] | 157 | result = self.results[test] |
| 158 | print (self.results) | ||
| 162 | self.section['log'] = self.section['log'] + ("%s: %s\n" % (result.strip()[:-2], test.strip())) | 159 | self.section['log'] = self.section['log'] + ("%s: %s\n" % (result.strip()[:-2], test.strip())) |
| 163 | 160 | ||
| 164 | return self.results, self.section | 161 | return self.results, self.section |
