diff options
author | Scott Weaver <weaverjs@gmail.com> | 2021-09-05 18:27:37 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-09-07 21:54:39 +0100 |
commit | 3b58b1fc1c4d7351029cc24a2dd8f0d776cef00c (patch) | |
tree | eaf128bf5bf67df2f412aa4365ce08cc7163eefa | |
parent | 4939a4198234c8dab1348590663c4681edae8fc9 (diff) | |
download | poky-3b58b1fc1c4d7351029cc24a2dd8f0d776cef00c.tar.gz |
bitbake: bitbake: tests/fetch: add downloadfilename tests
This adds three new tests which evaluate different use cases of the
downloadfilename property.
bb.tests.fetch.FetcherNetworkTest:
- test_fetch_specify_downloadfilename
- test_fetch_premirror_specify_downloadfilename_regex_uri
- test_fetch_premirror_specify_downloadfilename_specific_uri
(Bitbake rev: 61db3e96530d650e098436fd086f0182d32998f7)
Signed-off-by: Scott Weaver <weaverjs@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/tests/fetch.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index 9291ce4a06..1735d0b071 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py | |||
@@ -867,6 +867,27 @@ class FetcherNetworkTest(FetcherTest): | |||
867 | self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749) | 867 | self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749) |
868 | 868 | ||
869 | @skipIfNoNetwork() | 869 | @skipIfNoNetwork() |
870 | def test_fetch_specify_downloadfilename(self): | ||
871 | fetcher = bb.fetch.Fetch(["http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz;downloadfilename=bitbake-v1.0.0.tar.gz"], self.d) | ||
872 | fetcher.download() | ||
873 | self.assertEqual(os.path.getsize(self.dldir + "/bitbake-v1.0.0.tar.gz"), 57749) | ||
874 | |||
875 | @skipIfNoNetwork() | ||
876 | def test_fetch_premirror_specify_downloadfilename_regex_uri(self): | ||
877 | self.d.setVar("PREMIRRORS", "http://.*/.* http://downloads.yoctoproject.org/releases/bitbake/") | ||
878 | fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz;downloadfilename=bitbake-v1.0.0.tar.gz"], self.d) | ||
879 | fetcher.download() | ||
880 | self.assertEqual(os.path.getsize(self.dldir + "/bitbake-v1.0.0.tar.gz"), 57749) | ||
881 | |||
882 | @skipIfNoNetwork() | ||
883 | # BZ13039 | ||
884 | def test_fetch_premirror_specify_downloadfilename_specific_uri(self): | ||
885 | self.d.setVar("PREMIRRORS", "http://invalid.yoctoproject.org/releases/bitbake http://downloads.yoctoproject.org/releases/bitbake") | ||
886 | fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz;downloadfilename=bitbake-v1.0.0.tar.gz"], self.d) | ||
887 | fetcher.download() | ||
888 | self.assertEqual(os.path.getsize(self.dldir + "/bitbake-v1.0.0.tar.gz"), 57749) | ||
889 | |||
890 | @skipIfNoNetwork() | ||
870 | def gitfetcher(self, url1, url2): | 891 | def gitfetcher(self, url1, url2): |
871 | def checkrevision(self, fetcher): | 892 | def checkrevision(self, fetcher): |
872 | fetcher.unpack(self.unpackdir) | 893 | fetcher.unpack(self.unpackdir) |