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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 started_time) | 278 started_time) |
279 msg = "RUNNING: %s\nSubdir: %s\nTestname: %s\n%s" | 279 msg = "RUNNING: %s\nSubdir: %s\nTestname: %s\n%s" |
280 msg %= (running_test.status, running_test.subdir, | 280 msg %= (running_test.status, running_test.subdir, |
281 running_test.testname, running_test.reason) | 281 running_test.testname, running_test.reason) |
282 tko_utils.dprint(msg) | 282 tko_utils.dprint(msg) |
283 new_tests.append(running_test) | 283 new_tests.append(running_test) |
284 started_time_stack.append(started_time) | 284 started_time_stack.append(started_time) |
285 subdir_stack.append(line.subdir) | 285 subdir_stack.append(line.subdir) |
286 continue | 286 continue |
287 elif line.type == "INFO": | 287 elif line.type == "INFO": |
| 288 fields = line.optional_fields |
288 # update the current kernel if one is defined in the info | 289 # update the current kernel if one is defined in the info |
289 if "kernel" in line.optional_fields: | 290 if "kernel" in fields: |
290 current_kernel = line.get_kernel() | 291 current_kernel = line.get_kernel() |
| 292 # update the SERVER_JOB reason if one was logged for an abort |
| 293 if "job_abort_reason" in fields: |
| 294 running_job.reason = fields["job_abort_reason"] |
| 295 new_tests.append(running_job) |
291 continue | 296 continue |
292 elif line.type == "STATUS": | 297 elif line.type == "STATUS": |
293 # update the stacks | 298 # update the stacks |
294 if line.subdir and stack.size() > min_stack_size: | 299 if line.subdir and stack.size() > min_stack_size: |
295 subdir_stack[-1] = line.subdir | 300 subdir_stack[-1] = line.subdir |
296 # update the status, start and finished times | 301 # update the status, start and finished times |
297 stack.update(line.status) | 302 stack.update(line.status) |
298 if status_lib.is_worse_than_or_equal_to(line.status, | 303 if status_lib.is_worse_than_or_equal_to(line.status, |
299 current_status): | 304 current_status): |
300 if line.reason: | 305 if line.reason: |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 if new_test.testname == ("boot.%d" % boot_count): | 383 if new_test.testname == ("boot.%d" % boot_count): |
379 boot_count += 1 | 384 boot_count += 1 |
380 msg = "ADD: %s\nSubdir: %s\nTestname: %s\n%s" | 385 msg = "ADD: %s\nSubdir: %s\nTestname: %s\n%s" |
381 msg %= (new_test.status, new_test.subdir, | 386 msg %= (new_test.status, new_test.subdir, |
382 new_test.testname, new_test.reason) | 387 new_test.testname, new_test.reason) |
383 tko_utils.dprint(msg) | 388 tko_utils.dprint(msg) |
384 new_tests.append(new_test) | 389 new_tests.append(new_test) |
385 | 390 |
386 # 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 |
387 final_job = test.parse_test(self.job, "----", "SERVER_JOB", | 392 final_job = test.parse_test(self.job, "----", "SERVER_JOB", |
388 self.job.exit_status(), "", | 393 self.job.exit_status(), running_job.reason, |
389 current_kernel, | 394 current_kernel, |
390 self.job.started_time, | 395 self.job.started_time, |
391 self.job.finished_time, | 396 self.job.finished_time, |
392 running_job) | 397 running_job) |
393 new_tests.append(final_job) | 398 new_tests.append(final_job) |
394 yield new_tests | 399 yield new_tests |
OLD | NEW |