bitbake: tests/fetch.py: add multiple fetches test

Fetch from premirror few times to emulate multiple machines sharing same
clonedir or few rebuilds of the package from (pre)mirror
Regression test for [Yocto #15369]

(Bitbake rev: 7fcbac574c68f16b95ab7abb2874931d168d3c9e)

Signed-off-by: Pavel Zhukov <pavel@zhukoff.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Pavel Zhukov
2024-01-27 13:15:37 +01:00
committed by Richard Purdie
parent b2d0f31d24
commit de27ecd228

View File

@@ -3083,6 +3083,24 @@ class FetchPremirroronlyLocalTest(FetcherTest):
self.git("checkout {}".format(head), self.gitdir)
return newrev
def test_mirror_multiple_fetches(self):
self.make_git_repo()
self.d.setVar("SRCREV", self.git_new_commit())
fetcher = bb.fetch.Fetch([self.recipe_url], self.d)
fetcher.download()
fetcher.unpack(self.unpackdir)
## New commit in premirror. it's not in the download_dir
self.d.setVar("SRCREV", self.git_new_commit())
fetcher2 = bb.fetch.Fetch([self.recipe_url], self.d)
fetcher2.download()
fetcher2.unpack(self.unpackdir)
## New commit in premirror. it's not in the download_dir
self.d.setVar("SRCREV", self.git_new_commit())
fetcher3 = bb.fetch.Fetch([self.recipe_url], self.d)
fetcher3.download()
fetcher3.unpack(self.unpackdir)
def test_mirror_commit_nonexistent(self):
self.make_git_repo()
self.d.setVar("SRCREV", "0"*40)