selftest: Add test to check imports from other layers
v2 cover selftest: Add test to check imports from other layers
From: Mariano Lopez <[email protected]>
This patch adds a test to check selftest itself, the feature to import tests from other layers.
Changes in v2:
- Renamed tests based on Benjamin's comment
The following changes since commit 6bb3069eeff76373041f8da08418386fe5ef5897:
tune-ppce500mc.inc: pass -mcpu=e500mc for ppce500mc kernel compile (2016-07-10 14:12:17 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib mariano/bug9770v2
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=mariano/bug9770v2
Mariano Lopez (1):
selftest/seltest.py: Add test to check imports from other layers
meta-selftest/lib/oeqa/selftest/external-layer.py | 14 ++++++++++++++ meta/lib/oeqa/selftest/selftest.py | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 meta-selftest/lib/oeqa/selftest/external-layer.py create mode 100644 meta/lib/oeqa/selftest/selftest.py
Signature · 1 line
2.6.6
PATCH v2 1/1 selftest/seltest.py: Add test to check imports from other layers
From: Mariano Lopez <[email protected]>
This tests adds a check of selftest itself to verify if can add test from other layers.
[YOCTO #9770]
--- meta-selftest/lib/oeqa/selftest/external-layer.py | 14 ++++++++++++++ meta/lib/oeqa/selftest/selftest.py | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 meta-selftest/lib/oeqa/selftest/external-layer.py create mode 100644 meta/lib/oeqa/selftest/selftest.py
meta-selftest/lib/oeqa/selftest/external-layer.py new file +14 -0
@@ -0,0 +1,14 @@ +from oeqa.selftest.base import oeSelfTest +from oeqa.utils.decorators import testcase + +class ImportedTests(oeSelfTest): + + def test_unconditional_pass(self): + """ + Summary: Doesn't check anything, used to check import test from other layers. + Expected: 1. Pass unconditionally + Product: oe-core + Author: Mariano Lopez <[email protected] + """ + + self.assertEqual(True, True, msg = "Impossible to fail this test")
meta/lib/oeqa/selftest/selftest.py new file +19 -0
@@ -0,0 +1,19 @@ +from oeqa.selftest.base import oeSelfTest +from oeqa.utils.commands import runCmd +from oeqa.utils.decorators import testcase + +class ExternalLayer(oeSelfTest): + + def test_list_imported(self): + """ + Summary: Checks functionality to import tests from other layers. + Expected: 1. Must show "test_import_dummy" in the test list. + Product: oe-core + Author: Mariano Lopez <[email protected]> + """ + + test_name = "external-layer.ImportedTests.test_unconditional_pass" + error_msg = "Couldn't find test: %s; Not importing tests from other layers" % test_name + result = runCmd("oe-selftest --list-tests") + success = True if test_name in result.output else False + self.assertEqual(success, True, msg = error_msg)
Signature · 1 line
2.6.6