CSIT-219: Realocate resources for Honeycomb tests
[csit.git] / resources / test_data / honeycomb / sub_interfaces.py
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:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
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.
13
14 """Test variables for Honeycomb sub-interface test suite."""
15
16 # Sub-interface 1 and its settings:
17 sub_if_1_settings = {
18     "identifier": "1",
19     "vlan-type": "802dot1q",
20     "enabled": "false"
21 }
22
23 sub_if_1_tags = [
24     {
25         "index": "0",
26         "dot1q-tag": {
27             "tag-type": "dot1q-types:s-vlan",
28             "vlan-id": "100"
29         }
30     },
31     {
32         "index": "1",
33         "dot1q-tag": {
34             "tag-type": "dot1q-types:c-vlan",
35             "vlan-id": "any"
36         }
37     }
38 ]
39
40 sub_if_1_match = "vlan-tagged-exact-match"
41
42 # Expected operational data: sub-interface.
43 sub_if_1_oper = {
44     "identifier": 1,
45     "oper-status": "down",
46     "admin-status": "down",
47     "tags": {
48         "tag": [
49             {
50                 "index": 1,
51                 "dot1q-tag": {
52                     "tag-type": "dot1q-types:c-vlan",
53                     "vlan-id": "any"
54                 }
55             },
56             {
57                 "index": 0,
58                 "dot1q-tag": {
59                     "tag-type": "dot1q-types:s-vlan",
60                     "vlan-id": "100"
61                 }
62             }
63         ]
64     },
65     "match": {
66         "vlan-tagged": {
67             "match-exact-tags": False
68         }
69     }
70 }
71
72 # Bridge domain name.
73 bd_name = 'test-sub-bd'
74
75 # Bridge domain settings used while creating a test bridge domain.
76 bd_settings = {
77     'flood': True,
78     'forward': True,
79     'learn': True,
80     'unknown-unicast-flood': True,
81     'arp-termination': True
82 }
83
84 # Bridge domain configuration used while adding the sub-interface to the bridge
85 # domain.
86 sub_bd_settings = {
87     'bridge-domain': bd_name,
88     'split-horizon-group': 1,
89     'bridged-virtual-interface': False
90 }
91
92 # Configuration data: Enable tag-rewrite push.
93 tag_rewrite_push = {
94     "vlan-type": "vpp-vlan:802dot1q",
95     "push-tags": [
96         {
97             "index": 0,
98             "dot1q-tag": {
99                 "tag-type": "dot1q-types:s-vlan",
100                 "vlan-id":123
101             }
102         },
103         {
104             "index": 1,
105             "dot1q-tag": {
106                 "tag-type": "dot1q-types:c-vlan",
107                 "vlan-id": 456
108             }
109         }
110     ]
111 }
112
113 # Expected operational data: tag-rewrite push.
114 tag_rewrite_push_oper = {
115     "vlan-type": "vpp-vlan:802dot1q",
116     "push-tags": [
117         {
118             "index": 1,
119             "dot1q-tag": {
120                 "tag-type": "dot1q-types:c-vlan",
121                 "vlan-id": 456
122             }
123         },
124         {
125             "index": 0,
126             "dot1q-tag": {
127                 "tag-type": "dot1q-types:s-vlan",
128                 "vlan-id": 123
129             }
130         }
131     ]
132 }
133
134 # Expected VAT data: tag-rewrite push.
135 tag_rewrite_push_VAT = {
136     'sub_default': 0,
137     'sub_dot1ad': 0,
138     'sub_exact_match': 0,
139     'sub_inner_vlan_id': 0,
140     'sub_inner_vlan_id_any': 1,
141     'sub_number_of_tags': 2,
142     'sub_outer_vlan_id': 100,
143     'sub_outer_vlan_id_any': 0,
144     'vtr_op': 2,
145     'vtr_push_dot1q': 1,
146     'vtr_tag1': 123,
147     'vtr_tag2': 456
148 }
149
150 # Configuration data: Enable tag-rewrite pop 1.
151 tag_rewrite_pop_1 = {
152     "pop-tags": "1"
153 }
154
155 # Expected operational data: tag-rewrite pop 1.
156 tag_rewrite_pop_1_oper = {
157     "vlan-type": "vpp-vlan:802dot1ad",
158     "pop-tags": 1
159 }
160
161 # Expected VAT data: tag-rewrite pop 1.
162 tag_rewrite_pop_1_VAT = {
163     'sub_default': 0,
164     'sub_dot1ad': 0,
165     'sub_exact_match': 0,
166     'sub_inner_vlan_id': 0,
167     'sub_inner_vlan_id_any': 1,
168     'sub_number_of_tags': 2,
169     'sub_outer_vlan_id': 100,
170     'sub_outer_vlan_id_any': 0,
171     'vtr_op': 3,
172     'vtr_push_dot1q': 0,
173     'vtr_tag1': 0,
174     'vtr_tag2': 0
175 }
176
177 # Configuration data: Enable tag-rewrite translate 1-2.
178 tag_rewrite_translate_1_2 = {
179     "vlan-type": "vpp-vlan:802dot1q",
180     "pop-tags": "1",
181     "push-tags": [
182         {
183             "index": 0,
184             "dot1q-tag": {
185                 "tag-type": "dot1q-types:s-vlan",
186                 "vlan-id": 111
187             }
188         },
189         {
190             "index": 1,
191             "dot1q-tag": {
192                 "tag-type": "dot1q-types:c-vlan",
193                 "vlan-id": 222
194             }
195         }
196     ]
197 }
198
199 # Expected operational data: tag-rewrite translate 1-2.
200 tag_rewrite_translate_1_2_oper = {
201     "vlan-type": "vpp-vlan:802dot1q",
202     "pop-tags": 1,
203     "push-tags": [
204         {
205             "index": 1,
206             "dot1q-tag": {
207                 "tag-type": "dot1q-types:c-vlan",
208                 "vlan-id": 222
209             }
210         },
211         {
212             "index": 0,
213             "dot1q-tag": {
214                 "tag-type": "dot1q-types:s-vlan",
215                 "vlan-id": 111
216             }
217         }
218     ]
219 }
220
221 # Expected VAT data: tag-rewrite translate 1-2.
222 tag_rewrite_translate_1_2_VAT = {
223     'sub_default': 0,
224     'sub_dot1ad': 0,
225     'sub_exact_match': 0,
226     'sub_inner_vlan_id': 0,
227     'sub_inner_vlan_id_any': 1,
228     'sub_number_of_tags': 2,
229     'sub_outer_vlan_id': 100,
230     'sub_outer_vlan_id_any': 0,
231     'vtr_op': 6,
232     'vtr_push_dot1q': 1,
233     'vtr_tag1': 111,
234     'vtr_tag2': 222
235 }
236
237 # Configuration data: Disable tag-rewrite.
238 tag_rewrite_disabled = {}
239
240 # Expected VAT data: Disable tag-rewrite.
241 tag_rewrite_disabled_VAT = {
242     'sub_default': 0,
243     'sub_dot1ad': 0,
244     'sub_exact_match': 0,
245     'sub_inner_vlan_id': 0,
246     'sub_inner_vlan_id_any': 1,
247     'sub_number_of_tags': 2,
248     'sub_outer_vlan_id': 100,
249     'sub_outer_vlan_id_any': 0,
250     'vtr_op': 0,
251     'vtr_push_dot1q': 0,
252     'vtr_tag1': 0,
253     'vtr_tag2': 0
254 }
255
256 # Configuration data:
257 # Wrong vlan-type for enable tag-rewrite translate 1-2.
258 tag_rewrite_translate_1_2_wrong = {
259     "vlan-type": "vpp-vlan:WRONG",
260     "pop-tags": "1",
261     "push-tags": [
262         {
263             "index": 0,
264             "dot1q-tag": {
265                 "tag-type": "dot1q-types:s-vlan",
266                 "vlan-id": 111
267             }
268         },
269         {
270             "index": 1,
271             "dot1q-tag": {
272                 "tag-type": "dot1q-types:c-vlan",
273                 "vlan-id": 222
274             }
275         }
276     ]
277 }
278
279 # IP addresses configured on sub-interface during tests
280 ipv4 = {
281     "address": "192.168.0.4",
282     "netmask": "255.255.255.0",
283     "prefix-length": 24}
284 ipv4_2 = {
285     "address": "192.168.0.5",
286     "netmask": "255.255.0.0",
287     "prefix-length": 16}