diff options
author | Alexandre Truong <alexandre.truong@smile.fr> | 2024-04-26 12:13:37 +0200 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2024-06-19 08:34:58 -0700 |
commit | afba27a984637c423b019750e34def623db8d25b (patch) | |
tree | 4759cfb8fae8c87df8a705ec5085d3889c0a0135 /meta | |
parent | 35bd8118fc9d02d1819c3d5a26b74170abb281d6 (diff) | |
download | poky-afba27a984637c423b019750e34def623db8d25b.tar.gz |
oeqa/selftest/devtool: fix _test_devtool_add_git_url
This patch is a follow-up to the bug#15466.
As a reminder, the bug was about devtool’s submodule detection
checking for HEAD when a version is being passed.
As Vincent Kriek pointed out:
the --version that is being passed to devtool is only used for
setting the PV value in the recipe. To take into account the tag,
we add --srcrev to the command:
devtool add --srcrev v3.1.0 --version v3.1.0 mbedtls git://git@github.com/ARMmbed/mbedtls.git;protocol=https
Changes to _test_devtool_add_git_url have been made to take
into account the srcrev. srcrev will be passed as an optional
parameter because the test_devtool_add_git_style1
does not need the srcrev contrary to test_devtool_add_git_style2
Fixes [YOCTO #15466]
(From OE-Core rev: c297b78454da2a668e62dec95d7b6eb6e5429480)
Signed-off-by: Alexandre Truong <alexandre.truong@smile.fr>
Reported-by: Alexandre Truong <alexandre.truong@smile.fr>
Suggested-by: Vincent Kriek <vincent@coelebs.dev>
Reviewed-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit a8686f3641e4407dee3d807898ffd620e2732b78)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/devtool.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index cc4cbec5ae..1597aeedff 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py | |||
@@ -286,10 +286,13 @@ class DevtoolTestCase(OESelftestTestCase): | |||
286 | else: | 286 | else: |
287 | self.skipTest('No tap devices found - you must set up tap devices with scripts/runqemu-gen-tapdevs before running this test') | 287 | self.skipTest('No tap devices found - you must set up tap devices with scripts/runqemu-gen-tapdevs before running this test') |
288 | 288 | ||
289 | def _test_devtool_add_git_url(self, git_url, version, pn, resulting_src_uri): | 289 | def _test_devtool_add_git_url(self, git_url, version, pn, resulting_src_uri, srcrev=None): |
290 | self.track_for_cleanup(self.workspacedir) | 290 | self.track_for_cleanup(self.workspacedir) |
291 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | 291 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') |
292 | result = runCmd('devtool add --version %s %s %s' % (version, pn, git_url)) | 292 | command = 'devtool add --version %s %s %s' % (version, pn, git_url) |
293 | if srcrev : | ||
294 | command += ' --srcrev %s' %srcrev | ||
295 | result = runCmd(command) | ||
293 | self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created') | 296 | self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created') |
294 | # Check the recipe name is correct | 297 | # Check the recipe name is correct |
295 | recipefile = get_bb_var('FILE', pn) | 298 | recipefile = get_bb_var('FILE', pn) |
@@ -479,11 +482,12 @@ class DevtoolAddTests(DevtoolBase): | |||
479 | 482 | ||
480 | def test_devtool_add_git_style2(self): | 483 | def test_devtool_add_git_style2(self): |
481 | version = 'v3.1.0' | 484 | version = 'v3.1.0' |
485 | srcrev = 'v3.1.0' | ||
482 | pn = 'mbedtls' | 486 | pn = 'mbedtls' |
483 | # this will trigger reformat_git_uri with branch parameter in url | 487 | # this will trigger reformat_git_uri with branch parameter in url |
484 | git_url = "'git://git@github.com/ARMmbed/mbedtls.git;protocol=https'" | 488 | git_url = "'git://git@github.com/ARMmbed/mbedtls.git;protocol=https'" |
485 | resulting_src_uri = "gitsm://git@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master" | 489 | resulting_src_uri = "gitsm://git@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master" |
486 | self._test_devtool_add_git_url(git_url, version, pn, resulting_src_uri) | 490 | self._test_devtool_add_git_url(git_url, version, pn, resulting_src_uri, srcrev) |
487 | 491 | ||
488 | def test_devtool_add_library(self): | 492 | def test_devtool_add_library(self): |
489 | # Fetch source | 493 | # Fetch source |