jvpp: log error output of Java process on test failure 62/11562/3
authorMarek Gradzki <mgradzki@cisco.com>
Fri, 6 Apr 2018 10:00:52 +0000 (12:00 +0200)
committerDamjan Marion <dmarion.lists@gmail.com>
Mon, 9 Apr 2018 14:09:06 +0000 (14:09 +0000)
helps troubleshooting JVpp test failures.

Change-Id: I4747832a0610ace168285bfe423c506ba4e00700
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
test/test_jvpp.py

index 2497ff6..c3b9357 100644 (file)
@@ -124,9 +124,12 @@ class TestJVpp(VppTestCase):
 
         out, err = self.process.communicate()
         self.logger.info("Process output : {0}{1}".format(os.linesep, out))
-        self.logger.info("Process error output : {0}{1}"
-                         .format(os.linesep, err))
-        self.assert_equal(self.process.returncode, 0, "process return code")
+
+        if self.process.returncode != 0:
+            raise Exception(
+                "Command {0} failed with return code: {1}.{2}"
+                "Process error output: {2}{3}"
+                .format(command, self.process.returncode, os.linesep, err))
 
     def tearDown(self):
         self.logger.info("Tearing down jvpp test")