summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/core/tests/test_decorators.py
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2017-05-26 15:37:41 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-05-30 10:15:22 +0100
commitfb9d91ca34c1b5d3e0034f5135e71f964fca5b82 (patch)
tree894f69e436176f9b167af00649a680356b9fcbe4 /meta/lib/oeqa/core/tests/test_decorators.py
parent44254caaef131402629d01f01cdee6722718adba (diff)
downloadopenembedded-core-contrib-fb9d91ca34c1b5d3e0034f5135e71f964fca5b82.tar.gz
oeqa/core/tests: Add tests of OEQA Threaded mode
Add needed tests to validate the OEQA Threaded mode, the remaining parts are tested by the OEQA without Threaded mode. - test_loader.py: Add a test to validate rules when creating the list of test suites. - test_decorators.py: Add oetimeout test because the threaded mode uses Timer instead of signal. [YOCTO #11450] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/core/tests/test_decorators.py')
-rwxr-xr-xmeta/lib/oeqa/core/tests/test_decorators.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/meta/lib/oeqa/core/tests/test_decorators.py b/meta/lib/oeqa/core/tests/test_decorators.py
index f7d11e885a..cf99e0d72d 100755
--- a/meta/lib/oeqa/core/tests/test_decorators.py
+++ b/meta/lib/oeqa/core/tests/test_decorators.py
@@ -131,5 +131,17 @@ class TestTimeoutDecorator(TestBase):
msg = "OETestTimeout didn't restore SIGALRM"
self.assertIs(alarm_signal, signal.getsignal(signal.SIGALRM), msg=msg)
+ def test_timeout_thread(self):
+ tests = ['timeout.TimeoutTest.testTimeoutPass']
+ msg = 'Failed to run test using OETestTimeout'
+ tc = self._testLoaderThreaded(modules=self.modules, tests=tests)
+ self.assertTrue(tc.runTests().wasSuccessful(), msg=msg)
+
+ def test_timeout_threaded_fail(self):
+ tests = ['timeout.TimeoutTest.testTimeoutFail']
+ msg = "OETestTimeout test didn't timeout as expected"
+ tc = self._testLoaderThreaded(modules=self.modules, tests=tests)
+ self.assertFalse(tc.runTests().wasSuccessful(), msg=msg)
+
if __name__ == '__main__':
unittest.main()