aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/VPPUtil.py
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2019-10-30 14:29:49 +0000
committerPeter Mikus <pmikus@cisco.com>2019-10-30 14:35:53 +0000
commit3ccfe8cdb3d94182e365f4bfacefbb52fb32cb93 (patch)
treeaf12e4f8c14921a2ebc59cbcda5c28704c211090 /resources/libraries/python/VPPUtil.py
parent96eaabff284f154ca96ce823fee205bd9833043b (diff)
Framework: Add show log as tear down action
+ We can see what is happening when debug level is increased + Big caveat of VPP is that it does not allow to configure default global level. Signed-off-by: Peter Mikus <pmikus@cisco.com> Change-Id: I5ea1a618161cdb3170cab022d7451e52271f83c0
Diffstat (limited to 'resources/libraries/python/VPPUtil.py')
-rw-r--r--resources/libraries/python/VPPUtil.py35
1 files changed, 22 insertions, 13 deletions
diff --git a/resources/libraries/python/VPPUtil.py b/resources/libraries/python/VPPUtil.py
index 432a589cd3..72b6142306 100644
--- a/resources/libraries/python/VPPUtil.py
+++ b/resources/libraries/python/VPPUtil.py
@@ -259,10 +259,10 @@ class VPPUtil(object):
VPPUtil.vpp_enable_traces_on_dut(node, fail_on_error)
@staticmethod
- def vpp_enable_elog_traces_on_dut(node):
- """Enable API/CLI/Barrier traces on the DUT node.
+ def vpp_enable_elog_traces(node):
+ """Enable API/CLI/Barrier traces on the specified topology node.
- :param node: DUT node to set up.
+ :param node: Topology node.
:type node: dict
"""
PapiSocketExecutor.run_cli_cmd(node, "elog trace api cli barrier")
@@ -276,13 +276,13 @@ class VPPUtil(object):
"""
for node in nodes.values():
if node['type'] == NodeType.DUT:
- VPPUtil.vpp_enable_elog_traces_on_dut(node)
+ VPPUtil.vpp_enable_elog_traces(node)
@staticmethod
- def show_event_logger_on_dut(node):
- """Show event logger on the DUT node.
+ def show_event_logger(node):
+ """Show event logger on the specified topology node.
- :param node: DUT node to show traces on.
+ :param node: Topology node.
:type node: dict
"""
PapiSocketExecutor.run_cli_cmd(node, "show event-logger")
@@ -296,18 +296,27 @@ class VPPUtil(object):
"""
for node in nodes.values():
if node['type'] == NodeType.DUT:
- VPPUtil.show_event_logger_on_dut(node)
+ VPPUtil.show_event_logger(node)
@staticmethod
def show_log(node):
- """Show log on the specified topology node.
+ """Show logging on the specified topology node.
:param node: Topology node.
:type node: dict
- :returns: VPP log data.
- :rtype: list
"""
- return PapiSocketExecutor.run_cli_cmd(node, "show log")
+ PapiSocketExecutor.run_cli_cmd(node, "show logging")
+
+ @staticmethod
+ def show_log_on_all_duts(nodes):
+ """Show logging on all DUTs in the given topology.
+
+ :param nodes: Nodes in the topology.
+ :type nodes: dict
+ """
+ for node in nodes.values():
+ if node['type'] == NodeType.DUT:
+ VPPUtil.show_log(node)
@staticmethod
def vpp_show_threads(node):
@@ -331,6 +340,6 @@ class VPPUtil(object):
thread_data.append(item)
threads_data.append(thread_data)
- logger.info("show threads:\n{threads}".format(threads=threads_data))
+ logger.trace("show threads:\n{threads}".format(threads=threads_data))
return threads_data