summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2007-10-04 21:43:12 +0000
committermbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2007-10-04 21:43:12 +0000
commitba2682eaa5efa837dc83df61c7e428692db3be36 (patch)
treeb108805070abcf38b4733f00082bef5d30626984
parentbeeac84e5194fed3cdc99f3896f460bad70e242c (diff)
Add a key-value file at the test level
At the moment, we put key-value pairs in for performance results. As well as those per-iteration datums, we have some things we'd like to record about the test itself - most significantly it's version. Add another keyval file at the test subdirectory level. I used a generic helper to do this ... will go back and clean up all the tests to use it. Signed-off-by: Martin J. Bligh <mbligh@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@749 592f7852-d20e-0410-864c-8624ca9c26a4
-rwxr-xr-xclient/bin/autotest_utils.py12
-rwxr-xr-xclient/bin/test.py2
2 files changed, 14 insertions, 0 deletions
diff --git a/client/bin/autotest_utils.py b/client/bin/autotest_utils.py
index 507396f2..84d8b4ca 100755
--- a/client/bin/autotest_utils.py
+++ b/client/bin/autotest_utils.py
@@ -534,3 +534,15 @@ def rpm_installed(package):
except:
return False
return True
+
+
+def write_keyval(dirname, dictionary):
+ keyval = open(os.path.join(dirname, 'keyval'), 'w')
+ for key in dictionary.keys():
+ value = '%s' % dictionary[key] # convert numbers to strings
+ if re.search(r'\W', key):
+ raise 'Invalid key: ' + key
+ if re.search(r'[^\d\.]', value):
+ raise 'Invalid value %s for key %s' % (value, key)
+ keyval.write('%s=%s\n' % (key, value))
+ keyval.close()
diff --git a/client/bin/test.py b/client/bin/test.py
index 4bb512e7..249db62c 100755
--- a/client/bin/test.py
+++ b/client/bin/test.py
@@ -70,6 +70,8 @@ class test:
try:
os.chdir(self.outputdir)
+ write_keyval(self.outputdir,
+ { 'version' : self.version })
self.execute(*args, **dargs)
finally:
self.job.stderr.restore()