aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/honeycomb/HcAPIKwInterfaces.py
diff options
context:
space:
mode:
authorselias <samelias@cisco.com>2016-05-25 17:16:11 +0200
committerJan Gelety <jgelety@cisco.com>2016-06-07 20:19:50 +0000
commitce469c1a7d56c2be639e5cecde961c4ef6354fb5 (patch)
tree617a03045adb8426c59ac2758d5075fb3096d054 /resources/libraries/python/honeycomb/HcAPIKwInterfaces.py
parent6000b2abc3d6b8bb8ff2941aacf005a04a33be60 (diff)
Add Honeycomb persistence tests
JIRA: CSIT-121 - add honeycomb persistence test suite - add keywords used by persistence tests - add methods for working with Honeycomb persistence files - make suite setup clear persisted data before Honeycomb startup Change-Id: Ief61c12b730d58a456566c4683c0091e08a09b56 Signed-off-by: selias <samelias@cisco.com>
Diffstat (limited to 'resources/libraries/python/honeycomb/HcAPIKwInterfaces.py')
-rw-r--r--resources/libraries/python/honeycomb/HcAPIKwInterfaces.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/resources/libraries/python/honeycomb/HcAPIKwInterfaces.py b/resources/libraries/python/honeycomb/HcAPIKwInterfaces.py
index c143b069db..e8cbc78bea 100644
--- a/resources/libraries/python/honeycomb/HcAPIKwInterfaces.py
+++ b/resources/libraries/python/honeycomb/HcAPIKwInterfaces.py
@@ -1047,3 +1047,29 @@ class InterfaceKeywords(object):
"vlan-tag-rewrite")
return InterfaceKeywords._set_interface_properties(
node, sub_interface, path, None)
+
+ @staticmethod
+ def compare_interface_lists(list1, list2):
+ """Compare provided lists of interfaces by name.
+
+ :param list1: List of interfaces.
+ :param list2: List of interfaces.
+ :type list1: list
+ :type list2: list
+ :raises HoneycombError: If an interface exists in only one of the lists.
+ """
+
+ ignore = ["vx_tunnel0", "vxlan_gpe_tunnel0"]
+ # these have no equivalent in config data and no effect on VPP
+
+ names1 = [x['name'] for x in list1]
+ names2 = [x['name'] for x in list2]
+
+ for name in names1:
+ if name not in names2 and name not in ignore:
+ raise HoneycombError("Interface {0} not present in list {1}"
+ .format(name, list2))
+ for name in names2:
+ if name not in names1 and name not in ignore:
+ raise HoneycombError("Interface {0} not present in list {1}"
+ .format(name, list1))