]> code.ossystems Code Review - openembedded-core.git/commitdiff
selftest/tinfoil: Filter LogRecords in test_event_wait
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 14 Aug 2017 10:04:39 +0000 (11:04 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 15 Aug 2017 23:01:45 +0000 (00:01 +0100)
As the code stands today, an event mask does not mask LogRecord events
since the log levels are controlled separately. We therefore need to
accept (and ignore) LogRecord events in this test to avoid errors.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/tinfoil.py

index aa1af7e0423fe3977bf8f27c0302c2f17e17c734..471517fb299b7189cda6dc81344f57ff76d7b98b 100644 (file)
@@ -1,6 +1,7 @@
 import os
 import re
 import time
+import logging
 import bb.tinfoil
 
 from oeqa.selftest.case import OESelftestTestCase
@@ -127,6 +128,8 @@ class TinfoilTests(OESelftestTestCase):
                         self.assertEqual(pattern, event._pattern)
                         self.assertIn('qemuarm.conf', event._matches)
                         eventreceived = True
+                    elif isinstance(event, logging.LogRecord):
+                        continue
                     else:
                         self.fail('Unexpected event: %s' % event)