diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-11-29 17:07:52 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-11-29 17:09:45 +0000 |
commit | fb640faa7f6c45328cb628c3765980c15e778a77 (patch) | |
tree | df50eb2a8a620d36f4d81f8d8e41f7903f415d01 | |
parent | de584eeeffb5154ce11e9916749eec3c435bdfe2 (diff) | |
download | openembedded-core-contrib-fb640faa7f6c45328cb628c3765980c15e778a77.tar.gz |
oeqa/selftest/recipeutils: Fix parallel selftest failures
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/cases/recipeutils.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/meta/lib/oeqa/selftest/cases/recipeutils.py b/meta/lib/oeqa/selftest/cases/recipeutils.py index b7cb55baae..d5cda52bec 100644 --- a/meta/lib/oeqa/selftest/cases/recipeutils.py +++ b/meta/lib/oeqa/selftest/cases/recipeutils.py @@ -22,12 +22,21 @@ def tearDownModule(): class RecipeUtilsTests(OESelftestTestCase): """ Tests for the recipeutils module functions """ + def get_selftest_layerdir(self, rd): + selftestdir = None + for entry in rd.getVar('BBLAYERS').split(): + if "/meta-selftest" in entry: + selftestdir = entry + self.assertIsNotNone(selftestdir, msg="Couldn't find meta-selftest layer") + return selftestdir + + def test_patch_recipe_varflag(self): import oe.recipeutils rd = tinfoil.parse_recipe('python3-async-test') vals = {'SRC_URI[md5sum]': 'aaaaaa', 'LICENSE': 'something'} - corebase = rd.getVar('COREBASE') - patches = oe.recipeutils.patch_recipe(rd, rd.getVar('FILE'), vals, patch=True, relpath=corebase) + selftestdir = os.path.dirname(self.get_selftest_layerdir(rd)) + patches = oe.recipeutils.patch_recipe(rd, rd.getVar('FILE'), vals, patch=True, relpath=selftestdir) expected_patch = """ --- a/meta-selftest/recipes-devtools/python/python-async-test.inc @@ -65,8 +74,8 @@ class RecipeUtilsTests(OESelftestTestCase): del val[1] val = ' '.join(val) vals = {'SRC_URI': val} - corebase = rd.getVar('COREBASE') - patches = oe.recipeutils.patch_recipe(rd, rd.getVar('FILE'), vals, patch=True, relpath=corebase) + selftestdir = os.path.dirname(self.get_selftest_layerdir(rd)) + patches = oe.recipeutils.patch_recipe(rd, rd.getVar('FILE'), vals, patch=True, relpath=selftestdir) expected_patch = """ --- a/meta-selftest/recipes-test/recipeutils/recipeutils-test_1.2.bb @@ -91,8 +100,8 @@ class RecipeUtilsTests(OESelftestTestCase): rd = tinfoil.parse_recipe('recipeutils-test') val = rd.getVar('SRC_URI', False).split() vals = {'SRC_URI': val[0]} - corebase = rd.getVar('COREBASE') - patches = oe.recipeutils.patch_recipe(rd, rd.getVar('FILE'), vals, patch=True, relpath=corebase) + selftestdir = os.path.dirname(self.get_selftest_layerdir(rd)) + patches = oe.recipeutils.patch_recipe(rd, rd.getVar('FILE'), vals, patch=True, relpath=selftestdir) expected_patch = """ --- a/meta-selftest/recipes-test/recipeutils/recipeutils-test_1.2.bb |