[Piglit] [PATCH] framework: actually write dmesg to testresult

Dylan Baker baker.dylan.c at gmail.com
Sat Oct 10 13:10:25 PDT 2015


Everything is hooked up, except writing it. Restoring, processing, all
of that still works, just not writing it to the json, so fix that.

cc: imirkin at alum.mit.edu
Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---

Ilia: if this looks good to you and you want it before Monday feel free
to push it.

 framework/results.py             |  1 +
 framework/tests/results_tests.py | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/framework/results.py b/framework/results.py
index 5354a32..847ab14 100644
--- a/framework/results.py
+++ b/framework/results.py
@@ -196,6 +196,7 @@ class TestResult(object):
             'subtests': self.subtests,
             'time': self.time,
             'exception': self.exception,
+            'dmesg': self.dmesg,
         }
         return obj
 
diff --git a/framework/tests/results_tests.py b/framework/tests/results_tests.py
index 8128b38..c476174 100644
--- a/framework/tests/results_tests.py
+++ b/framework/tests/results_tests.py
@@ -204,6 +204,7 @@ class TestTestResult_to_json(object):
             },
             'result': 'crash',
             'exception': 'an exception',
+            'dmesg': 'this is dmesg',
         }
 
         test = results.TestResult.from_dict(cls.dict)
@@ -242,6 +243,10 @@ class TestTestResult_to_json(object):
         """results.TestResult.to_json: adds the __type__ hint"""
         nt.eq_(self.json['__type__'], 'TestResult')
 
+    def test_dmesg(self):
+        """results.TestResult.to_json: Adds the dmesg attribute"""
+        nt.eq_(self.json['dmesg'], 'this is dmesg')
+
 
 class TestTestResult_from_dict(object):
     """Tests for the from_dict method."""
@@ -259,6 +264,7 @@ class TestTestResult_from_dict(object):
             },
             'result': 'crash',
             'exception': 'an exception',
+            'dmesg': 'this is dmesg',
         }
 
         cls.test = results.TestResult.from_dict(cls.dict)
@@ -296,6 +302,10 @@ class TestTestResult_from_dict(object):
         nt.assert_is(self.test.subtests['a'], status.PASS)
         nt.assert_is(self.test.subtests['b'], status.FAIL)
 
+    def test_dmesg(self):
+        """results.TestResult.from_dict: sets dmesg properly"""
+        nt.eq_(self.test.dmesg, self.dict['dmesg'])
+
 
 def test_TestResult_update():
     """results.TestResult.update: result is updated"""
-- 
2.6.1



More information about the Piglit mailing list