summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests/fetch.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/tests/fetch.py')
-rw-r--r--bitbake/lib/bb/tests/fetch.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index ff66315aa5..5359531282 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -463,6 +463,55 @@ class MirrorUriTest(FetcherTest):
463 'https://BBBB/B/B/B/bitbake/bitbake-1.0.tar.gz', 463 'https://BBBB/B/B/B/bitbake/bitbake-1.0.tar.gz',
464 'http://AAAA/A/A/A/B/B/bitbake/bitbake-1.0.tar.gz']) 464 'http://AAAA/A/A/A/B/B/bitbake/bitbake-1.0.tar.gz'])
465 465
466
467class GitDownloadDirectoryNamingTest(FetcherTest):
468 def setUp(self):
469 super(GitDownloadDirectoryNamingTest, self).setUp()
470 self.recipe_url = "git://git.openembedded.org/bitbake"
471 self.recipe_dir = "git.openembedded.org.bitbake"
472 self.mirror_url = "git://github.com/openembedded/bitbake.git"
473 self.mirror_dir = "github.com.openembedded.bitbake.git"
474
475 self.d.setVar('SRCREV', '82ea737a0b42a8b53e11c9cde141e9e9c0bd8c40')
476
477 def setup_mirror_rewrite(self):
478 self.d.setVar("PREMIRRORS", self.recipe_url + " " + self.mirror_url + " \n")
479
480 @skipIfNoNetwork()
481 def test_that_directory_is_named_after_recipe_url_when_no_mirroring_is_used(self):
482 self.setup_mirror_rewrite()
483 fetcher = bb.fetch.Fetch([self.recipe_url], self.d)
484
485 fetcher.download()
486
487 dir = os.listdir(self.dldir + "/git2")
488 self.assertIn(self.recipe_dir, dir)
489
490 @skipIfNoNetwork()
491 def test_that_directory_exists_for_mirrored_url_and_recipe_url_when_mirroring_is_used(self):
492 self.setup_mirror_rewrite()
493 fetcher = bb.fetch.Fetch([self.recipe_url], self.d)
494
495 fetcher.download()
496
497 dir = os.listdir(self.dldir + "/git2")
498 self.assertIn(self.mirror_dir, dir)
499 self.assertIn(self.recipe_dir, dir)
500
501 @skipIfNoNetwork()
502 def test_that_recipe_directory_and_mirrored_directory_exists_when_mirroring_is_used_and_the_mirrored_directory_already_exists(self):
503 self.setup_mirror_rewrite()
504 fetcher = bb.fetch.Fetch([self.mirror_url], self.d)
505 fetcher.download()
506 fetcher = bb.fetch.Fetch([self.recipe_url], self.d)
507
508 fetcher.download()
509
510 dir = os.listdir(self.dldir + "/git2")
511 self.assertIn(self.mirror_dir, dir)
512 self.assertIn(self.recipe_dir, dir)
513
514
466class FetcherLocalTest(FetcherTest): 515class FetcherLocalTest(FetcherTest):
467 def setUp(self): 516 def setUp(self):
468 def touch(fn): 517 def touch(fn):