summaryrefslogtreecommitdiff
path: root/tko/parsers
diff options
context:
space:
mode:
authorjadmanski <jadmanski@592f7852-d20e-0410-864c-8624ca9c26a4>2008-12-02 15:22:21 +0000
committerjadmanski <jadmanski@592f7852-d20e-0410-864c-8624ca9c26a4>2008-12-02 15:22:21 +0000
commit393793c5bf60d7c5b11c29f1dff2647a0f5e176b (patch)
tree0c64d75debdab3d7ee8f5a6d7d58572ee2d849c2 /tko/parsers
parent82b7ffbd62efe12cdb95b53644785283b33c1ecb (diff)
Add a dummy SERVER_JOB test result in TKO that we use to represent
the entire job. This will avoid the case where you have jobs that run and fail without any results at all being generated from them (because they don't get as far as running a test). Risk: Medium Visibility: Adds an extra dummy test result for every job. Signed-off-by: John Admanski <jadmanski@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@2527 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'tko/parsers')
-rw-r--r--tko/parsers/version_1.py42
1 files changed, 40 insertions, 2 deletions
diff --git a/tko/parsers/version_1.py b/tko/parsers/version_1.py
index ad01cbc2..67d1b427 100644
--- a/tko/parsers/version_1.py
+++ b/tko/parsers/version_1.py
@@ -4,6 +4,31 @@ from autotest_lib.tko import models, status_lib, utils as tko_utils
from autotest_lib.tko.parsers import base, version_0
+class job(version_0.job):
+ def exit_status(self):
+ # if for some reason we can't read the status code, assume disaster
+ execute_path = os.path.join(self.dir, ".autoserv_execute")
+ if not os.path.exists(execute_path):
+ return "ABORT"
+ lines = open(execute_path).readlines()
+ if len(lines) < 2:
+ return "ABORT"
+ try:
+ status_code = int(lines[1])
+ except ValueError:
+ return "ABORT"
+
+ if not os.WIFEXITED(status_code):
+ # looks like a signal - an ABORT
+ return "ABORT"
+ elif os.WEXITSTATUS(status_code) != 0:
+ # looks like a non-zero exit - a failure
+ return "FAIL"
+ else:
+ # looks like exit code == 0
+ return "GOOD"
+
+
class kernel(models.kernel):
def __init__(self, base, patches):
if base:
@@ -101,7 +126,6 @@ class status_line(version_0.status_line):
# the default implementations from version 0 will do for now
-job = version_0.job
patch = version_0.patch
@@ -148,6 +172,13 @@ class parser(base.parser):
started_time_stack = [None]
subdir_stack = [None]
running_test = None
+ yield [] # we're ready to start running
+
+ # create a RUNNING SERVER_JOB entry to represent the entire test
+ running_job = test.parse_partial_test(self.job, "----", "SERVER_JOB",
+ "", current_kernel,
+ self.job.started_time)
+ new_tests.append(running_job)
while True:
# are we finished with parsing?
@@ -316,5 +347,12 @@ class parser(base.parser):
tko_utils.dprint(msg)
new_tests.append(new_test)
- # the job is finished, nothing to do here but exit
+ # the job is finished, produce the final SERVER_JOB entry and exit
+ final_job = test.parse_test(self.job, "----", "SERVER_JOB",
+ self.job.exit_status(), "",
+ current_kernel,
+ self.job.started_time,
+ self.job.finished_time,
+ running_job)
+ new_tests.append(final_job)
yield new_tests