diff options
| -rw-r--r-- | bitbake/lib/bb/tests/fetch.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index ab02bc74ac..0f7585e119 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py | |||
| @@ -708,6 +708,18 @@ class FetcherLocalTest(FetcherTest): | |||
| 708 | def test_local_gitfetch_usehead_withname(self): | 708 | def test_local_gitfetch_usehead_withname(self): |
| 709 | self.dummyGitTest("usehead=1;name=newName") | 709 | self.dummyGitTest("usehead=1;name=newName") |
| 710 | 710 | ||
| 711 | def test_local_gitfetch_shared(self): | ||
| 712 | self.dummyGitTest("usehead=1;name=sharedName") | ||
| 713 | alt = os.path.join(self.unpackdir, 'git/.git/objects/info/alternates') | ||
| 714 | self.assertTrue(os.path.exists(alt)) | ||
| 715 | |||
| 716 | def test_local_gitfetch_noshared(self): | ||
| 717 | self.d.setVar('BB_GIT_NOSHARED', '1') | ||
| 718 | self.unpackdir += '_noshared' | ||
| 719 | self.dummyGitTest("usehead=1;name=noSharedName") | ||
| 720 | alt = os.path.join(self.unpackdir, 'git/.git/objects/info/alternates') | ||
| 721 | self.assertFalse(os.path.exists(alt)) | ||
| 722 | |||
| 711 | class FetcherNoNetworkTest(FetcherTest): | 723 | class FetcherNoNetworkTest(FetcherTest): |
| 712 | def setUp(self): | 724 | def setUp(self): |
| 713 | super().setUp() | 725 | super().setUp() |
| @@ -2628,3 +2640,29 @@ class NPMTest(FetcherTest): | |||
| 2628 | fetcher = bb.fetch.Fetch(['npmsw://' + swfile], self.d) | 2640 | fetcher = bb.fetch.Fetch(['npmsw://' + swfile], self.d) |
| 2629 | fetcher.download() | 2641 | fetcher.download() |
| 2630 | self.assertTrue(os.path.exists(ud.localpath)) | 2642 | self.assertTrue(os.path.exists(ud.localpath)) |
| 2643 | |||
| 2644 | class GitSharedTest(FetcherTest): | ||
| 2645 | def setUp(self): | ||
| 2646 | super(GitSharedTest, self).setUp() | ||
| 2647 | self.recipe_url = "git://git.openembedded.org/bitbake" | ||
| 2648 | self.d.setVar('SRCREV', '82ea737a0b42a8b53e11c9cde141e9e9c0bd8c40') | ||
| 2649 | |||
| 2650 | @skipIfNoNetwork() | ||
| 2651 | def test_shared_unpack(self): | ||
| 2652 | fetcher = bb.fetch.Fetch([self.recipe_url], self.d) | ||
| 2653 | |||
| 2654 | fetcher.download() | ||
| 2655 | fetcher.unpack(self.unpackdir) | ||
| 2656 | alt = os.path.join(self.unpackdir, 'git/.git/objects/info/alternates') | ||
| 2657 | self.assertTrue(os.path.exists(alt)) | ||
| 2658 | |||
| 2659 | @skipIfNoNetwork() | ||
| 2660 | def test_noshared_unpack(self): | ||
| 2661 | self.d.setVar('BB_GIT_NOSHARED', '1') | ||
| 2662 | self.unpackdir += '_noshared' | ||
| 2663 | fetcher = bb.fetch.Fetch([self.recipe_url], self.d) | ||
| 2664 | |||
| 2665 | fetcher.download() | ||
| 2666 | fetcher.unpack(self.unpackdir) | ||
| 2667 | alt = os.path.join(self.unpackdir, 'git/.git/objects/info/alternates') | ||
| 2668 | self.assertFalse(os.path.exists(alt)) | ||
