1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
14 """Test variables for LISP test suite."""
16 from copy import deepcopy
20 remote_bd_subtable = {
21 "virtual-network-identifier": 3,
22 "bridge-domain-subtable": {
23 "bridge-domain-ref": "bd_lisp",
26 "id": "remote_map_l2",
28 "virtual-network-id": 3,
29 "address-type": "ietf-lisp-address-types:mac-afi",
30 "mac": "aa:aa:aa:aa:aa:ab",
34 "address": "192.168.0.3",
44 remote_vrf_subtable = {
45 "virtual-network-identifier": 4,
50 "id": "remote_map_vrf",
52 "virtual-network-id": 4,
53 "address-type": "ietf-lisp-address-types:ipv4-afi",
58 "address": "192.168.0.3",
70 "virtual-network-identifier": 5,
71 "bridge-domain-subtable": {
72 "bridge-domain-ref": "bd2_lisp",
77 "address-type": "ietf-lisp-address-types:mac-afi",
78 "virtual-network-id": 5,
79 "mac": "ba:aa:aa:aa:aa:aa"
81 "locator-set": locator_set
87 local_vrf_subtable = {
88 "virtual-network-identifier": 6,
93 "id": "local_map_vrf",
95 "virtual-network-id": 6,
96 "address-type": "ietf-lisp-address-types:ipv4-afi",
99 "locator-set": locator_set
105 lisp_settings_enable = {
111 prepare_vrf_adjacency = {
112 "virtual-network-identifier": 7,
117 "id": "local_map_vrf",
119 "virtual-network-id": 7,
120 "address-type": "ietf-lisp-address-types:ipv4-afi",
121 "ipv4": "192.168.1.1"
123 "locator-set": locator_set
128 "id": "remote_map_vrf",
130 "virtual-network-id": 7,
131 "address-type": "ietf-lisp-address-types:ipv4-afi",
132 "ipv4": "192.168.0.2"
136 "address": "192.168.0.3",
151 "virtual-network-id": 7,
152 "address-type": "ietf-lisp-address-types:ipv4-afi",
153 "ipv4": "192.168.1.1"
156 "virtual-network-id": 7,
157 "address-type": "ietf-lisp-address-types:ipv4-afi",
158 "ipv4": "192.168.0.2"
163 adj_subtable = deepcopy(prepare_vrf_adjacency)
164 adj_subtable["vrf-subtable"]["remote-mappings"]\
165 ["remote-mapping"][0]["adjacencies"] = deepcopy(vrf_adjacency)
168 def create_settings_dict(subtable):
171 "vni-table": [subtable]
177 lisp_settings_remote_bd = create_settings_dict(remote_bd_subtable)
178 lisp_settings_remote_vrf = create_settings_dict(remote_vrf_subtable)
179 lisp_settings_local_bd = create_settings_dict(local_bd_subtable)
180 lisp_settings_local_vrf = create_settings_dict(local_vrf_subtable)
181 lisp_settings_both_vrf = create_settings_dict(prepare_vrf_adjacency)
185 "vni": remote_bd_subtable["virtual-network-identifier"],
186 "eid": remote_bd_subtable["bridge-domain-subtable"]["remote-mappings"][
187 "remote-mapping"][0]["eid"]["mac"],
192 "vni": remote_vrf_subtable["virtual-network-identifier"],
193 "eid": remote_vrf_subtable["vrf-subtable"]["remote-mappings"][
194 "remote-mapping"][0]["eid"]["ipv4"]+"/32",
199 "vni": local_bd_subtable["virtual-network-identifier"],
200 "eid": local_bd_subtable["bridge-domain-subtable"]["local-mappings"][
201 "local-mapping"][0]["eid"]["mac"]
206 "vni": local_vrf_subtable["virtual-network-identifier"],
207 "eid": local_vrf_subtable["vrf-subtable"]["local-mappings"][
208 "local-mapping"][0]["eid"]["ipv4"]+"/32"