| OLD | NEW |
| 1 import re, os | 1 import re, os |
| 2 | 2 |
| 3 from autotest_lib.client.common_lib import utils as common_utils | 3 from autotest_lib.client.common_lib import utils as common_utils |
| 4 from autotest_lib.tko import utils as tko_utils, models, status_lib | 4 from autotest_lib.tko import utils as tko_utils, models, status_lib |
| 5 from autotest_lib.tko.parsers import base | 5 from autotest_lib.tko.parsers import base |
| 6 | 6 |
| 7 | 7 |
| 8 class NoHostnameError(Exception): | 8 class NoHostnameError(Exception): |
| 9 pass | 9 pass |
| 10 | 10 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 # split the line into the fixed and optional fields | 257 # split the line into the fixed and optional fields |
| 258 parts = line.rstrip("\n").split("\t") | 258 parts = line.rstrip("\n").split("\t") |
| 259 | 259 |
| 260 part_index = 3 | 260 part_index = 3 |
| 261 status, subdir, testname = parts[0:part_index] | 261 status, subdir, testname = parts[0:part_index] |
| 262 | 262 |
| 263 # all optional parts should be of the form "key=value". once we've found | 263 # all optional parts should be of the form "key=value". once we've found |
| 264 # a non-matching part, treat it and the rest of the parts as the reason. | 264 # a non-matching part, treat it and the rest of the parts as the reason. |
| 265 optional_fields = {} | 265 optional_fields = {} |
| 266 while part_index < len(parts): | 266 while part_index < len(parts): |
| 267 kv = re.search(r"^(\w+)=(.+)", parts[part_index]) | 267 kv = re.search(r"^(\w+)=(.+)", parts[part_index]) |
| 268 if not kv: | 268 if not kv: |
| 269 break | 269 break |
| 270 | 270 |
| 271 optional_fields[kv.group(1)] = kv.group(2) | 271 optional_fields[kv.group(1)] = kv.group(2) |
| 272 part_index += 1 | 272 part_index += 1 |
| 273 | 273 |
| 274 reason = "\t".join(parts[part_index:]) | 274 reason = "\t".join(parts[part_index:]) |
| 275 | 275 |
| 276 # build up a new status_line and return it | 276 # build up a new status_line and return it |
| 277 return cls(indent, status, subdir, testname, reason, | 277 return cls(indent, status, subdir, testname, reason, |
| 278 optional_fields) | 278 optional_fields) |
| 279 | 279 |
| 280 | 280 |
| 281 class parser(base.parser): | 281 class parser(base.parser): |
| 282 @staticmethod | 282 @staticmethod |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 testname = "boot.%d" % boot_count | 445 testname = "boot.%d" % boot_count |
| 446 reason = "machine did not return from reboot" | 446 reason = "machine did not return from reboot" |
| 447 tko_utils.dprint(("Adding: ABORT\nSubdir:----\n" | 447 tko_utils.dprint(("Adding: ABORT\nSubdir:----\n" |
| 448 "Testname:%s\n%s") | 448 "Testname:%s\n%s") |
| 449 % (testname, reason)) | 449 % (testname, reason)) |
| 450 new_test = test.parse_test(self.job, None, testname, | 450 new_test = test.parse_test(self.job, None, testname, |
| 451 "ABORT", reason, | 451 "ABORT", reason, |
| 452 current_kernel, None, None) | 452 current_kernel, None, None) |
| 453 new_tests.append(new_test) | 453 new_tests.append(new_test) |
| 454 yield new_tests | 454 yield new_tests |
| OLD | NEW |