summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Stephan <jstephan@baylibre.com>2024-04-15 21:20:10 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-04-22 22:05:57 +0100
commit7d4db41a567fb2d3937733d83afbc6c4d81dd0eb (patch)
tree0e9e1b0b1626ba4efc98bb398e76663942b98165
parent68432c657ede5d4a35c9c0eb48a3ad0c92b03c38 (diff)
downloadpoky-7d4db41a567fb2d3937733d83afbc6c4d81dd0eb.tar.gz
oeqa/selftest/devtool: add test for updating local files into another layer
We don't have a test to check if we can correctly devtool update-recipe/finish into another layer. So update the existing test_devtool_update_recipe_local_files to also check the updates into another layer. (From OE-Core rev: 9838c2dc6bf09023e23c9c4e3a7217b98abd3aeb) 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>
-rw-r--r--meta/lib/oeqa/selftest/cases/devtool.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index bc1e40ef83..51949e3c93 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -1405,14 +1405,30 @@ class DevtoolUpdateTests(DevtoolBase):
1405 runCmd('echo "Bar" > new-file', cwd=tempdir) 1405 runCmd('echo "Bar" > new-file', cwd=tempdir)
1406 runCmd('git add new-file', cwd=tempdir) 1406 runCmd('git add new-file', cwd=tempdir)
1407 runCmd('git commit -m "Add new file"', cwd=tempdir) 1407 runCmd('git commit -m "Add new file"', cwd=tempdir)
1408 self.add_command_to_tearDown('cd %s; git clean -fd .; git checkout .' %
1409 os.path.dirname(recipefile))
1410 runCmd('devtool update-recipe %s' % testrecipe) 1408 runCmd('devtool update-recipe %s' % testrecipe)
1411 expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)), 1409 expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
1412 (' M', '.*/makedevs/makedevs.c$'), 1410 (' M', '.*/makedevs/makedevs.c$'),
1413 ('??', '.*/makedevs/new-local$'), 1411 ('??', '.*/makedevs/new-local$'),
1414 ('??', '.*/makedevs/0001-Add-new-file.patch$')] 1412 ('??', '.*/makedevs/0001-Add-new-file.patch$')]
1415 self._check_repo_status(os.path.dirname(recipefile), expected_status) 1413 self._check_repo_status(os.path.dirname(recipefile), expected_status)
1414 # Now try to update recipe in another layer, so first, clean it
1415 runCmd('cd %s; git clean -fd .; git checkout .' % os.path.dirname(recipefile))
1416 # Create a temporary layer and add it to bblayers.conf
1417 self._create_temp_layer(templayerdir, True, 'templayer')
1418 # Update recipe in templayer
1419 result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir))
1420 self.assertNotIn('WARNING:', result.output)
1421 # Check recipe is still clean
1422 self._check_repo_status(os.path.dirname(recipefile), [])
1423 splitpath = os.path.dirname(recipefile).split(os.sep)
1424 appenddir = os.path.join(templayerdir, splitpath[-2], splitpath[-1])
1425 bbappendfile = self._check_bbappend(testrecipe, recipefile, appenddir)
1426 patchfile = os.path.join(appenddir, testrecipe, '0001-Add-new-file.patch')
1427 new_local_file = os.path.join(appenddir, testrecipe, 'new_local')
1428 local_file = os.path.join(appenddir, testrecipe, 'makedevs.c')
1429 self.assertExists(patchfile, 'Patch file 0001-Add-new-file.patch not created')
1430 self.assertExists(local_file, 'File makedevs.c not created')
1431 self.assertExists(patchfile, 'File new_local not created')
1416 1432
1417 def test_devtool_update_recipe_local_files_2(self): 1433 def test_devtool_update_recipe_local_files_2(self):
1418 """Check local source files support when oe-local-files is in Git""" 1434 """Check local source files support when oe-local-files is in Git"""