diff options
| author | Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> | 2025-02-07 13:46:50 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-02-11 21:18:39 +0000 |
| commit | e69304675db437bb9d94e4008955d3d5d5e4fd65 (patch) | |
| tree | 35544598d645fc8130e72b61ad95ec01d5b91663 | |
| parent | 2b71696f35eca128857e09b0a40d9e39992b1c2d (diff) | |
| download | poky-e69304675db437bb9d94e4008955d3d5d5e4fd65.tar.gz | |
bitbake: tests: fetch: add test for file URI with @
(Bitbake rev: f169704ef48f04da33aaca8b1ad5d8d7eabf8fd6)
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | bitbake/lib/bb/tests/fetch.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index d647170112..3be7db3589 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py | |||
| @@ -323,6 +323,21 @@ class URITest(unittest.TestCase): | |||
| 323 | 'params': {"downloadfilename" : "EGPL-T101.zip"}, | 323 | 'params': {"downloadfilename" : "EGPL-T101.zip"}, |
| 324 | 'query': {"9BE0BF6657": None}, | 324 | 'query': {"9BE0BF6657": None}, |
| 325 | 'relative': False | 325 | 'relative': False |
| 326 | }, | ||
| 327 | "file://example@.service": { | ||
| 328 | 'uri': 'file:example%40.service', | ||
| 329 | 'scheme': 'file', | ||
| 330 | 'hostname': '', | ||
| 331 | 'port': None, | ||
| 332 | 'hostport': '', | ||
| 333 | 'path': 'example@.service', | ||
| 334 | 'userinfo': '', | ||
| 335 | 'userinfo': '', | ||
| 336 | 'username': '', | ||
| 337 | 'password': '', | ||
| 338 | 'params': {}, | ||
| 339 | 'query': {}, | ||
| 340 | 'relative': True | ||
| 326 | } | 341 | } |
| 327 | 342 | ||
| 328 | } | 343 | } |
| @@ -728,6 +743,7 @@ class FetcherLocalTest(FetcherTest): | |||
| 728 | os.makedirs(self.localsrcdir) | 743 | os.makedirs(self.localsrcdir) |
| 729 | touch(os.path.join(self.localsrcdir, 'a')) | 744 | touch(os.path.join(self.localsrcdir, 'a')) |
| 730 | touch(os.path.join(self.localsrcdir, 'b')) | 745 | touch(os.path.join(self.localsrcdir, 'b')) |
| 746 | touch(os.path.join(self.localsrcdir, 'c@d')) | ||
| 731 | os.makedirs(os.path.join(self.localsrcdir, 'dir')) | 747 | os.makedirs(os.path.join(self.localsrcdir, 'dir')) |
| 732 | touch(os.path.join(self.localsrcdir, 'dir', 'c')) | 748 | touch(os.path.join(self.localsrcdir, 'dir', 'c')) |
| 733 | touch(os.path.join(self.localsrcdir, 'dir', 'd')) | 749 | touch(os.path.join(self.localsrcdir, 'dir', 'd')) |
| @@ -759,6 +775,10 @@ class FetcherLocalTest(FetcherTest): | |||
| 759 | tree = self.fetchUnpack(['file://a', 'file://dir/c']) | 775 | tree = self.fetchUnpack(['file://a', 'file://dir/c']) |
| 760 | self.assertEqual(tree, ['a', 'dir/c']) | 776 | self.assertEqual(tree, ['a', 'dir/c']) |
| 761 | 777 | ||
| 778 | def test_local_at(self): | ||
| 779 | tree = self.fetchUnpack(['file://c@d']) | ||
| 780 | self.assertEqual(tree, ['c@d']) | ||
| 781 | |||
| 762 | def test_local_backslash(self): | 782 | def test_local_backslash(self): |
| 763 | tree = self.fetchUnpack([r'file://backslash\x2dsystemd-unit.device']) | 783 | tree = self.fetchUnpack([r'file://backslash\x2dsystemd-unit.device']) |
| 764 | self.assertEqual(tree, [r'backslash\x2dsystemd-unit.device']) | 784 | self.assertEqual(tree, [r'backslash\x2dsystemd-unit.device']) |
| @@ -1388,6 +1408,7 @@ class URLHandle(unittest.TestCase): | |||
| 1388 | "cvs://anoncvs:anonymous@cvs.handhelds.org/cvs;tag=V0-99-81;module=familiar/dist/ipkg" : ('cvs', 'cvs.handhelds.org', '/cvs', 'anoncvs', 'anonymous', collections.OrderedDict([('tag', 'V0-99-81'), ('module', 'familiar/dist/ipkg')])), | 1408 | "cvs://anoncvs:anonymous@cvs.handhelds.org/cvs;tag=V0-99-81;module=familiar/dist/ipkg" : ('cvs', 'cvs.handhelds.org', '/cvs', 'anoncvs', 'anonymous', collections.OrderedDict([('tag', 'V0-99-81'), ('module', 'familiar/dist/ipkg')])), |
| 1389 | "git://git.openembedded.org/bitbake;branch=@foo;protocol=https" : ('git', 'git.openembedded.org', '/bitbake', '', '', {'branch': '@foo', 'protocol' : 'https'}), | 1409 | "git://git.openembedded.org/bitbake;branch=@foo;protocol=https" : ('git', 'git.openembedded.org', '/bitbake', '', '', {'branch': '@foo', 'protocol' : 'https'}), |
| 1390 | "file://somelocation;someparam=1": ('file', '', 'somelocation', '', '', {'someparam': '1'}), | 1410 | "file://somelocation;someparam=1": ('file', '', 'somelocation', '', '', {'someparam': '1'}), |
| 1411 | "file://example@.service": ('file', '', 'example@.service', '', '', {}), | ||
| 1391 | "https://somesite.com/somerepo.git;user=anyUser:idtoken=1234" : ('https', 'somesite.com', '/somerepo.git', '', '', {'user': 'anyUser:idtoken=1234'}), | 1412 | "https://somesite.com/somerepo.git;user=anyUser:idtoken=1234" : ('https', 'somesite.com', '/somerepo.git', '', '', {'user': 'anyUser:idtoken=1234'}), |
| 1392 | r'git://s.o-me_ONE:!#$%^&*()-_={}[]\|:?,.<>~`@git.openembedded.org/bitbake;branch=main;protocol=https': ('git', 'git.openembedded.org', '/bitbake', 's.o-me_ONE', r'!#$%^&*()-_={}[]\|:?,.<>~`', {'branch': 'main', 'protocol' : 'https'}), | 1413 | r'git://s.o-me_ONE:!#$%^&*()-_={}[]\|:?,.<>~`@git.openembedded.org/bitbake;branch=main;protocol=https': ('git', 'git.openembedded.org', '/bitbake', 's.o-me_ONE', r'!#$%^&*()-_={}[]\|:?,.<>~`', {'branch': 'main', 'protocol' : 'https'}), |
| 1393 | } | 1414 | } |
| @@ -1405,8 +1426,11 @@ class URLHandle(unittest.TestCase): | |||
| 1405 | self.assertEqual(result, v) | 1426 | self.assertEqual(result, v) |
| 1406 | 1427 | ||
| 1407 | def test_encodeurl(self): | 1428 | def test_encodeurl(self): |
| 1429 | import urllib.parse | ||
| 1408 | for k, v in self.datatable.items(): | 1430 | for k, v in self.datatable.items(): |
| 1409 | result = bb.fetch.encodeurl(v) | 1431 | result = bb.fetch.encodeurl(v) |
| 1432 | if result.startswith("file:"): | ||
| 1433 | result = urllib.parse.unquote(result) | ||
| 1410 | self.assertEqual(result, k) | 1434 | self.assertEqual(result, k) |
| 1411 | 1435 | ||
| 1412 | class FetchLatestVersionTest(FetcherTest): | 1436 | class FetchLatestVersionTest(FetcherTest): |
