aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2023-12-22 08:49:10 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2023-12-22 08:50:45 +0100
commit432c5f9214bab12f3d9fe6c044bf12b5c9d69902 (patch)
tree7813a1be27d935e02d8d2c6ae1f3c2710771533e
parent048e6f5bf9f44fdeb5eb256749eb6a72d5b3dc3c (diff)
Print netperf logs in console if exception
Change-Id: I7ea76aaa595ba7716d4a355f8a1f2d73c2af3ae8 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit 10d72a2e5c8a78cde617d2c10fa0ea46d90f6924)
-rw-r--r--functest_kubernetes/netperf/netperf.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/functest_kubernetes/netperf/netperf.py b/functest_kubernetes/netperf/netperf.py
index 7f77807b..b3642085 100644
--- a/functest_kubernetes/netperf/netperf.py
+++ b/functest_kubernetes/netperf/netperf.py
@@ -60,8 +60,10 @@ class Netperf(testcase.TestCase):
self.__logger.info("%s\n%s", " ".join(cmd), output.decode("utf-8"))
self.result = 100
status = testcase.TestCase.EX_OK
- except Exception: # pylint: disable=broad-except
- self.__logger.exception("Can not run Netperf")
+ except subprocess.SubprocessError as exc:
+ self.__logger.exception(
+ "Cannot run Netperf:\n%s", ' '.join(exc.cmd),
+ exc.output.decode("utf-8"))
self.result = 0
status = testcase.TestCase.EX_RUN_ERROR
self.stop_time = time.time()