[gnome-continuous-yocto/gnomeostree-3.28-rocko: 7586/8267] bitbake: tests/fetch: handle network failures gracefully
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 7586/8267] bitbake: tests/fetch: handle network failures gracefully
- Date: Sun, 17 Dec 2017 06:27:22 +0000 (UTC)
commit 96f258ba12d3184a631e846c73a23d131ebc6e7e
Author: Ross Burton <ross burton intel com>
Date: Thu Sep 7 10:24:25 2017 +0100
bitbake: tests/fetch: handle network failures gracefully
If there is a network failure the return value from latest_versionstring() is
('','') which later causes an exception when comparing versions.
Improve this by checking the return value and failing the test early.
[ YOCTO #12053 ]
(Bitbake rev: 3f034d2172bf64ecc43577b43e0cf032a54b1358)
Signed-off-by: Ross Burton <ross burton intel com>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
bitbake/lib/bb/tests/fetch.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index faa5c74..209b13f 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -793,6 +793,7 @@ class FetchLatestVersionTest(FetcherTest):
ud = bb.fetch2.FetchData(k[1], self.d)
pupver= ud.method.latest_versionstring(ud, self.d)
verstring = pupver[0]
+ self.assertTrue(verstring, msg="Could not find upstream version")
r = bb.utils.vercmp_string(v, verstring)
self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v,
verstring))
@@ -804,6 +805,7 @@ class FetchLatestVersionTest(FetcherTest):
ud = bb.fetch2.FetchData(k[1], self.d)
pupver = ud.method.latest_versionstring(ud, self.d)
verstring = pupver[0]
+ self.assertTrue(verstring, msg="Could not find upstream version")
r = bb.utils.vercmp_string(v, verstring)
self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v,
verstring))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]