CSIT-484: HC Test: Lisp
[csit.git] / resources / test_data / honeycomb / lisp.py
diff --git a/resources/test_data/honeycomb/lisp.py b/resources/test_data/honeycomb/lisp.py
new file mode 100644 (file)
index 0000000..049d222
--- /dev/null
@@ -0,0 +1,172 @@
+# Copyright (c) 2016 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Test variables for LISP test suite."""
+
+from copy import deepcopy
+
+locator_set = "loc01"
+
+remote_bd_subtable = {
+    "virtual-network-identifier": 3,
+    "bridge-domain-subtable": {
+        "bridge-domain-ref": "bd_lisp",
+        "remote-mappings": {
+            "remote-mapping": [{
+                "id": "remote_map_l2",
+                "eid": {
+                    "virtual-network-id": 3,
+                    "address-type": "ietf-lisp-address-types:mac-afi",
+                    "mac": "aa:aa:aa:aa:aa:ab",
+                },
+                "rlocs": {
+                    "locator": [{
+                        "address": "192.168.0.3",
+                        "priority": 1,
+                        "weight": 1
+                    }]
+                },
+            }]
+        },
+    }
+}
+
+remote_vrf_subtable = {
+    "virtual-network-identifier": 4,
+    "vrf-subtable": {
+        "table-id": 1,
+        "remote-mappings": {
+            "remote-mapping": [{
+                "id": "remote_map_vrf",
+                "eid": {
+                    "virtual-network-id": 4,
+                    "address-type": "ietf-lisp-address-types:ipv4-afi",
+                    "ipv4": "192.168.0.2"
+                },
+                "rlocs": {
+                    "locator": [{
+                        "address": "192.168.0.3",
+                        "priority": 1,
+                        "weight": 1
+                    }]
+                },
+
+            }]
+        },
+    }
+}
+
+local_bd_subtable = {
+    "virtual-network-identifier": 5,
+    "bridge-domain-subtable": {
+        "bridge-domain-ref": "bd2_lisp",
+        "local-mappings": {
+            "local-mapping": [{
+                "id": "local_map_l2",
+                "eid": {
+                    "address-type": "ietf-lisp-address-types:mac-afi",
+                    "virtual-network-id": 5,
+                    "mac": "ba:aa:aa:aa:aa:aa"
+                },
+                "locator-set": locator_set
+            }]
+        },
+    }
+}
+
+local_vrf_subtable = {
+    "virtual-network-identifier": 6,
+    "vrf-subtable": {
+        "table-id": 2,
+        "local-mappings": {
+            "local-mapping": [{
+                "id": "local_map_vrf",
+                "eid": {
+                    "virtual-network-id": 6,
+                    "address-type": "ietf-lisp-address-types:ipv4-afi",
+                    "ipv4": "192.168.1.1"
+                },
+                "locator-set": locator_set
+            }]
+        },
+    }
+}
+
+lisp_settings_enable = {
+    "lisp": {
+        "enable": True
+    }
+}
+
+remote_vrf_adjacency = {
+                    "adjacency": {
+                        "id": "adj01",
+                        "local-eid": {
+                            "virtual-network-id": 4,
+                            "address-type": "ietf-lisp-address-types:ipv4-afi",
+                            "ipv4": "192.168.1.1"
+                        },
+                        "remote-eid": {
+                            "virtual-network-id": 4,
+                            "address-type": "ietf-lisp-address-types:ipv4-afi",
+                            "ipv4": "192.168.0.2"
+                        },
+                    }
+                }
+
+remote_adj_subtable = deepcopy(remote_vrf_subtable)
+remote_adj_subtable["vrf-subtable"]["remote-mappings"]\
+    ["remote-mapping"][0]["adjacencies"] = {}.update(remote_vrf_adjacency)
+
+
+def create_settings_dict(subtable):
+    settings = {
+        "eid-table": {
+            "vni-table": [subtable]
+        }
+    }
+
+    return settings
+
+lisp_settings_remote_bd = create_settings_dict(remote_bd_subtable)
+lisp_settings_remote_vrf = create_settings_dict(remote_vrf_subtable)
+lisp_settings_local_bd = create_settings_dict(local_bd_subtable)
+lisp_settings_local_vrf = create_settings_dict(local_vrf_subtable)
+
+vat_remote_bd = {
+    "is_local": 0,
+    "vni": remote_bd_subtable["virtual-network-identifier"],
+    "eid": remote_bd_subtable["bridge-domain-subtable"]["remote-mappings"][
+        "remote-mapping"][0]["eid"]["mac"],
+}
+
+vat_remote_vrf = {
+    "is_local": 0,
+    "vni": remote_vrf_subtable["virtual-network-identifier"],
+    "eid": remote_vrf_subtable["vrf-subtable"]["remote-mappings"][
+        "remote-mapping"][0]["eid"]["ipv4"]+"/32",
+}
+
+vat_local_bd = {
+    "is_local": 1,
+    "vni": local_bd_subtable["virtual-network-identifier"],
+    "eid": local_bd_subtable["bridge-domain-subtable"]["local-mappings"][
+        "local-mapping"][0]["eid"]["mac"]
+}
+
+vat_local_vrf = {
+    "is_local": 1,
+    "vni": local_vrf_subtable["virtual-network-identifier"],
+    "eid": local_vrf_subtable["vrf-subtable"]["local-mappings"][
+        "local-mapping"][0]["eid"]["ipv4"]+"/32"
+}