[gnome-continuous-yocto/gnomeostree-3.28-rocko: 4507/8267] oeqa/runtime: Improve failure log output
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 4507/8267] oeqa/runtime: Improve failure log output
- Date: Sun, 17 Dec 2017 02:08:02 +0000 (UTC)
commit 6840618f1a718d3aa8fd9e7e4fd3ffde01559e7d
Author: Richard Purdie <richard purdie linuxfoundation org>
Date: Fri Feb 3 10:30:59 2017 +0000
oeqa/runtime: Improve failure log output
Printing a message which says "configure failed" without the log output
is effectively useless. If a command fails, print the output by default
and simplify the calling code which makes debugging any of these failures
much easier.
(From OE-Core rev: b6352ff001c29f0bff10c18879b92c5618ec645c)
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
meta/lib/oeqa/runtime/cases/buildcvs.py | 11 +++--------
meta/lib/oeqa/runtime/cases/buildgalculator.py | 7 ++-----
meta/lib/oeqa/runtime/cases/buildiptables.py | 11 +++--------
meta/lib/oeqa/runtime/utils/targetbuildproject.py | 6 +++++-
4 files changed, 13 insertions(+), 22 deletions(-)
---
diff --git a/meta/lib/oeqa/runtime/cases/buildcvs.py b/meta/lib/oeqa/runtime/cases/buildcvs.py
index 341eb49..c3f3acc 100644
--- a/meta/lib/oeqa/runtime/cases/buildcvs.py
+++ b/meta/lib/oeqa/runtime/cases/buildcvs.py
@@ -25,11 +25,6 @@ class BuildCvsTest(OERuntimeTestCase):
'Test requires tools-sdk to be in IMAGE_FEATURES')
@OETestDepends(['ssh.SSHTest.test_ssh'])
def test_cvs(self):
- self.assertEqual(self.project.run_configure(), 0,
- msg="Running configure failed")
-
- self.assertEqual(self.project.run_make(), 0,
- msg="Running make failed")
-
- self.assertEqual(self.project.run_install(), 0,
- msg="Running make install failed")
+ self.project.run_configure()
+ self.project.run_make()
+ self.project.run_install()
diff --git a/meta/lib/oeqa/runtime/cases/buildgalculator.py b/meta/lib/oeqa/runtime/cases/buildgalculator.py
index 0bd76f9..7c9d4a3 100644
--- a/meta/lib/oeqa/runtime/cases/buildgalculator.py
+++ b/meta/lib/oeqa/runtime/cases/buildgalculator.py
@@ -24,8 +24,5 @@ class GalculatorTest(OERuntimeTestCase):
'Test requires tools-sdk to be in IMAGE_FEATURES')
@OETestDepends(['ssh.SSHTest.test_ssh'])
def test_galculator(self):
- self.assertEqual(self.project.run_configure(), 0,
- msg="Running configure failed")
-
- self.assertEqual(self.project.run_make(), 0,
- msg="Running make failed")
+ self.project.run_configure()
+ self.project.run_make()
diff --git a/meta/lib/oeqa/runtime/cases/buildiptables.py b/meta/lib/oeqa/runtime/cases/buildiptables.py
index bae8039..002b16c 100644
--- a/meta/lib/oeqa/runtime/cases/buildiptables.py
+++ b/meta/lib/oeqa/runtime/cases/buildiptables.py
@@ -25,14 +25,9 @@ class BuildIptablesTest(OERuntimeTestCase):
'Test requires tools-sdk to be in IMAGE_FEATURES')
@OETestDepends(['ssh.SSHTest.test_ssh'])
def test_iptables(self):
- self.assertEqual(self.project.run_configure(), 0,
- msg="Running configure failed")
-
- self.assertEqual(self.project.run_make(), 0,
- msg="Running make failed")
-
- self.assertEqual(self.project.run_install(), 0,
- msg="Running make install failed")
+ self.project.run_configure()
+ self.project.run_make()
+ self.project.run_install()
@classmethod
def tearDownClass(self):
diff --git a/meta/lib/oeqa/runtime/utils/targetbuildproject.py
b/meta/lib/oeqa/runtime/utils/targetbuildproject.py
index 1ed5789..551b0b6 100644
--- a/meta/lib/oeqa/runtime/utils/targetbuildproject.py
+++ b/meta/lib/oeqa/runtime/utils/targetbuildproject.py
@@ -33,4 +33,8 @@ class TargetBuildProject(BuildProject):
# The timeout parameter of target.run is set to 0
# to make the ssh command run with no timeout.
def _run(self, cmd):
- return self.target.run(cmd, 0)[0]
+ ret = self.target.run(cmd, 0)
+ msg = "Command %s failed with exit code %s: %s" % (cmd, ret[0], ret[1])
+ if ret[0] != 0:
+ raise Exception(msg)
+ return ret[0]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]