summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests/fetch.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/tests/fetch.py')
-rw-r--r--bitbake/lib/bb/tests/fetch.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index aa9b222612..9d45743fdf 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -600,6 +600,31 @@ class FetchMethodTest(FetcherTest):
600 : "3.82+dbg0.9", 600 : "3.82+dbg0.9",
601 } 601 }
602 602
603 test_wget_uris = {
604 # packages with versions inside directory name
605 ("util-linux", "http://kernel.org/pub/linux/utils/util-linux/v2.23/util-linux-2.24.2.tar.bz2", "", "")
606 : "2.24.2",
607 ("enchant", "http://www.abisource.com/downloads/enchant/1.6.0/enchant-1.6.0.tar.gz", "", "")
608 : "1.6.0",
609 ("cmake", "http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz", "", "")
610 : "2.8.12.1",
611 # packages with versions only in current directory
612 ("eglic", "http://downloads.yoctoproject.org/releases/eglibc/eglibc-2.18-svnr23787.tar.bz2", "", "")
613 : "2.19",
614 ("gnu-config", "http://downloads.yoctoproject.org/releases/gnu-config/gnu-config-20120814.tar.bz2", "", "")
615 : "20120814",
616 # packages with "99" in the name of possible version
617 ("pulseaudio", "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-4.0.tar.xz", "", "")
618 : "5.0",
619 ("xserver-xorg", "http://xorg.freedesktop.org/releases/individual/xserver/xorg-server-1.15.1.tar.bz2", "", "")
620 : "1.15.1",
621 # packages with valid REGEX_URI and REGEX
622 ("cups", "http://www.cups.org/software/1.7.2/cups-1.7.2-source.tar.bz2", "http://www.cups.org/software.php", "/software\.php\?VERSION=2\.0\.0&FILE=2\.0\.0/(?P<name>cups\-)(?P<pver>((\d+[\.\-_]*)+))\-source\.tar\.gz")
623 : "2.0.0",
624 ("db", "http://download.oracle.com/berkeley-db/db-5.3.21.tar.gz", "http://www.oracle.com/technetwork/products/berkeleydb/downloads/index-082944.html", "http://download.oracle.com/otn/berkeley-db/(?P<name>db-)(?P<pver>((\d+[\.\-_]*)+))\.tar\.gz")
625 : "6.1.19",
626 }
627
603 def test_git_latest_versionstring(self): 628 def test_git_latest_versionstring(self):
604 for k, v in self.test_git_uris.items(): 629 for k, v in self.test_git_uris.items():
605 self.d.setVar("SRCREV", k[2]) 630 self.d.setVar("SRCREV", k[2])
@@ -609,3 +634,13 @@ class FetchMethodTest(FetcherTest):
609 print("Package %s, version: %s <= %s" % (k[0], v, verstring)) 634 print("Package %s, version: %s <= %s" % (k[0], v, verstring))
610 r = bb.utils.vercmp_string(v, verstring) 635 r = bb.utils.vercmp_string(v, verstring)
611 self.assertTrue(r == -1 or r == 0) 636 self.assertTrue(r == -1 or r == 0)
637
638 def test_wget_latest_versionstring(self):
639 for k, v in self.test_wget_uris.items():
640 self.d.setVar("REGEX_URI", k[2])
641 self.d.setVar("REGEX", k[3])
642 ud = bb.fetch2.FetchData(k[1], self.d)
643 verstring = ud.method.latest_versionstring(ud, self.d)
644 print("Package %s, version: %s <= %s" % (k[0], v, verstring))
645 r = bb.utils.vercmp_string(v, verstring)
646 self.assertTrue(r == -1 or r == 0)