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 Honeycomb sub-interface test suite."""
16 from copy import deepcopy
18 # Sub-interface 1 and its settings:
21 "vlan-type": "_802dot1q",
29 "tag-type": "dot1q-types:s-vlan",
36 "tag-type": "dot1q-types:c-vlan",
42 sub_if_1_match = "vlan-tagged"
44 # Expected operational data: sub-interface.
47 "oper-status": "down",
48 "admin-status": "down",
54 "tag-type": "dot1q-types:s-vlan",
61 "tag-type": "dot1q-types:c-vlan",
69 "match-exact-tags": False
75 bd_name = 'test-sub-bd'
77 # Bridge domain settings used while creating a test bridge domain.
82 'unknown-unicast-flood': True,
83 'arp-termination': True
86 # Bridge domain configuration used while adding the sub-interface to the bridge
89 'bridge-domain': bd_name,
90 'split-horizon-group': 1,
91 'bridged-virtual-interface': False
94 # Configuration data: Enable tag-rewrite push.
96 "vlan-type": "vpp-vlan:_802dot1q",
101 "tag-type": "dot1q-types:s-vlan",
108 "tag-type": "dot1q-types:c-vlan",
115 # Expected operational data: tag-rewrite push.
116 tag_rewrite_push_oper = {
117 "vlan-type": "vpp-vlan:_802dot1q",
122 "tag-type": "dot1q-types:s-vlan",
129 "tag-type": "dot1q-types:c-vlan",
136 # Expected VAT data: tag-rewrite push.
137 tag_rewrite_push_VAT = {
140 'sub_exact_match': 0,
141 'sub_inner_vlan_id': 0,
142 'sub_inner_vlan_id_any': 1,
143 'sub_number_of_tags': 2,
144 'sub_outer_vlan_id': 100,
145 'sub_outer_vlan_id_any': 0,
152 # Configuration data: Enable tag-rewrite pop 1.
153 tag_rewrite_pop_1 = {
157 # Expected operational data: tag-rewrite pop 1.
158 tag_rewrite_pop_1_oper = {
159 "vlan-type": "vpp-vlan:_802dot1ad",
163 # Expected VAT data: tag-rewrite pop 1.
164 tag_rewrite_pop_1_VAT = {
167 'sub_exact_match': 0,
168 'sub_inner_vlan_id': 0,
169 'sub_inner_vlan_id_any': 1,
170 'sub_number_of_tags': 2,
171 'sub_outer_vlan_id': 100,
172 'sub_outer_vlan_id_any': 0,
179 # Configuration data: Enable tag-rewrite translate 1-2.
180 tag_rewrite_translate_1_2 = {
181 "vlan-type": "vpp-vlan:_802dot1q",
187 "tag-type": "dot1q-types:s-vlan",
194 "tag-type": "dot1q-types:c-vlan",
201 # Expected operational data: tag-rewrite translate 1-2.
202 tag_rewrite_translate_1_2_oper = {
203 "vlan-type": "vpp-vlan:_802dot1q",
209 "tag-type": "dot1q-types:s-vlan",
216 "tag-type": "dot1q-types:c-vlan",
223 # Expected VAT data: tag-rewrite translate 1-2.
224 tag_rewrite_translate_1_2_VAT = {
227 'sub_exact_match': 0,
228 'sub_inner_vlan_id': 0,
229 'sub_inner_vlan_id_any': 1,
230 'sub_number_of_tags': 2,
231 'sub_outer_vlan_id': 100,
232 'sub_outer_vlan_id_any': 0,
239 # Configuration data: Disable tag-rewrite.
240 tag_rewrite_disabled = {}
242 # Expected VAT data: Disable tag-rewrite.
243 tag_rewrite_disabled_VAT = {
246 'sub_exact_match': 0,
247 'sub_inner_vlan_id': 0,
248 'sub_inner_vlan_id_any': 1,
249 'sub_number_of_tags': 2,
250 'sub_outer_vlan_id': 100,
251 'sub_outer_vlan_id_any': 0,
258 # Configuration data:
259 # Wrong vlan-type for enable tag-rewrite translate 1-2.
260 tag_rewrite_translate_1_2_wrong = {
261 "vlan-type": "vpp-vlan:WRONG",
267 "tag-type": "dot1q-types:s-vlan",
274 "tag-type": "dot1q-types:c-vlan",
281 # IP addresses configured on sub-interface during tests
283 "address": "192.168.0.4",
284 "netmask": "255.255.255.0",
287 "address": "192.168.0.5",
288 "netmask": "255.255.0.0",
291 sub_if_2_settings = sub_if_1_settings
292 sub_if_2_tags = sub_if_1_tags
293 sub_if_2_match = "vlan-tagged-exact-match"
294 sub_if_2_oper = deepcopy(sub_if_1_oper)
295 sub_if_2_oper["match"]["vlan-tagged"]["match-exact-tags"] = True