summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Stephan <jstephan@baylibre.com>2024-04-15 21:20:10 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2024-04-16 23:49:30 +0200
commitb33cd2e3d2afa32c25cb682b5255857d71f7c73d (patch)
treec1026835540de830f13203756f70105f7352ed09
parent8f9fe032f3bb07cf09dbebaf1f97c9879bf2af14 (diff)
downloadopenembedded-core-contrib-abelloni/master-next-success.tar.gz
oeqa/selftest/devtool: add test for updating local files into another layerabelloni/master-next-success
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. Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-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):
runCmd('echo "Bar" > new-file', cwd=tempdir)
runCmd('git add new-file', cwd=tempdir)
runCmd('git commit -m "Add new file"', cwd=tempdir)
- self.add_command_to_tearDown('cd %s; git clean -fd .; git checkout .' %
- os.path.dirname(recipefile))
runCmd('devtool update-recipe %s' % testrecipe)
expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
(' M', '.*/makedevs/makedevs.c$'),
('??', '.*/makedevs/new-local$'),
('??', '.*/makedevs/0001-Add-new-file.patch$')]
self._check_repo_status(os.path.dirname(recipefile), expected_status)
+ # Now try to update recipe in another layer, so first, clean it
+ runCmd('cd %s; git clean -fd .; git checkout .' % os.path.dirname(recipefile))
+ # Create a temporary layer and add it to bblayers.conf
+ self._create_temp_layer(templayerdir, True, 'templayer')
+ # Update recipe in templayer
+ result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir))
+ self.assertNotIn('WARNING:', result.output)
+ # Check recipe is still clean
+ self._check_repo_status(os.path.dirname(recipefile), [])
+ splitpath = os.path.dirname(recipefile).split(os.sep)
+ appenddir = os.path.join(templayerdir, splitpath[-2], splitpath[-1])
+ bbappendfile = self._check_bbappend(testrecipe, recipefile, appenddir)
+ patchfile = os.path.join(appenddir, testrecipe, '0001-Add-new-file.patch')
+ new_local_file = os.path.join(appenddir, testrecipe, 'new_local')
+ local_file = os.path.join(appenddir, testrecipe, 'makedevs.c')
+ self.assertExists(patchfile, 'Patch file 0001-Add-new-file.patch not created')
+ self.assertExists(local_file, 'File makedevs.c not created')
+ self.assertExists(patchfile, 'File new_local not created')
def test_devtool_update_recipe_local_files_2(self):
"""Check local source files support when oe-local-files is in Git"""