diff options
author | Urs Fässler <urs.fassler@bbv.ch> | 2018-10-15 13:43:19 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-10-17 12:24:05 +0100 |
commit | c604d9402b4c9ad7eb5c794ab24f2f348d9719a9 (patch) | |
tree | e492c54abc87d7081b072e560d9d24195f89f346 /lib | |
parent | 5f92682389fee437d6df2ff7718c571b7444e179 (diff) | |
download | bitbake-contrib-c604d9402b4c9ad7eb5c794ab24f2f348d9719a9.tar.gz |
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.
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 'lib')
-rw-r--r-- | lib/bb/tests/fetch.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py index 535953128..dcc4d8ce4 100644 --- a/lib/bb/tests/fetch.py +++ b/lib/bb/tests/fetch.py @@ -512,6 +512,40 @@ class GitDownloadDirectoryNamingTest(FetcherTest): self.assertIn(self.recipe_dir, dir) +class TarballNamingTest(FetcherTest): + def setUp(self): + super(TarballNamingTest, self).setUp() + self.recipe_url = "git://git.openembedded.org/bitbake" + self.recipe_tarball = "git2_git.openembedded.org.bitbake.tar.gz" + self.mirror_url = "git://github.com/openembedded/bitbake.git" + self.mirror_tarball = "git2_github.com.openembedded.bitbake.git.tar.gz" + + self.d.setVar('BB_GENERATE_MIRROR_TARBALLS', '1') + self.d.setVar('SRCREV', '82ea737a0b42a8b53e11c9cde141e9e9c0bd8c40') + + def setup_mirror_rewrite(self): + self.d.setVar("PREMIRRORS", self.recipe_url + " " + self.mirror_url + " \n") + + @skipIfNoNetwork() + def test_that_the_recipe_tarball_is_created_when_no_mirroring_is_used(self): + fetcher = bb.fetch.Fetch([self.recipe_url], self.d) + + fetcher.download() + + dir = os.listdir(self.dldir) + self.assertIn(self.recipe_tarball, dir) + + @skipIfNoNetwork() + def test_that_the_mirror_tarball_is_created_when_mirroring_is_used(self): + self.setup_mirror_rewrite() + fetcher = bb.fetch.Fetch([self.recipe_url], self.d) + + fetcher.download() + + dir = os.listdir(self.dldir) + self.assertIn(self.mirror_tarball, dir) + + class FetcherLocalTest(FetcherTest): def setUp(self): def touch(fn): |