]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa/selftest/recipeutils: Fix parallel selftest failures
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 29 Nov 2018 17:07:52 +0000 (17:07 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 29 Nov 2018 17:09:45 +0000 (17:09 +0000)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/recipeutils.py

index b7cb55baae1dd82ba16cbf777a9f25d71ec39b26..d5cda52bec2ccabab22458793145398a87e2d0ea 100644 (file)
@@ -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