diff options
| author | Julien Stephan <jstephan@baylibre.com> | 2024-05-15 14:56:00 -0400 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-06-05 05:57:12 -0700 |
| commit | a905386e10cdd9465ebdde683fc7ae3abddb9134 (patch) | |
| tree | a28975666cb5c5eb389440f1b7a1ac1015b70edb | |
| parent | d00c23ef3e8b868a6f6ce3a22ed95e25fd6187b5 (diff) | |
| download | poky-a905386e10cdd9465ebdde683fc7ae3abddb9134.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)
(From OE-Core rev: 0532a6292edbe68303b6d85017ebcdb36a60886f)
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>
Signed-off-by: Jeff Harris <jefftharris@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -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""" |
