]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/runtime: Improve failure log output
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 3 Feb 2017 10:30:59 +0000 (10:30 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 5 Feb 2017 09:20:22 +0000 (09:20 +0000)
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/runtime/cases/buildcvs.py
meta/lib/oeqa/runtime/cases/buildgalculator.py
meta/lib/oeqa/runtime/cases/buildiptables.py
meta/lib/oeqa/runtime/utils/targetbuildproject.py

index 341eb4959d9b2fd7e883312d7ceee0bb2434f230..c3f3acc736210d22de5132ce51cfa5ebde8944c6 100644 (file)
@@ -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()
index 0bd76f9ea28d3b5a6d489235479017b7b645eff4..7c9d4a392bb7073232c8572bcd7de91b4028ad1d 100644 (file)
@@ -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()
index bae80392d9dd3dacd4e76d967915934aa4eb9e69..002b16c48350e39ebc137fb2aac26a65a8875e85 100644 (file)
@@ -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):
index 1ed5789ae521928643c447dadddc4522e01925fb..551b0b6f27ffe010c8b198583c7a2d56d3223844 100644 (file)
@@ -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]