Add a new status field called TEST_NA (in addition to PASS and FAIL).
From: Travis Miller
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1476 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/common_lib/error.py b/client/common_lib/error.py
index 5f960f3..b373ddb 100644
--- a/client/common_lib/error.py
+++ b/client/common_lib/error.py
@@ -34,6 +34,10 @@
"""Indicates an error which terminates and fails the test."""
pass
+class TestNAError(AutotestError):
+ """Indictates that the test is Not Applicable. Should be thrown
+ when various conditions are such that the test is inappropriate"""
+ pass
class CmdError(TestError):
"""\
diff --git a/client/common_lib/logging.py b/client/common_lib/logging.py
index 0bb403c..004975a 100644
--- a/client/common_lib/logging.py
+++ b/client/common_lib/logging.py
@@ -2,9 +2,22 @@
Logging helper tools.
"""
+import re
+
__author__ = 'jadmanski@google.com (John Admanski)'
+job_statuses = ["TEST_NA", "ABORT", "ERROR", "FAIL", "WARN", "GOOD", "ALERT",
+ "NOSTATUS"]
+
+def is_valid_status(status):
+ if not re.match(r'(START|(END )?(GOOD|WARN|FAIL|ABORT|TEST_NA))$',
+ status):
+ return False
+ else:
+ return True
+
+
def record(fn):
"""
Generic method decorator for logging calls under the