summaryrefslogtreecommitdiff
path: root/tko/parse.py
diff options
context:
space:
mode:
authormbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2007-09-13 17:29:56 +0000
committermbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2007-09-13 17:29:56 +0000
commit04eb95a55a0fb0c757784a349f757f4026ec6883 (patch)
tree435bbabcd36839399e947922203df5eda11d9eab /tko/parse.py
parentcaf2352dbd40e7f71384adafc3fb249b73c1f192 (diff)
update tko
Signed-off-by: Martin J. Bligh <mbligh@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@663 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'tko/parse.py')
-rwxr-xr-xtko/parse.py27
1 files changed, 15 insertions, 12 deletions
diff --git a/tko/parse.py b/tko/parse.py
index 1ca6524d..5d541beb 100755
--- a/tko/parse.py
+++ b/tko/parse.py
@@ -6,12 +6,6 @@ build_stock = re.compile('build generic stock (2\.\S+)')
build_url = re.compile('build generic url \S*/linux-(2\.\d\.\d+(\.\d+)?(-rc\d+)?).tar')
valid_kernel= re.compile('2\.\d\.\d+(\.\d+)?(-rc\d+)?(-(git|bk))\d+')
-statuses = ['NOSTATUS', 'ERROR', 'ABORT', 'FAIL', 'WARN', 'GOOD']
-status_num = {}
-for x in range(0, len(statuses)):
- status_num[statuses[x]] = x
-
-
def shorten_patch(long):
short = os.path.basename(long)
short = re.sub(r'^patch-', '', short)
@@ -27,11 +21,20 @@ class job:
self.type = type
self.control = os.path.join(dir, "control")
self.status = os.path.join(dir, "status")
- self.machine = ''
self.variables = {}
self.tests = []
self.kernel = None
+ if not os.path.exists(self.status):
+ return None
+
+ # We should really replace this with sysinfo/hostname!
+ uname = os.path.join(dir, "sysinfo/uname_-a")
+ try:
+ self.machine = open(uname, 'r').readline().split()[1]
+ except:
+ return None
+
self.grope_status()
@@ -42,13 +45,12 @@ class job:
if os.path.exists(build):
self.kernel = kernel(build)
- if not os.path.exists(self.status):
- return
-
for line in open(self.status, 'r').readlines():
(status, testname, reason) = line.rstrip().split(' ', 2)
+ print 'GROPE_STATUS: ',
+ print (status, testname, reason)
- self.tests.append(test(testname, status, reason, self.kernel))
+ self.tests.append(test(testname, status, reason, self.kernel, self))
class kernel:
@@ -94,7 +96,7 @@ class patch:
class test:
- def __init__(self, dir, status, reason, kernel):
+ def __init__(self, dir, status, reason, kernel, job):
self.dir = dir
self.status = status
self.reason = reason
@@ -102,6 +104,7 @@ class test:
self.iterations = []
self.testname = re.sub(r'\..*', '', self.dir)
self.kernel = kernel
+ self.machine = job.machine
if not os.path.exists(self.keyval):
self.keyval = None