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 if val_type == "attr": | 73 try: |
74 attr_dict[key] = value | 74 if val_type == "attr": |
75 elif val_type == "perf" and re.search("^\d+(\.\d+)?$", value): | 75 attr_dict[key] = value |
76 perf_dict[key] = float(value) | 76 elif val_type == "perf": |
77 else: | 77 perf_dict[key] = float(value) |
| 78 else: |
| 79 raise ValueError |
| 80 except ValueError: |
78 msg = ("WARNING: line '%s' found in test " | 81 msg = ("WARNING: line '%s' found in test " |
79 "iteration keyval could not be parsed") | 82 "iteration keyval could not be parsed") |
80 msg %= line | 83 msg %= line |
81 tko_utils.dprint(msg) | 84 tko_utils.dprint(msg) |
82 | 85 |
83 | 86 |
84 class status_line(version_0.status_line): | 87 class status_line(version_0.status_line): |
85 def __init__(self, indent, status, subdir, testname, reason, | 88 def __init__(self, indent, status, subdir, testname, reason, |
86 optional_fields): | 89 optional_fields): |
87 # handle INFO fields | 90 # handle INFO fields |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 | 393 |
391 # the job is finished, produce the final SERVER_JOB entry and exit | 394 # the job is finished, produce the final SERVER_JOB entry and exit |
392 final_job = test.parse_test(self.job, "----", "SERVER_JOB", | 395 final_job = test.parse_test(self.job, "----", "SERVER_JOB", |
393 self.job.exit_status(), running_job.reason, | 396 self.job.exit_status(), running_job.reason, |
394 current_kernel, | 397 current_kernel, |
395 self.job.started_time, | 398 self.job.started_time, |
396 self.job.finished_time, | 399 self.job.finished_time, |
397 running_job) | 400 running_job) |
398 new_tests.append(final_job) | 401 new_tests.append(final_job) |
399 yield new_tests | 402 yield new_tests |
OLD | NEW |