diff options
author | Julien Stephan <jstephan@baylibre.com> | 2024-04-15 21:20:10 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-04-25 10:10:14 +0100 |
commit | aace45f9b811020f26c710ffb14c44211dfdec57 (patch) | |
tree | 60ca729d469f266379f7a02dfe3b474dcd1d03c8 /meta | |
parent | 28516320d81f1767be24fb3226021f16b425d355 (diff) | |
download | poky-aace45f9b811020f26c710ffb14c44211dfdec57.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: bd44c895d36e246a25c7a6e40bf9f4089dc7a297)
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/devtool.py | 20 |
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""" |