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