mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
94c4d9e35f
commit
5d6a41b265
@@ -1267,23 +1267,16 @@ class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
|
|||||||
self.test_recipetool_appendsrcfile_existing_in_src_uri_diff_params(machine='mymachine')
|
self.test_recipetool_appendsrcfile_existing_in_src_uri_diff_params(machine='mymachine')
|
||||||
|
|
||||||
def test_recipetool_appendsrcfile_update_recipe_basic(self):
|
def test_recipetool_appendsrcfile_update_recipe_basic(self):
|
||||||
testrecipe = "base-files"
|
testrecipe = "mtd-utils-selftest"
|
||||||
recipefile = get_bb_var('FILE', testrecipe)
|
recipefile = get_bb_var('FILE', testrecipe)
|
||||||
result = runCmd('bitbake-layers show-layers')
|
self.assertIn('meta-selftest', recipefile, 'This test expect %s recipe to be in meta-selftest')
|
||||||
layerrecipe = None
|
cmd = 'recipetool appendsrcfile -W -u meta-selftest %s %s' % (testrecipe, self.testfile)
|
||||||
for line in result.output.splitlines()[3:]:
|
|
||||||
layer = line.split()[1]
|
|
||||||
if layer in recipefile:
|
|
||||||
layerrecipe = layer
|
|
||||||
break
|
|
||||||
self.assertTrue(layerrecipe, 'Unable to find the layer containing %s' % testrecipe)
|
|
||||||
cmd = 'recipetool appendsrcfile -u %s %s %s' % (layerrecipe, testrecipe, self.testfile)
|
|
||||||
result = runCmd(cmd)
|
result = runCmd(cmd)
|
||||||
self.assertNotIn('Traceback', result.output)
|
self.assertNotIn('Traceback', result.output)
|
||||||
self.add_command_to_tearDown('cd %s; rm -f %s/%s; git checkout .' % (os.path.dirname(recipefile), testrecipe, os.path.basename(self.testfile)))
|
self.add_command_to_tearDown('cd %s; rm -f %s/%s; git checkout .' % (os.path.dirname(recipefile), testrecipe, os.path.basename(self.testfile)))
|
||||||
|
|
||||||
expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
|
expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
|
||||||
('??', '.*/%s/%s/%s$' % (testrecipe, testrecipe, os.path.basename(self.testfile)))]
|
('??', '.*/%s/%s$' % (testrecipe, os.path.basename(self.testfile)))]
|
||||||
self._check_repo_status(os.path.dirname(recipefile), expected_status)
|
self._check_repo_status(os.path.dirname(recipefile), expected_status)
|
||||||
result = runCmd('git diff %s' % os.path.basename(recipefile), cwd=os.path.dirname(recipefile))
|
result = runCmd('git diff %s' % os.path.basename(recipefile), cwd=os.path.dirname(recipefile))
|
||||||
removelines = []
|
removelines = []
|
||||||
|
|||||||
Reference in New Issue
Block a user