| OLD | NEW |
| 1 import os, re, time | 1 import os, re, time |
| 2 | 2 |
| 3 from autotest_lib.tko import models, status_lib, utils as tko_utils | 3 from autotest_lib.tko import models, status_lib, utils as tko_utils |
| 4 from autotest_lib.tko.parsers import base, version_0 | 4 from autotest_lib.tko.parsers import base, version_0 |
| 5 | 5 |
| 6 | 6 |
| 7 class job(version_0.job): | 7 class job(version_0.job): |
| 8 def exit_status(self): | 8 def exit_status(self): |
| 9 # find the .autoserv_execute path | 9 # find the .autoserv_execute path |
| 10 top_dir = tko_utils.find_toplevel_job_dir(self.dir) | 10 top_dir = tko_utils.find_toplevel_job_dir(self.dir) |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 if typed_match: | 63 if typed_match: |
| 64 key, val_type, value = typed_match.groups() | 64 key, val_type, value = typed_match.groups() |
| 65 else: | 65 else: |
| 66 # old-fashioned untyped match, assume perf | 66 # old-fashioned untyped match, assume perf |
| 67 untyped_match = re.search("^([^=]*)=(.*)$", line) | 67 untyped_match = re.search("^([^=]*)=(.*)$", line) |
| 68 if untyped_match: | 68 if untyped_match: |
| 69 key, value = untyped_match.groups() | 69 key, value = untyped_match.groups() |
| 70 val_type = "perf" | 70 val_type = "perf" |
| 71 | 71 |
| 72 # parse the actual value into a dict | 72 # parse the actual value into a dict |
| 73 try: | 73 if val_type == "attr": |
| 74 if val_type == "attr": | 74 attr_dict[key] = value |
| 75 attr_dict[key] = value | 75 elif val_type == "perf" and re.search("^\d+(\.\d+)?$", value): |
| 76 elif val_type == "perf": | 76 perf_dict[key] = float(value) |
| 77 perf_dict[key] = float(value) | 77 else: |
| 78 else: | |
| 79 raise ValueError | |
| 80 except ValueError: | |
| 81 msg = ("WARNING: line '%s' found in test " | 78 msg = ("WARNING: line '%s' found in test " |
| 82 "iteration keyval could not be parsed") | 79 "iteration keyval could not be parsed") |
| 83 msg %= line | 80 msg %= line |
| 84 tko_utils.dprint(msg) | 81 tko_utils.dprint(msg) |
| 85 | 82 |
| 86 | 83 |
| 87 class status_line(version_0.status_line): | 84 class status_line(version_0.status_line): |
| 88 def __init__(self, indent, status, subdir, testname, reason, | 85 def __init__(self, indent, status, subdir, testname, reason, |
| 89 optional_fields): | 86 optional_fields): |
| 90 # handle INFO fields | 87 # handle INFO fields |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 | 390 |
| 394 # the job is finished, produce the final SERVER_JOB entry and exit | 391 # the job is finished, produce the final SERVER_JOB entry and exit |
| 395 final_job = test.parse_test(self.job, "----", "SERVER_JOB", | 392 final_job = test.parse_test(self.job, "----", "SERVER_JOB", |
| 396 self.job.exit_status(), running_job.reason, | 393 self.job.exit_status(), running_job.reason, |
| 397 current_kernel, | 394 current_kernel, |
| 398 self.job.started_time, | 395 self.job.started_time, |
| 399 self.job.finished_time, | 396 self.job.finished_time, |
| 400 running_job) | 397 running_job) |
| 401 new_tests.append(final_job) | 398 new_tests.append(final_job) |
| 402 yield new_tests | 399 yield new_tests |
| OLD | NEW |