From be157c8643a2c095d169e3ea78e8db60000189eb Mon Sep 17 00:00:00 2001 From: Patrik Hrnciar Date: Tue, 8 Mar 2016 17:34:18 +0100 Subject: Add vxlan tests using xconnect Change-Id: I190689d5a624f1c876df90ce29b05a2b0b8a2df4 Signed-off-by: Patrik Hrnciar --- resources/libraries/python/L2Util.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'resources/libraries/python/L2Util.py') diff --git a/resources/libraries/python/L2Util.py b/resources/libraries/python/L2Util.py index c0a764fa2d..4dc230cf16 100644 --- a/resources/libraries/python/L2Util.py +++ b/resources/libraries/python/L2Util.py @@ -159,14 +159,23 @@ class L2Util(object): """Create bidirectional cross-connect between 2 interfaces on vpp node. :param node: Node to add bidirectional cross-connect - :param interface1: first interface - :param interface2: second interface + :param interface1: first interface name or sw_if_index + :param interface2: second interface name or sw_if_index :type node: dict - :type interface1: str - :type interface2: str + :type interface1: str or int + :type interface2: str or int """ - sw_iface1 = Topology().get_interface_sw_index(node, interface1) - sw_iface2 = Topology().get_interface_sw_index(node, interface2) + + 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_xconnect.vat', interface1=sw_iface1, -- cgit 1.2.3-korg