summaryrefslogtreecommitdiffstats
path: root/test/vpp_papi_provider.py
diff options
context:
space:
mode:
authorPavel Kotucek <pkotucek@cisco.com>2017-09-07 14:44:52 +0200
committerFlorin Coras <florin.coras@gmail.com>2017-09-08 05:51:24 +0000
commit932f74196d9571fd007cef32c234bd00ab75975e (patch)
treeedc55da6de1bc40a35d886b2c8844ae09d3212b0 /test/vpp_papi_provider.py
parenta546ef96a8170aeea70d771ee45662cadc628344 (diff)
ACL-plugin MACIP ACLs tests
Change-Id: Ie40c837358454cfe9475cb2c14fdf20b24fa6602 Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
Diffstat (limited to 'test/vpp_papi_provider.py')
-rw-r--r--test/vpp_papi_provider.py55
1 files changed, 55 insertions, 0 deletions
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py
index 03238b9db46..b70da026901 100644
--- a/test/vpp_papi_provider.py
+++ b/test/vpp_papi_provider.py
@@ -2243,3 +2243,58 @@ class VppPapiProvider(object):
'sw_if_index': sw_if_index,
'traffic_type': traffic_type
})
+
+ def macip_acl_add_replace(self, rules, acl_index=0xFFFFFFFF, tag=""):
+ """ Add MACIP acl
+
+ :param rules: list of rules for given acl
+ :param tag: acl tag
+ """
+
+ # return self.api(self.papi.macip_acl_add_replace,
+ # {'acl_index': acl_index,
+ # 'r': rules,
+ # 'count': len(rules),
+ # 'tag': tag})
+ return self.api(self.papi.macip_acl_add,
+ {'r': rules,
+ 'count': len(rules),
+ 'tag': tag})
+
+ def macip_acl_del(self, acl_index):
+ """
+
+ :param acl_index:
+ :return:
+ """
+ return self.api(self.papi.macip_acl_del,
+ {'acl_index': acl_index})
+
+ def macip_acl_interface_add_del(self,
+ sw_if_index,
+ acl_index,
+ is_add=1):
+ """ Add MACIP acl to interface
+
+ :param sw_if_index:
+ :param acl_index:
+ :param is_add: (Default value = 1)
+ """
+
+ return self.api(self.papi.macip_acl_interface_add_del,
+ {'is_add': is_add,
+ 'sw_if_index': sw_if_index,
+ 'acl_index': acl_index})
+
+ def macip_acl_interface_get(self):
+ """ Return interface acls dump
+ """
+ return self.api(
+ self.papi.macip_acl_interface_get, {})
+
+ def macip_acl_dump(self, acl_index=4294967295):
+ """ Return MACIP acl dump
+ """
+
+ return self.api(
+ self.papi.macip_acl_dump, {'acl_index': acl_index})