diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-12-23 12:33:10 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-12-25 08:18:14 +0000 |
commit | 4d06fb730798297c994961dfb0f9b601fa618c3b (patch) | |
tree | 1f774a8435e8b73ce14ddaf9bb66cea24faab830 | |
parent | 544533922d73c9bbf2aaa537b4cb482a2b89e291 (diff) | |
download | poky-4d06fb730798297c994961dfb0f9b601fa618c3b.tar.gz |
bitbake: tests/fetch: Add versionstring tests to network tests list, fix print()
The versionstring tests hit the network so should only run when
network tests are enabled.
Also remove the print statement which confuses the test output and
add it to the test failure message instead.
(Bitbake rev: 6c046660cfc4fb3792a42aeafff91a13f68a2e89)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/tests/fetch.py | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index 3f80c4a033..6eb0f2dc18 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py | |||
@@ -624,23 +624,23 @@ class FetchMethodTest(FetcherTest): | |||
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") | 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", | 625 | : "6.1.19", |
626 | } | 626 | } |
627 | 627 | if os.environ.get("BB_SKIP_NETTESTS") == "yes": | |
628 | def test_git_latest_versionstring(self): | 628 | print("Unset BB_SKIP_NETTESTS to run network tests") |
629 | for k, v in self.test_git_uris.items(): | 629 | else: |
630 | self.d.setVar("SRCREV", k[2]) | 630 | def test_git_latest_versionstring(self): |
631 | self.d.setVar("GITTAGREGEX", k[3]) | 631 | for k, v in self.test_git_uris.items(): |
632 | ud = bb.fetch2.FetchData(k[1], self.d) | 632 | self.d.setVar("SRCREV", k[2]) |
633 | verstring = ud.method.latest_versionstring(ud, self.d) | 633 | self.d.setVar("GITTAGREGEX", k[3]) |
634 | print("Package %s, version: %s <= %s" % (k[0], v, verstring)) | 634 | ud = bb.fetch2.FetchData(k[1], self.d) |
635 | r = bb.utils.vercmp_string(v, verstring) | 635 | verstring = ud.method.latest_versionstring(ud, self.d) |
636 | self.assertTrue(r == -1 or r == 0) | 636 | r = bb.utils.vercmp_string(v, verstring) |
637 | 637 | self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v, verstring)) | |
638 | def test_wget_latest_versionstring(self): | 638 | |
639 | for k, v in self.test_wget_uris.items(): | 639 | def test_wget_latest_versionstring(self): |
640 | self.d.setVar("REGEX_URI", k[2]) | 640 | for k, v in self.test_wget_uris.items(): |
641 | self.d.setVar("REGEX", k[3]) | 641 | self.d.setVar("REGEX_URI", k[2]) |
642 | ud = bb.fetch2.FetchData(k[1], self.d) | 642 | self.d.setVar("REGEX", k[3]) |
643 | verstring = ud.method.latest_versionstring(ud, self.d) | 643 | ud = bb.fetch2.FetchData(k[1], self.d) |
644 | print("Package %s, version: %s <= %s" % (k[0], v, verstring)) | 644 | verstring = ud.method.latest_versionstring(ud, self.d) |
645 | r = bb.utils.vercmp_string(v, verstring) | 645 | r = bb.utils.vercmp_string(v, verstring) |
646 | self.assertTrue(r == -1 or r == 0) | 646 | self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v, verstring)) |