summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/tests/fetch.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index 0ecf044f38..5f24918a96 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -223,6 +223,21 @@ class URITest(unittest.TestCase):
223 'query': {}, 223 'query': {},
224 'relative': False 224 'relative': False
225 }, 225 },
226 "git://tfs-example.org:22/tfs/example%20path/example.git": {
227 'uri': 'git://tfs-example.org:22/tfs/example%20path/example.git',
228 'scheme': 'git',
229 'hostname': 'tfs-example.org',
230 'port': 22,
231 'hostport': 'tfs-example.org:22',
232 'path': '/tfs/example path/example.git',
233 'userinfo': '',
234 'userinfo': '',
235 'username': '',
236 'password': '',
237 'params': {},
238 'query': {},
239 'relative': False
240 },
226 "http://somesite.net;someparam=1": { 241 "http://somesite.net;someparam=1": {
227 'uri': 'http://somesite.net;someparam=1', 242 'uri': 'http://somesite.net;someparam=1',
228 'scheme': 'http', 243 'scheme': 'http',
@@ -2080,6 +2095,38 @@ class GitLfsTest(FetcherTest):
2080 shutil.rmtree(self.gitdir, ignore_errors=True) 2095 shutil.rmtree(self.gitdir, ignore_errors=True)
2081 fetcher.unpack(self.d.getVar('WORKDIR')) 2096 fetcher.unpack(self.d.getVar('WORKDIR'))
2082 2097
2098class GitURLWithSpacesTest(FetcherTest):
2099 test_git_urls = {
2100 "git://tfs-example.org:22/tfs/example%20path/example.git" : {
2101 'url': 'git://tfs-example.org:22/tfs/example%20path/example.git',
2102 'gitsrcname': 'tfs-example.org.22.tfs.example_path.example.git',
2103 'path': '/tfs/example path/example.git'
2104 },
2105 "git://tfs-example.org:22/tfs/example%20path/example%20repo.git" : {
2106 'url': 'git://tfs-example.org:22/tfs/example%20path/example%20repo.git',
2107 'gitsrcname': 'tfs-example.org.22.tfs.example_path.example_repo.git',
2108 'path': '/tfs/example path/example repo.git'
2109 }
2110 }
2111
2112 def test_urls(self):
2113
2114 # Set fake SRCREV to stop git fetcher from trying to contact non-existent git repo
2115 self.d.setVar('SRCREV', '82ea737a0b42a8b53e11c9cde141e9e9c0bd8c40')
2116
2117 for test_git_url, ref in self.test_git_urls.items():
2118
2119 fetcher = bb.fetch.Fetch([test_git_url], self.d)
2120 ud = fetcher.ud[fetcher.urls[0]]
2121
2122 self.assertEqual(ud.url, ref['url'])
2123 self.assertEqual(ud.path, ref['path'])
2124 self.assertEqual(ud.localfile, os.path.join(self.dldir, "git2", ref['gitsrcname']))
2125 self.assertEqual(ud.localpath, os.path.join(self.dldir, "git2", ref['gitsrcname']))
2126 self.assertEqual(ud.lockfile, os.path.join(self.dldir, "git2", ref['gitsrcname'] + '.lock'))
2127 self.assertEqual(ud.clonedir, os.path.join(self.dldir, "git2", ref['gitsrcname']))
2128 self.assertEqual(ud.fullmirror, os.path.join(self.dldir, "git2_" + ref['gitsrcname'] + '.tar.gz'))
2129
2083class NPMTest(FetcherTest): 2130class NPMTest(FetcherTest):
2084 def skipIfNoNpm(): 2131 def skipIfNoNpm():
2085 import shutil 2132 import shutil