summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Wallace <dwallacelf@gmail.com>2017-02-16 11:25:26 -0500
committerDamjan Marion <dmarion.lists@gmail.com>2017-02-19 13:51:11 +0000
commit90c55724b583434957cf83555a084770f2efdd7a (patch)
treeea03cef7c58522802dc397f6f14e8b9979f979aa
parent6cfc39c3e9522470e82f4cd43e6cd992a0d67ed1 (diff)
make test: save + dump VPP api trace log; VPP-640
Change-Id: I20aacc927f2b04f42b0a7220c4283560b4d2a359 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
-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"""