From 2289138bdaa17b764821f41a3b3fd0a01cda7440 Mon Sep 17 00:00:00 2001 From: Leonardo Sandoval Date: Tue, 31 May 2016 09:24:03 -0500 Subject: oeqa/selftest/recipetool.py: Tweak matching of warning line We are observing cases (see below) where the 'WARNING:' prefix is not at the beginning of a line, so instead of expecting it in the beginning, match it within the string. ====================================================================== FAIL: test_recipetool_appendfile_patch (oeqa.selftest.recipetool.RecipetoolTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/utils/decorators.py", line 109, in wrapped_f return func(*args, **kwargs) File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/recipetool.py", line 285, in test_recipetool_appendfile_patch self.fail('Patch warning not found in output:\n%s' % output) AssertionError: Patch warning not found in output: Parsing recipes..WARNING: File /etc/selftest-replaceme-patched is added by the patch /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta-selftest/recipes-test/recipetool/files/add-file.patch - you may need to remove or replace this patch in order to replace the file. NOTE: Writing append file /tmp/recipetoolqaug0kdb4x/recipes-test/recipetool/selftest-recipetool-appendfile.bbappend NOTE: Copying /tmp/recipetoolqagci9tita/testfile to /tmp/recipetoolqaug0kdb4x/recipes-test/recipetool/selftest-recipetool-appendfile/testfile done. Signed-off-by: Leonardo Sandoval Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/recipetool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/lib/oeqa/selftest/recipetool.py b/meta/lib/oeqa/selftest/recipetool.py index a93d18e275..9436301937 100644 --- a/meta/lib/oeqa/selftest/recipetool.py +++ b/meta/lib/oeqa/selftest/recipetool.py @@ -278,7 +278,7 @@ class RecipetoolTests(RecipetoolBase): '}\n'] _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/etc/selftest-replaceme-patched', self.testfile, '', expectedlines, ['testfile']) for line in output.splitlines(): - if line.startswith('WARNING: '): + if 'WARNING: ' in line: self.assertIn('add-file.patch', line, 'Unexpected warning found in output:\n%s' % line) break else: -- cgit 1.2.3-korg