Risk: Medium
Visibility: Changes the test keyval interface, deprecating the existing
test.write_keyval method in favour of a pair of write_*_keyval methods
for writing test & iteration keyvals. The deprecated method will still
work as it did before, but will generate a warning.
Adds a new iteration_attributes table to the database for storing
generic string attributes on a per-iteration basis, in the same way
that test_attributes allows generic string attributes on a per-test
basis.
This also adds new methods to the test class for writing these keyvals
so that tests can write out attributes by calling
self.write_test_keyval (or self.write_iteration_keyval). The iteration
method accepts parameters for both generic attributes and performance
data.
In order to store both performance and non-performance data in the
iteration keyvals, the format of the line has been extended to look
like "key{blah}=value", with no {blah} being interpreted as equvalent
to "{perf}", for backwards compatiblity.
Signed-off-by: John Admanski <jadmanski@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1535 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/tko/db.py b/tko/db.py
index 2d992ac..c197ba5 100644
--- a/tko/db.py
+++ b/tko/db.py
@@ -320,15 +320,20 @@
for i in test.iterations:
data['iteration'] = i.index
- for key in i.keyval:
+ for key, value in i.attr_keyval.iteritems():
data['attribute'] = key
- data['value'] = i.keyval[key]
- self.insert('iteration_result',
- data,
- commit=commit)
+ data['value'] = value
+ self.insert('iteration_attributes', data,
+ commit=commit)
+ for key, value in i.perf_keyval.iteritems():
+ data['attribute'] = key
+ data['value'] = value
+ self.insert('iteration_result', data,
+ commit=commit)
for key, value in test.attributes.iteritems():
- data = {'test_idx': test_idx, 'attribute': key, 'value': value}
+ data = {'test_idx': test_idx, 'attribute': key,
+ 'value': value}
self.insert('test_attributes', data, commit=commit)