summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/tests/fetch.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index 561650e185..1132af5b21 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -710,3 +710,42 @@ class FetchMethodTest(FetcherTest):
710 verstring = ud.method.latest_versionstring(ud, self.d) 710 verstring = ud.method.latest_versionstring(ud, self.d)
711 r = bb.utils.vercmp_string(v, verstring) 711 r = bb.utils.vercmp_string(v, verstring)
712 self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v, verstring)) 712 self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v, verstring))
713
714
715class FetchCheckStatusTest(FetcherTest):
716 test_wget_uris = ["http://www.cups.org/software/1.7.2/cups-1.7.2-source.tar.bz2",
717 "http://www.cups.org/software/ipptool/ipptool-20130731-linux-ubuntu-i686.tar.gz",
718 "http://www.cups.org/",
719 "http://downloads.yoctoproject.org/releases/sato/sato-engine-0.1.tar.gz",
720 "http://downloads.yoctoproject.org/releases/sato/sato-engine-0.2.tar.gz",
721 "http://downloads.yoctoproject.org/releases/sato/sato-engine-0.3.tar.gz",
722 "http://downloads.yoctoproject.org/releases/opkg/opkg-0.1.7.tar.gz",
723 "http://downloads.yoctoproject.org/releases/opkg/opkg-0.3.0.tar.gz"]
724
725 if os.environ.get("BB_SKIP_NETTESTS") == "yes":
726 print("Unset BB_SKIP_NETTESTS to run network tests")
727 else:
728
729 def test_wget_checkstatus(self):
730 fetch = bb.fetch2.Fetch(self.test_wget_uris, self.d)
731 for u in self.test_wget_uris:
732 ud = fetch.ud[u]
733 m = ud.method
734 ret = m.checkstatus(fetch, ud, self.d)
735 self.assertTrue(ret, msg="URI %s, can't check status" % (u))
736
737
738 def test_wget_checkstatus_connection_cache(self):
739 from bb.fetch2 import FetchConnectionCache
740
741 connection_cache = FetchConnectionCache()
742 fetch = bb.fetch2.Fetch(self.test_wget_uris, self.d,
743 connection_cache = connection_cache)
744
745 for u in self.test_wget_uris:
746 ud = fetch.ud[u]
747 m = ud.method
748 ret = m.checkstatus(fetch, ud, self.d)
749 self.assertTrue(ret, msg="URI %s, can't check status" % (u))
750
751 connection_cache.close_connections()