summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests/fetch.py
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2021-10-17 20:45:29 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-01 11:12:16 +0000
commit1e5744c46d2bed5ae751f6878a2dd0a295baa551 (patch)
treefeedbda758d1b084e29fad5b32106720b8f8f393 /bitbake/lib/bb/tests/fetch.py
parente36765222d9e79f41253f55a7173dc972ff3411b (diff)
downloadpoky-1e5744c46d2bed5ae751f6878a2dd0a295baa551.tar.gz
bitbake: tests/fetch.py: add test case to ensure downloadfilename is used for premirror
Add a test case test_fetch_premirror_use_downloadfilename_to_fetch to ensure that 'downloadfilename' is used when fetching from premirror. Although the other two previous test cases, test_fetch_premirror_specify_downloadfilename_regex_uri and test_fetch_premirror_specify_downloadfilename_specific_uri already implicitly contain such verification, we still need to add a very clear case to ensure no regression. (Bitbake rev: 20aabc3d53f69949810ecf02295725db947ffef8) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tests/fetch.py')
-rw-r--r--bitbake/lib/bb/tests/fetch.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index d06580db88..a008e7cc5b 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -888,6 +888,14 @@ class FetcherNetworkTest(FetcherTest):
888 self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749) 888 self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749)
889 889
890 @skipIfNoNetwork() 890 @skipIfNoNetwork()
891 def test_fetch_premirror_use_downloadfilename_to_fetch(self):
892 # Ensure downloadfilename is used when fetching from premirror.
893 self.d.setVar("PREMIRRORS", "http://.*/.* https://downloads.yoctoproject.org/releases/bitbake")
894 fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/releases/bitbake/bitbake-1.1.tar.gz;downloadfilename=bitbake-1.0.tar.gz"], self.d)
895 fetcher.download()
896 self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749)
897
898 @skipIfNoNetwork()
891 def gitfetcher(self, url1, url2): 899 def gitfetcher(self, url1, url2):
892 def checkrevision(self, fetcher): 900 def checkrevision(self, fetcher):
893 fetcher.unpack(self.unpackdir) 901 fetcher.unpack(self.unpackdir)