summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2021-11-02 17:02:44 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-03 12:30:51 +0000
commit1a344c32427d57d5b41c5172e9644718f511f860 (patch)
tree1d8c8498d2a8cc9ba35d98a4305e6da7796aa1fa /bitbake
parent57e91d61362a78c090dac0374f30138c5a02f163 (diff)
downloadpoky-1a344c32427d57d5b41c5172e9644718f511f860.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: 057cbba6b7ade134e4fa3584b9e896be025a6f46) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 20aabc3d53f69949810ecf02295725db947ffef8) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-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)