diff options
-rw-r--r-- | bitbake/lib/bb/tests/fetch.py | 35 |
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 | ||
549 | class 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 | |||
549 | class FetcherLocalTest(FetcherTest): | 584 | class FetcherLocalTest(FetcherTest): |
550 | def setUp(self): | 585 | def setUp(self): |
551 | def touch(fn): | 586 | def touch(fn): |