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 /bitbake/lib/bb/tests/fetch.py | |
parent | 544533922d73c9bbf2aaa537b4cb482a2b89e291 (diff) | |
download | ast2050-yocto-poky-4d06fb730798297c994961dfb0f9b601fa618c3b.zip ast2050-yocto-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>
Diffstat (limited to 'bitbake/lib/bb/tests/fetch.py')
-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 3f80c4a..6eb0f2d 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py @@ -624,23 +624,23 @@ class FetchMethodTest(FetcherTest): ("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") : "6.1.19", } - - def test_git_latest_versionstring(self): - for k, v in self.test_git_uris.items(): - self.d.setVar("SRCREV", k[2]) - self.d.setVar("GITTAGREGEX", k[3]) - ud = bb.fetch2.FetchData(k[1], self.d) - verstring = ud.method.latest_versionstring(ud, self.d) - print("Package %s, version: %s <= %s" % (k[0], v, verstring)) - r = bb.utils.vercmp_string(v, verstring) - self.assertTrue(r == -1 or r == 0) - - def test_wget_latest_versionstring(self): - for k, v in self.test_wget_uris.items(): - self.d.setVar("REGEX_URI", k[2]) - self.d.setVar("REGEX", k[3]) - ud = bb.fetch2.FetchData(k[1], self.d) - verstring = ud.method.latest_versionstring(ud, self.d) - print("Package %s, version: %s <= %s" % (k[0], v, verstring)) - r = bb.utils.vercmp_string(v, verstring) - self.assertTrue(r == -1 or r == 0) + if os.environ.get("BB_SKIP_NETTESTS") == "yes": + print("Unset BB_SKIP_NETTESTS to run network tests") + else: + def test_git_latest_versionstring(self): + for k, v in self.test_git_uris.items(): + self.d.setVar("SRCREV", k[2]) + self.d.setVar("GITTAGREGEX", k[3]) + ud = bb.fetch2.FetchData(k[1], self.d) + verstring = ud.method.latest_versionstring(ud, self.d) + r = bb.utils.vercmp_string(v, verstring) + self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v, verstring)) + + def test_wget_latest_versionstring(self): + for k, v in self.test_wget_uris.items(): + self.d.setVar("REGEX_URI", k[2]) + self.d.setVar("REGEX", k[3]) + ud = bb.fetch2.FetchData(k[1], self.d) + verstring = ud.method.latest_versionstring(ud, self.d) + r = bb.utils.vercmp_string(v, verstring) + self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v, verstring)) |