summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUrs Fässler <urs.fassler@bbv.ch>2018-10-15 13:43:19 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-18 10:59:26 +0100
commitb6a972922b156bc95980239e2e5f4253768dfb5e (patch)
treea99726ab0937f7eb269d92a30bdb5b4ccbe91614
parentffac9c20f5b8bb084bdac2888ea5df6bc5e58684 (diff)
downloadpoky-b6a972922b156bc95980239e2e5f4253768dfb5e.tar.gz
bitbake: fetch2/git: add tests to capture existing behavior wrt. naming of mirror tarball
The mapping of the URLs to the local tarballs is not obvious. For easier understanding, we add this tests to explicitly showing the mapping. (Bitbake rev: c604d9402b4c9ad7eb5c794ab24f2f348d9719a9) Signed-off-by: Urs Fässler <urs.fassler@bbv.ch> Signed-off-by: Pascal Bach <pascal.bach@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/tests/fetch.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index 5359531282..dcc4d8ce48 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -512,6 +512,40 @@ class GitDownloadDirectoryNamingTest(FetcherTest):
512 self.assertIn(self.recipe_dir, dir) 512 self.assertIn(self.recipe_dir, dir)
513 513
514 514
515class TarballNamingTest(FetcherTest):
516 def setUp(self):
517 super(TarballNamingTest, self).setUp()
518 self.recipe_url = "git://git.openembedded.org/bitbake"
519 self.recipe_tarball = "git2_git.openembedded.org.bitbake.tar.gz"
520 self.mirror_url = "git://github.com/openembedded/bitbake.git"
521 self.mirror_tarball = "git2_github.com.openembedded.bitbake.git.tar.gz"
522
523 self.d.setVar('BB_GENERATE_MIRROR_TARBALLS', '1')
524 self.d.setVar('SRCREV', '82ea737a0b42a8b53e11c9cde141e9e9c0bd8c40')
525
526 def setup_mirror_rewrite(self):
527 self.d.setVar("PREMIRRORS", self.recipe_url + " " + self.mirror_url + " \n")
528
529 @skipIfNoNetwork()
530 def test_that_the_recipe_tarball_is_created_when_no_mirroring_is_used(self):
531 fetcher = bb.fetch.Fetch([self.recipe_url], self.d)
532
533 fetcher.download()
534
535 dir = os.listdir(self.dldir)
536 self.assertIn(self.recipe_tarball, dir)
537
538 @skipIfNoNetwork()
539 def test_that_the_mirror_tarball_is_created_when_mirroring_is_used(self):
540 self.setup_mirror_rewrite()
541 fetcher = bb.fetch.Fetch([self.recipe_url], self.d)
542
543 fetcher.download()
544
545 dir = os.listdir(self.dldir)
546 self.assertIn(self.mirror_tarball, dir)
547
548
515class FetcherLocalTest(FetcherTest): 549class FetcherLocalTest(FetcherTest):
516 def setUp(self): 550 def setUp(self):
517 def touch(fn): 551 def touch(fn):