summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-02-10 13:44:22 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-02-17 17:51:03 +0000
commitae00fcd63844e51be16862f08cb648f4566f6e8f (patch)
tree8720f9db4f67243ba708616c8f5ec35a00446e4a /meta/lib/oeqa/selftest
parent383ade4e3ce0043f8202b1692df6ad5c9edb15cc (diff)
downloadpoky-ae00fcd63844e51be16862f08cb648f4566f6e8f.tar.gz
selftest/bbtests: Add tests for git floating tag resolution
This test ensures that where a floating tag is used for a git url, there aren't a number of different bugs such as inconsistent source revisions for the tag within a given build and that the recipe is reparsed at each run to ensure the tag is checked. A test is also added to ensure that the build fails if SRCPV (get_srcrev()) isn't used yet there is a floating tag. (From OE-Core rev: 33554ba3c034fc31744b27392afe751d645d6c2e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest')
-rw-r--r--meta/lib/oeqa/selftest/cases/bbtests.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/bbtests.py b/meta/lib/oeqa/selftest/cases/bbtests.py
index 246cb032bf..695cabef8a 100644
--- a/meta/lib/oeqa/selftest/cases/bbtests.py
+++ b/meta/lib/oeqa/selftest/cases/bbtests.py
@@ -312,3 +312,27 @@ INHERIT:remove = \"report-error\"
312 self.assertFalse(fatal, "Failed to patch using PATCHTOOL=\"git\"") 312 self.assertFalse(fatal, "Failed to patch using PATCHTOOL=\"git\"")
313 self.delete_recipeinc(test_recipe) 313 self.delete_recipeinc(test_recipe)
314 bitbake('-cclean man-db') 314 bitbake('-cclean man-db')
315
316 def test_git_unpack_nonetwork(self):
317 """
318 Test that a recipe with a floating tag that needs to be resolved upstream doesn't
319 access the network in a patch task run in a separate builld invocation
320 """
321
322 # Enable the recipe to float using a distro override
323 self.write_config("DISTROOVERRIDES .= \":gitunpack-enable-recipe\"")
324
325 bitbake('gitunpackoffline -c fetch')
326 bitbake('gitunpackoffline -c patch')
327
328 def test_git_unpack_nonetwork_fail(self):
329 """
330 Test that a recipe with a floating tag which doesn't call get_srcrev() in the fetcher
331 raises an error when the fetcher is called.
332 """
333
334 # Enable the recipe to float using a distro override
335 self.write_config("DISTROOVERRIDES .= \":gitunpack-enable-recipe\"")
336
337 result = bitbake('gitunpackoffline-fail -c fetch', ignore_status=True)
338 self.assertTrue("Recipe uses a floating tag/branch without a fixed SRCREV" in result.output, msg = "Recipe without PV set to SRCPV should have failed: %s" % result.output)