aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/L2Util.py
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2018-07-17 10:14:44 +0000
committerPeter Mikus <pmikus@cisco.com>2018-07-18 10:22:50 +0000
commitac6cc22910ea0d3bda42c227d799f2d4e89bc9d0 (patch)
tree691ebd2765b299d0232db982e0a73783714b0651 /resources/libraries/python/L2Util.py
parent1524a6e34d850528f990bb66ea243cc3f7d8c863 (diff)
CSIT-1201 Create L2patch perf tests
- XL710, XXV710, X710 - 2n, 3n - all pkt.size groups - ndrpdr, mrr Change-Id: Ibb36d734cd70a0a4d07e3d177fa2477bf9bfaacd Signed-off-by: Peter Mikus <pmikus@cisco.com>
Diffstat (limited to 'resources/libraries/python/L2Util.py')
-rw-r--r--resources/libraries/python/L2Util.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/resources/libraries/python/L2Util.py b/resources/libraries/python/L2Util.py
index 53c3b99c83..2acb6dba34 100644
--- a/resources/libraries/python/L2Util.py
+++ b/resources/libraries/python/L2Util.py
@@ -217,6 +217,36 @@ class L2Util(object):
interface2=sw_iface1)
@staticmethod
+ def vpp_setup_bidirectional_l2_patch(node, interface1, interface2):
+ """Create bidirectional l2 patch between 2 interfaces on vpp node.
+
+ :param node: Node to add bidirectional l2 patch.
+ :param interface1: First interface name or sw_if_index.
+ :param interface2: Second interface name or sw_if_index.
+ :type node: dict
+ :type interface1: str or int
+ :type interface2: str or int
+ """
+
+ if isinstance(interface1, basestring):
+ sw_iface1 = Topology().get_interface_sw_index(node, interface1)
+ else:
+ sw_iface1 = interface1
+
+ if isinstance(interface2, basestring):
+ sw_iface2 = Topology().get_interface_sw_index(node, interface2)
+ else:
+ sw_iface2 = interface2
+
+ with VatTerminal(node) as vat:
+ vat.vat_terminal_exec_cmd_from_template('l2_patch.vat',
+ interface1=sw_iface1,
+ interface2=sw_iface2)
+ vat.vat_terminal_exec_cmd_from_template('l2_patch.vat',
+ interface1=sw_iface2,
+ interface2=sw_iface1)
+
+ @staticmethod
def linux_add_bridge(node, br_name, if_1, if_2, set_up=True):
"""Bridge two interfaces on linux node.