aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/InterfaceUtil.py
diff options
context:
space:
mode:
authorZdeno Olsovsky <zolsovsk@cisco.com>2016-06-28 09:22:29 +0200
committerMatej Klotton <mklotton@cisco.com>2016-07-21 10:36:13 +0200
commit80532e03b9d223407c4b9d2245449dbdc4c03c1b (patch)
tree54e539a5a8ebe127cc9f69ab31014fab86625154 /resources/libraries/python/InterfaceUtil.py
parent2e46c135ffe5e6a3acc1c48b7d32ac18b4665390 (diff)
CSIT-183: Vpn baseline routed forwarding (VRF)
- Setup 2 VRF tables on each DUT - Test traffic - each port accessible within one vrf - Test traffic - ports inaccessible to different vrf Change-Id: I34256a683039734608509a38857dbdcbdd15bcf9 Signed-off-by: Zdeno Olsovsky <zolsovsk@cisco.com> Signed-off-by: Matej Klotton <mklotton@cisco.com>
Diffstat (limited to 'resources/libraries/python/InterfaceUtil.py')
-rw-r--r--resources/libraries/python/InterfaceUtil.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py
index 008d42435c..a16a02fbe8 100644
--- a/resources/libraries/python/InterfaceUtil.py
+++ b/resources/libraries/python/InterfaceUtil.py
@@ -793,3 +793,24 @@ class InterfaceUtil(object):
with VatTerminal(node) as vat:
vat.vat_terminal_exec_cmd_from_template("ip_source_check.vat",
interface_name=interface)
+
+ @staticmethod
+ def assign_interface_to_fib_table(node, interface, table_id):
+ """Assign VPP interface to specific VRF/FIB table.
+
+ :param node: VPP node where the FIB and interface are located.
+ :param interface: Interface to be assigned to FIB.
+ :param table_id: VRF table ID.
+ :type node: dict
+ :type interface: str or int
+ :type table_id: int
+ """
+ if isinstance(interface, basestring):
+ sw_if_index = Topology.get_interface_sw_index(node, interface)
+ else:
+ sw_if_index = interface
+
+ with VatTerminal(node) as vat:
+ vat.vat_terminal_exec_cmd_from_template("set_fib_to_interface.vat",
+ sw_index=sw_if_index,
+ vrf=table_id)