summaryrefslogtreecommitdiffstats
path: root/bitbake
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
commit36fcd5eda967dd5fb97b4fb6645dc8418e95c64b (patch)
treee133d4c3b940ca5112b3acd8fc2fc8fcd8ed1b79 /bitbake
parentb6a972922b156bc95980239e2e5f4253768dfb5e (diff)
downloadpoky-36fcd5eda967dd5fb97b4fb6645dc8418e95c64b.tar.gz
bitbake: fetch2/git: add tests to capture existing behavior wrt. naming of git shallow tarball
The mapping of the URLs to the local shallow tarballs is not obvious. For easier understanding, we add this tests to explicitly showing the mapping. (Bitbake rev: 05f2ac8e19a027d103921b5ae0070db609a83042) 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>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/tests/fetch.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index dcc4d8ce48..79be1be0b0 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -546,6 +546,41 @@ class TarballNamingTest(FetcherTest):
546 self.assertIn(self.mirror_tarball, dir) 546 self.assertIn(self.mirror_tarball, dir)
547 547
548 548
549class GitShallowTarballNamingTest(FetcherTest):
550 def setUp(self):
551 super(GitShallowTarballNamingTest, self).setUp()
552 self.recipe_url = "git://git.openembedded.org/bitbake"
553 self.recipe_tarball = "gitshallow_git.openembedded.org.bitbake_82ea737-1_master.tar.gz"
554 self.mirror_url = "git://github.com/openembedded/bitbake.git"
555 self.mirror_tarball = "gitshallow_github.com.openembedded.bitbake.git_82ea737-1_master.tar.gz"
556
557 self.d.setVar('BB_GIT_SHALLOW', '1')
558 self.d.setVar('BB_GENERATE_SHALLOW_TARBALLS', '1')
559 self.d.setVar('SRCREV', '82ea737a0b42a8b53e11c9cde141e9e9c0bd8c40')
560
561 def setup_mirror_rewrite(self):
562 self.d.setVar("PREMIRRORS", self.recipe_url + " " + self.mirror_url + " \n")
563
564 @skipIfNoNetwork()
565 def test_that_the_tarball_is_named_after_recipe_url_when_no_mirroring_is_used(self):
566 fetcher = bb.fetch.Fetch([self.recipe_url], self.d)
567
568 fetcher.download()
569
570 dir = os.listdir(self.dldir)
571 self.assertIn(self.recipe_tarball, dir)
572
573 @skipIfNoNetwork()
574 def test_that_the_mirror_tarball_is_created_when_mirroring_is_used(self):
575 self.setup_mirror_rewrite()
576 fetcher = bb.fetch.Fetch([self.recipe_url], self.d)
577
578 fetcher.download()
579
580 dir = os.listdir(self.dldir)
581 self.assertIn(self.mirror_tarball, dir)
582
583
549class FetcherLocalTest(FetcherTest): 584class FetcherLocalTest(FetcherTest):
550 def setUp(self): 585 def setUp(self):
551 def touch(fn): 586 def touch(fn):