]> code.ossystems Code Review - openembedded-core.git/commitdiff
testimage.bbclass: Add check for empty test suite
authorMariano Lopez <mariano.lopez@linux.intel.com>
Thu, 9 Feb 2017 13:15:14 +0000 (13:15 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 15 Feb 2017 17:29:43 +0000 (09:29 -0800)
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]

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/testimage.bbclass

index 366c6f5d7b9e1f221eb10cad7cca07ffd494f5ec..09cc6d2a211285b5e128220f6e3d36944e3fdb0a 100644 (file)
@@ -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