From e50b415aaaa1581473f85f0a8afa278b5f95129b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= Date: Wed, 26 Jul 2017 10:04:09 -0500 Subject: oeqa/{core,selftest}: Add support to validate if a specified test case isn't found MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If some test module/case is specified to run and isn't found the OEQA framework didn't notice it, so complete the implementation using modules_required and validate for the test case prescense. Raise an exception when the test module/case required isn't found. [YOCTO #11645] Signed-off-by: Aníbal Limón Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/context.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'meta/lib/oeqa/selftest/context.py') diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py index 4575a0537f..990c761f29 100644 --- a/meta/lib/oeqa/selftest/context.py +++ b/meta/lib/oeqa/selftest/context.py @@ -13,7 +13,7 @@ from random import choice import oeqa from oeqa.core.context import OETestContext, OETestContextExecutor -from oeqa.core.exception import OEQAPreRun +from oeqa.core.exception import OEQAPreRun, OEQATestNotFound from oeqa.utils.commands import runCmd, get_bb_vars, get_test_layer @@ -196,7 +196,11 @@ class OESelftestTestContextExecutor(OETestContextExecutor): self.tc_kwargs['init']['td']['BBPATH'].split(':')) self.tc = self._context_class(**self.tc_kwargs['init']) - self.tc.loadTests(self.module_paths, **self.tc_kwargs['load']) + try: + self.tc.loadTests(self.module_paths, **self.tc_kwargs['load']) + except OEQATestNotFound as ex: + logger.error(ex) + sys.exit(1) if args.list_tests: rc = self.tc.listTests(args.list_tests, **self.tc_kwargs['run']) -- cgit v1.2.3