aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/Trace.py
diff options
context:
space:
mode:
authorJan Gelety <jgelety@cisco.com>2018-03-22 13:51:33 +0100
committerTibor Frank <tifrank@cisco.com>2018-04-23 11:14:42 +0000
commit73a01b1a7fc836c964627eea2c08106df0da5aee (patch)
treedb6fb92714f92a7f6c7ab95b89877ded0e36891c /resources/libraries/python/Trace.py
parentcd330b5a1bf1a289e7dad68420679a5d94de1eda (diff)
CSIT-1009: SRv6 proxy tests
- SRv6 with endpoint to SR-unaware Service Function via static proxy - SRv6 with endpoint to SR-unaware Service Function via dynamic proxy - SRv6 with endpoint to SR-unaware Service Function via masquerading proxy Change-Id: I6a6062cb41d810bf9e27dacfd866181bfde4c693 Signed-off-by: Jan Gelety <jgelety@cisco.com>
Diffstat (limited to 'resources/libraries/python/Trace.py')
-rw-r--r--resources/libraries/python/Trace.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/resources/libraries/python/Trace.py b/resources/libraries/python/Trace.py
index c61a8deda4..10a55ce140 100644
--- a/resources/libraries/python/Trace.py
+++ b/resources/libraries/python/Trace.py
@@ -13,7 +13,7 @@
"""Packet trace library."""
-from resources.libraries.python.VatExecutor import VatExecutor
+from resources.libraries.python.VatExecutor import VatExecutor, VatTerminal
from resources.libraries.python.topology import NodeType
@@ -21,16 +21,21 @@ class Trace(object):
"""This class provides methods to manipulate the VPP packet trace."""
@staticmethod
- def show_packet_trace_on_all_duts(nodes):
+ def show_packet_trace_on_all_duts(nodes, maximum=None):
"""Show VPP packet trace.
:param nodes: Nodes from which the packet trace will be displayed.
+ :param maximum: Maximum number of packet traces to be displayed.
:type nodes: list
+ :type maximum: int
"""
+ maximum = "max {count}".format(count=maximum) if maximum is not None\
+ else ""
for node in nodes.values():
if node['type'] == NodeType.DUT:
- vat = VatExecutor()
- vat.execute_script("show_trace.vat", node, json_out=False)
+ with VatTerminal(node, json_param=False) as vat:
+ vat.vat_terminal_exec_cmd_from_template(
+ 'show_trace.vat', maximum=maximum)
@staticmethod
def clear_packet_trace_on_all_duts(nodes):