mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
bitbake: tests/fetch: add tests for local and remote "noshared" git fetching
(Bitbake rev: e0267fe43bda208856af939b17e39beb9e5586c3) Signed-off-by: Henning Schild <henning.schild@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
d274cf0cf8
commit
46654e14a5
@@ -708,6 +708,18 @@ class FetcherLocalTest(FetcherTest):
|
||||
def test_local_gitfetch_usehead_withname(self):
|
||||
self.dummyGitTest("usehead=1;name=newName")
|
||||
|
||||
def test_local_gitfetch_shared(self):
|
||||
self.dummyGitTest("usehead=1;name=sharedName")
|
||||
alt = os.path.join(self.unpackdir, 'git/.git/objects/info/alternates')
|
||||
self.assertTrue(os.path.exists(alt))
|
||||
|
||||
def test_local_gitfetch_noshared(self):
|
||||
self.d.setVar('BB_GIT_NOSHARED', '1')
|
||||
self.unpackdir += '_noshared'
|
||||
self.dummyGitTest("usehead=1;name=noSharedName")
|
||||
alt = os.path.join(self.unpackdir, 'git/.git/objects/info/alternates')
|
||||
self.assertFalse(os.path.exists(alt))
|
||||
|
||||
class FetcherNoNetworkTest(FetcherTest):
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
@@ -2628,3 +2640,29 @@ class NPMTest(FetcherTest):
|
||||
fetcher = bb.fetch.Fetch(['npmsw://' + swfile], self.d)
|
||||
fetcher.download()
|
||||
self.assertTrue(os.path.exists(ud.localpath))
|
||||
|
||||
class GitSharedTest(FetcherTest):
|
||||
def setUp(self):
|
||||
super(GitSharedTest, self).setUp()
|
||||
self.recipe_url = "git://git.openembedded.org/bitbake"
|
||||
self.d.setVar('SRCREV', '82ea737a0b42a8b53e11c9cde141e9e9c0bd8c40')
|
||||
|
||||
@skipIfNoNetwork()
|
||||
def test_shared_unpack(self):
|
||||
fetcher = bb.fetch.Fetch([self.recipe_url], self.d)
|
||||
|
||||
fetcher.download()
|
||||
fetcher.unpack(self.unpackdir)
|
||||
alt = os.path.join(self.unpackdir, 'git/.git/objects/info/alternates')
|
||||
self.assertTrue(os.path.exists(alt))
|
||||
|
||||
@skipIfNoNetwork()
|
||||
def test_noshared_unpack(self):
|
||||
self.d.setVar('BB_GIT_NOSHARED', '1')
|
||||
self.unpackdir += '_noshared'
|
||||
fetcher = bb.fetch.Fetch([self.recipe_url], self.d)
|
||||
|
||||
fetcher.download()
|
||||
fetcher.unpack(self.unpackdir)
|
||||
alt = os.path.join(self.unpackdir, 'git/.git/objects/info/alternates')
|
||||
self.assertFalse(os.path.exists(alt))
|
||||
|
||||
Reference in New Issue
Block a user