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 remote_vrf_adjacency = {
115 "virtual-network-id": 4,
116 "address-type": "ietf-lisp-address-types:ipv4-afi",
117 "ipv4": "192.168.1.1"
120 "virtual-network-id": 4,
121 "address-type": "ietf-lisp-address-types:ipv4-afi",
122 "ipv4": "192.168.0.2"
127 remote_adj_subtable = deepcopy(remote_vrf_subtable)
128 remote_adj_subtable["vrf-subtable"]["remote-mappings"]\
129 ["remote-mapping"][0]["adjacencies"] = {}.update(remote_vrf_adjacency)
132 def create_settings_dict(subtable):
135 "vni-table": [subtable]
141 lisp_settings_remote_bd = create_settings_dict(remote_bd_subtable)
142 lisp_settings_remote_vrf = create_settings_dict(remote_vrf_subtable)
143 lisp_settings_local_bd = create_settings_dict(local_bd_subtable)
144 lisp_settings_local_vrf = create_settings_dict(local_vrf_subtable)
148 "vni": remote_bd_subtable["virtual-network-identifier"],
149 "eid": remote_bd_subtable["bridge-domain-subtable"]["remote-mappings"][
150 "remote-mapping"][0]["eid"]["mac"],
155 "vni": remote_vrf_subtable["virtual-network-identifier"],
156 "eid": remote_vrf_subtable["vrf-subtable"]["remote-mappings"][
157 "remote-mapping"][0]["eid"]["ipv4"]+"/32",
162 "vni": local_bd_subtable["virtual-network-identifier"],
163 "eid": local_bd_subtable["bridge-domain-subtable"]["local-mappings"][
164 "local-mapping"][0]["eid"]["mac"]
169 "vni": local_vrf_subtable["virtual-network-identifier"],
170 "eid": local_vrf_subtable["vrf-subtable"]["local-mappings"][
171 "local-mapping"][0]["eid"]["ipv4"]+"/32"