Skip to contentSkip to conversation

testimage.bbclass: Add check for empty test suite

PATCH New [email protected] 1 participant 1 message Feb 9, 2017 1 message not in the archive

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 testimage.bbclass: Add check for empty test suite

In reply to a message not in the archive

From: Mariano Lopez <[email protected]>

If for some reason (most likely incorrect TEST_SUITES var) you end with an empty test suite, testimage will start the target (qemu by default) and will run an empty suite, so better have a check before starting the target.

[YOCTO #10979]

---
 meta/classes/testimage.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
meta/classes/testimage.bbclass +4 -0
index c6e4cec..1312202 100644
@@ -149,6 +149,7 @@ def testimage_main(d):
     from oeqa.runtime.context import OERuntimeTestContext
     from oeqa.runtime.context import OERuntimeTestContextExecutor
     from oeqa.core.target.qemu import supported_fstypes
+    from oeqa.core.utils.test import getSuiteCases
     from oeqa.utils import make_logger_bitbake_compatible
 
     def sigterm_exception(signum, stackframe):
@@ -250,6 +251,9 @@ def testimage_main(d):
     test_modules = d.getVar('TEST_SUITES')
     tc.loadTests(test_paths, modules=test_modules)
 
+    if not getSuiteCases(tc.suites):
+        bb.fatal('Empty test suite, please verify TEST_SUITES variable')
+
     package_extraction(d, tc.suites)
 
     bootparams = None
Signature · 1 line
2.6.6