From 0f2ef4304e6a6f18b4ed13f59000b4a1daa35f6b Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 15 Feb 2016 15:46:46 +0000 Subject: oeqa: Update to handle domain specific references in build logs With the addition of the task name to recipe output, the sanity tests need updates where they are looking for specific messages. Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/bbtests.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'meta/lib/oeqa/selftest/bbtests.py') diff --git a/meta/lib/oeqa/selftest/bbtests.py b/meta/lib/oeqa/selftest/bbtests.py index 94ca79c031..42ae9d0cc9 100644 --- a/meta/lib/oeqa/selftest/bbtests.py +++ b/meta/lib/oeqa/selftest/bbtests.py @@ -8,6 +8,11 @@ from oeqa.utils.decorators import testcase class BitbakeTests(oeSelfTest): + def getline(self, res, line): + for l in res.output.split('\n'): + if line in l: + return l + @testcase(789) def test_run_bitbake_from_dir_1(self): os.chdir(os.path.join(self.builddir, 'conf')) @@ -63,7 +68,8 @@ class BitbakeTests(oeSelfTest): result = bitbake('man -c patch', ignore_status=True) self.delete_recipeinc('man') bitbake('-cclean man') - self.assertTrue("ERROR: Function failed: patch_do_patch" in result.output, msg = "Though no man-1.5h1-make.patch file exists, bitbake didn't output any err. message. bitbake output: %s" % result.output) + line = self.getline(result, "Function failed: patch_do_patch") + self.assertTrue(line and line.startswith("ERROR:"), msg = "Though no man-1.5h1-make.patch file exists, bitbake didn't output any err. message. bitbake output: %s" % result.output) @testcase(1354) def test_force_task_1(self): @@ -135,7 +141,8 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" self.assertEqual(result.status, 1, msg="Command succeded when it should have failed. bitbake output: %s" % result.output) self.assertTrue('Fetcher failure: Unable to find file file://invalid anywhere. The paths that were searched were:' in result.output, msg = "\"invalid\" file \ doesn't exist, yet no error message encountered. bitbake output: %s" % result.output) - self.assertTrue('ERROR: Function failed: Fetcher failure for URL: \'file://invalid\'. Unable to fetch URL from any source.' in result.output, msg = "\"invalid\" file \ + line = self.getline(result, 'Function failed: Fetcher failure for URL: \'file://invalid\'. Unable to fetch URL from any source.') + self.assertTrue(line and line.startswith("ERROR:"), msg = "\"invalid\" file \ doesn't exist, yet fetcher didn't report any error. bitbake output: %s" % result.output) @testcase(171) -- cgit 1.2.3-korg