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