aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/InterfaceUtil.py
diff options
context:
space:
mode:
authorPatrik Hrnciar <phrnciar@cisco.com>2016-05-03 14:40:52 +0200
committerMatej Klotton <mklotton@cisco.com>2016-05-11 08:16:52 +0000
commit452fabf532691f88b36b79bf2469afde18183de2 (patch)
tree73c63417ee512ff73050559fae1ee93e99b4ad11 /resources/libraries/python/InterfaceUtil.py
parent807afe3f73ef9f6170e72f922338d0a726028ec6 (diff)
Add iACL IPv4/IPv6 tests.
- IPv4: CSIT-15 - IPv6: CSIT-16 Change-Id: I6e66aa853dfaebf1388f1191dbb63f5216820325 Signed-off-by: Patrik Hrnciar <phrnciar@cisco.com>
Diffstat (limited to 'resources/libraries/python/InterfaceUtil.py')
-rw-r--r--resources/libraries/python/InterfaceUtil.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py
index 35194f2487..3da0e1a204 100644
--- a/resources/libraries/python/InterfaceUtil.py
+++ b/resources/libraries/python/InterfaceUtil.py
@@ -580,3 +580,28 @@ class InterfaceUtil(object):
else:
raise RuntimeError('Create loopback failed on node "{}"'
.format(node['host']))
+
+ @staticmethod
+ def vpp_enable_input_acl_interface(node, interface, ip_version,
+ table_index):
+ """Enable input acl on interface.
+
+ :param node: VPP node to setup interface for input acl.
+ :param interface: Interface to setup input acl.
+ :param ip_version: Version of IP protocol.
+ :param table_index: Classify table index.
+ :type node: dict
+ :type interface: str or int
+ :type ip_version: str
+ :type table_index: 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("input_acl_int.vat",
+ sw_if_index=sw_if_index,
+ ip_version=ip_version,
+ table_index=table_index)