summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorJulien Stephan <jstephan@baylibre.com>2023-12-11 18:01:38 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-13 11:34:27 +0000
commit5d6a41b265caebe8bfe81530983de34ffb4341ad (patch)
tree44b4851d1b9d3b15051cbf700b96b9a4e4f48442 /meta
parent94c4d9e35f14a2d9cac400dd283cfcdeea0f505a (diff)
downloadpoky-5d6a41b265caebe8bfe81530983de34ffb4341ad.tar.gz
oeqa/selftest/recipetool: fix metadata corruption on meta layer
[YOCTO #15314] test_recipetool_appendsrcfile_update_recipe_basic is using base-files as test recipe but modifies it directly which can corrupt metadata for other tests relying on this recipe. So use mtd-utils-selftest as test recipe from meta-selftest to avoid this kind of issues (From OE-Core rev: bf5e6c1b6ceca5a2eda30359d5e5e330278a97e1) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/selftest/cases/recipetool.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py
index e0e3dff484..a19439d88e 100644
--- a/meta/lib/oeqa/selftest/cases/recipetool.py
+++ b/meta/lib/oeqa/selftest/cases/recipetool.py
@@ -1267,23 +1267,16 @@ class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
1267 self.test_recipetool_appendsrcfile_existing_in_src_uri_diff_params(machine='mymachine') 1267 self.test_recipetool_appendsrcfile_existing_in_src_uri_diff_params(machine='mymachine')
1268 1268
1269 def test_recipetool_appendsrcfile_update_recipe_basic(self): 1269 def test_recipetool_appendsrcfile_update_recipe_basic(self):
1270 testrecipe = "base-files" 1270 testrecipe = "mtd-utils-selftest"
1271 recipefile = get_bb_var('FILE', testrecipe) 1271 recipefile = get_bb_var('FILE', testrecipe)
1272 result = runCmd('bitbake-layers show-layers') 1272 self.assertIn('meta-selftest', recipefile, 'This test expect %s recipe to be in meta-selftest')
1273 layerrecipe = None 1273 cmd = 'recipetool appendsrcfile -W -u meta-selftest %s %s' % (testrecipe, self.testfile)
1274 for line in result.output.splitlines()[3:]:
1275 layer = line.split()[1]
1276 if layer in recipefile:
1277 layerrecipe = layer
1278 break
1279 self.assertTrue(layerrecipe, 'Unable to find the layer containing %s' % testrecipe)
1280 cmd = 'recipetool appendsrcfile -u %s %s %s' % (layerrecipe, testrecipe, self.testfile)
1281 result = runCmd(cmd) 1274 result = runCmd(cmd)
1282 self.assertNotIn('Traceback', result.output) 1275 self.assertNotIn('Traceback', result.output)
1283 self.add_command_to_tearDown('cd %s; rm -f %s/%s; git checkout .' % (os.path.dirname(recipefile), testrecipe, os.path.basename(self.testfile))) 1276 self.add_command_to_tearDown('cd %s; rm -f %s/%s; git checkout .' % (os.path.dirname(recipefile), testrecipe, os.path.basename(self.testfile)))
1284 1277
1285 expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)), 1278 expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
1286 ('??', '.*/%s/%s/%s$' % (testrecipe, testrecipe, os.path.basename(self.testfile)))] 1279 ('??', '.*/%s/%s$' % (testrecipe, os.path.basename(self.testfile)))]
1287 self._check_repo_status(os.path.dirname(recipefile), expected_status) 1280 self._check_repo_status(os.path.dirname(recipefile), expected_status)
1288 result = runCmd('git diff %s' % os.path.basename(recipefile), cwd=os.path.dirname(recipefile)) 1281 result = runCmd('git diff %s' % os.path.basename(recipefile), cwd=os.path.dirname(recipefile))
1289 removelines = [] 1282 removelines = []