aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/framework.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/framework.py b/test/framework.py
index beed1803554..90e0574a890 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -142,6 +142,7 @@ class VppTestCase(unittest.TestCase):
debug_cli = "cli-listen localhost:5002"
cls.vpp_cmdline = [cls.vpp_bin,
"unix", "{", "nodaemon", debug_cli, "}",
+ "api-trace", "{", "on", "}",
"api-segment", "{", "prefix", cls.shm_prefix, "}"]
if cls.plugin_path is not None:
cls.vpp_cmdline.extend(["plugin_path", cls.plugin_path])
@@ -336,6 +337,16 @@ class VppTestCase(unittest.TestCase):
self.logger.info(self.vapi.ppcli("show error"))
self.logger.info(self.vapi.ppcli("show run"))
self.registry.remove_vpp_config(self.logger)
+ # Save/Dump VPP api trace log
+ api_trace = "vpp_api_trace.%s.log" % self._testMethodName
+ tmp_api_trace = "/tmp/%s" % api_trace
+ vpp_api_trace_log = "%s/%s" % (self.tempdir, api_trace)
+ self.logger.info(self.vapi.ppcli("api trace save %s" % api_trace))
+ self.logger.info("Moving %s to %s\n" % (tmp_api_trace,
+ vpp_api_trace_log))
+ os.rename(tmp_api_trace, vpp_api_trace_log)
+ self.logger.info(self.vapi.ppcli("api trace dump %s" %
+ vpp_api_trace_log))
def setUp(self):
""" Clear trace before running each test"""