summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2015-07-08 18:34:18 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-12 22:50:42 +0100
commit913631c4666ea3e7a5484ad8340fca44c015c390 (patch)
tree7c955d280a872c5b0dfcd470594edf5bb6e86e65 /bitbake/lib/bb
parent3b186fba59163c5a4eacdaf1be7899b60a1482ee (diff)
downloadpoky-913631c4666ea3e7a5484ad8340fca44c015c390.tar.gz
bitbake: tests/fetch.py: Add FetchCheckStatusTest tests.
Add tests for checkstatus method using http with/without connection cache. [YOCTO #7796] (Bitbake rev: b1f2d3edefb7dd274174eb983666213b0f49c994) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-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()