summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof.johansson@axis.com>2013-03-26 09:28:38 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-03-29 10:45:17 +0000
commit911dbbd8ee4bb4aada554e0975eba1570db4c6d1 (patch)
treeb255982dbc9532c6442f8bcf0217ac47d275cfec
parent2f4fe1ee111a3dff68ac1cea6f3f6767cd6fe4eb (diff)
downloadast2050-yocto-poky-911dbbd8ee4bb4aada554e0975eba1570db4c6d1.zip
ast2050-yocto-poky-911dbbd8ee4bb4aada554e0975eba1570db4c6d1.tar.gz
bitbake: bb.tests.fetch: Opt-out for unittests that require network
With this change, you can opt-out to skip unit tests that require an internet connection. To opt-out, you'll set the environment variable BB_SKIP_NETTESTS to 'yes'. (Bitbake rev: 9ff5f172096a4f51b6b085307506473405dc4f59) Signed-off-by: Olof Johansson <olof.johansson@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/tests/fetch.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index 778d94f..46db7e5 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -308,6 +308,8 @@ class FetcherTest(unittest.TestCase):
def tearDown(self):
bb.utils.prunedir(self.tempdir)
+ @unittest.skipIf(os.environ.get("BB_SKIP_NETTESTS") == "yes",
+ "Unset BB_SKIP_NETTESTS to run network tests")
def test_fetch(self):
fetcher = bb.fetch.Fetch(["http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", "http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.1.tar.gz"], self.d)
fetcher.download()
@@ -320,12 +322,16 @@ class FetcherTest(unittest.TestCase):
self.assertEqual(len(os.listdir(self.unpackdir + "/bitbake-1.0/")), 9)
self.assertEqual(len(os.listdir(self.unpackdir + "/bitbake-1.1/")), 9)
+ @unittest.skipIf(os.environ.get("BB_SKIP_NETTESTS") == "yes",
+ "Unset BB_SKIP_NETTESTS to run network tests")
def test_fetch_mirror(self):
self.d.setVar("MIRRORS", "http://.*/.* http://downloads.yoctoproject.org/releases/bitbake")
fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz"], self.d)
fetcher.download()
self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749)
+ @unittest.skipIf(os.environ.get("BB_SKIP_NETTESTS") == "yes",
+ "Unset BB_SKIP_NETTESTS to run network tests")
def test_fetch_premirror(self):
self.d.setVar("PREMIRRORS", "http://.*/.* http://downloads.yoctoproject.org/releases/bitbake")
fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz"], self.d)
@@ -351,21 +357,29 @@ class FetcherTest(unittest.TestCase):
fetcher.download()
checkrevision(self, fetcher)
+ @unittest.skipIf(os.environ.get("BB_SKIP_NETTESTS") == "yes",
+ "Unset BB_SKIP_NETTESTS to run network tests")
def test_gitfetch(self):
url1 = url2 = "git://git.openembedded.org/bitbake"
self.gitfetcher(url1, url2)
+ @unittest.skipIf(os.environ.get("BB_SKIP_NETTESTS") == "yes",
+ "Unset BB_SKIP_NETTESTS to run network tests")
def test_gitfetch_premirror(self):
url1 = "git://git.openembedded.org/bitbake"
url2 = "git://someserver.org/bitbake"
self.d.setVar("PREMIRRORS", "git://someserver.org/bitbake git://git.openembedded.org/bitbake \n")
self.gitfetcher(url1, url2)
+ @unittest.skipIf(os.environ.get("BB_SKIP_NETTESTS") == "yes",
+ "Unset BB_SKIP_NETTESTS to run network tests")
def test_gitfetch_premirror2(self):
url1 = url2 = "git://someserver.org/bitbake"
self.d.setVar("PREMIRRORS", "git://someserver.org/bitbake git://git.openembedded.org/bitbake \n")
self.gitfetcher(url1, url2)
+ @unittest.skipIf(os.environ.get("BB_SKIP_NETTESTS") == "yes",
+ "Unset BB_SKIP_NETTESTS to run network tests")
def test_gitfetch_premirror3(self):
realurl = "git://git.openembedded.org/bitbake"
dummyurl = "git://someserver.org/bitbake"
OpenPOWER on IntegriCloud