diff options
author | jadmanski <jadmanski@592f7852-d20e-0410-864c-8624ca9c26a4> | 2008-09-15 19:15:02 +0000 |
---|---|---|
committer | jadmanski <jadmanski@592f7852-d20e-0410-864c-8624ca9c26a4> | 2008-09-15 19:15:02 +0000 |
commit | e9a06dff97ee68a0a399e3048a20032f5787285c (patch) | |
tree | 6618f1166ca77fd4c5faae5ef346daeb3338556c /tko/parsers | |
parent | c413213f37ee4c4949c3c33f86672f54c872df7b (diff) |
Add a method to the Host objects for logging the currently running
kernel, and a method for logging "informational" status logs that
update the kernel without requiring any real action to occur. This
logging will always occur at the start of a client job, for server-side
jobs it will still be opt-in only, since we don't have a clean place
to log it where we know we have access to a host object.
Risk: Medium
Visibility: Client-side jobs should always have a real kernel
associated with all logged tests, and server-side jobs have an easy
way to log the same thing.
Signed-off-by: John Admanski <jadmanski@google.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@2157 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'tko/parsers')
-rw-r--r-- | tko/parsers/version_0_unittest.py | 6 | ||||
-rw-r--r-- | tko/parsers/version_1.py | 20 | ||||
-rw-r--r-- | tko/parsers/version_1_unittest.py | 7 |
3 files changed, 33 insertions, 0 deletions
diff --git a/tko/parsers/version_0_unittest.py b/tko/parsers/version_0_unittest.py index 03c13b2f..6ca7df82 100644 --- a/tko/parsers/version_0_unittest.py +++ b/tko/parsers/version_0_unittest.py @@ -17,6 +17,12 @@ class test_status_line(unittest.TestCase): self.assertEquals(line.status, None) + def test_fails_info(self): + self.assertRaises(AssertionError, + version_0.status_line, 0, "INFO", "----", "----", + "", {}) + + def test_handles_status(self): for stat in self.statuses: line = version_0.status_line(0, stat, "----", "test", diff --git a/tko/parsers/version_1.py b/tko/parsers/version_1.py index 25308137..0aea722f 100644 --- a/tko/parsers/version_1.py +++ b/tko/parsers/version_1.py @@ -53,6 +53,21 @@ class iteration(models.iteration): class status_line(version_0.status_line): + def __init__(self, indent, status, subdir, testname, reason, + optional_fields): + # handle INFO fields + if status == "INFO": + self.type = "INFO" + self.indent = indent + self.status = self.subdir = self.testname = self.reason = None + self.optional_fields = optional_fields + else: + # everything else is backwards compatible + super(status_line, self).__init__(indent, status, subdir, + testname, reason, + optional_fields) + + def is_successful_reboot(self, current_status): # make sure this is a reboot line if self.testname != "reboot": @@ -192,6 +207,11 @@ class parser(base.parser): started_time_stack.append(started_time) subdir_stack.append(line.subdir) continue + elif line.type == "INFO": + # update the current kernel if one is defined in the info + if "kernel" in line.optional_fields: + current_kernel = line.get_kernel() + continue elif line.type == "STATUS": # ABORT if indentation was unexpectedly low if line.indent < stack.size(): diff --git a/tko/parsers/version_1_unittest.py b/tko/parsers/version_1_unittest.py index 8e85224f..072ab5bd 100644 --- a/tko/parsers/version_1_unittest.py +++ b/tko/parsers/version_1_unittest.py @@ -17,6 +17,13 @@ class test_status_line(unittest.TestCase): self.assertEquals(line.status, None) + def test_handles_info(self): + line = version_1.status_line(0, "INFO", "----", "----", + "", {}) + self.assertEquals(line.type, "INFO") + self.assertEquals(line.status, None) + + def test_handles_status(self): for stat in self.statuses: line = version_1.status_line(0, stat, "----", "test", |