93ef2e28cfeaf73fc94ea8557a64e3ca43a7a690
[csit.git] / resources / test_data / honeycomb / pbb / pbb.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 provider backbone bridge test suite."""
15
16 # pylint: disable=invalid-name
17
18 # Add pbb sub interface
19 # Configuration data
20 cfg_pbb_sub_if_1_ID = '1'
21 cfg_pbb_sub_if_1 = {
22     "sub-interface": [
23         {
24             "identifier": cfg_pbb_sub_if_1_ID,
25             "vlan-type": "dot1ah-types:802dot1ah",
26             "enabled": "true",
27             "admin-status": "up",
28             "oper-status": "up",
29             "pbb": {
30                 "source-address": "aa:aa:aa:aa:aa:ab",
31                 "destination-address": "bb:bb:bb:bb:bb:bc",
32                 "b-vlan-tag-vlan-id": "2223",
33                 "i-tag-isid": "12"
34             },
35         }
36     ]
37 }
38
39 # Expected operational data:
40 oper_pbb_sub_if_1 = {
41     'admin-status': 'up',
42     'ietf-ip:ipv4': {},
43     'oper-status': 'up',
44     'sub-interfaces:sub-interfaces': {},
45     'type': 'iana-if-type:ethernetCsmacd',
46     'v3po:ethernet': {
47         'duplex': 'full',
48         'mtu': 9216
49     }
50 }
51
52 # Modify pbb sub interface
53 # Configuration data
54 cfg_pbb_sub_if_1_ID = '2'
55 cfg_pbb_sub_if_1_mod = {
56     "sub-interface": [
57         {
58             "identifier": cfg_pbb_sub_if_1_ID,
59             "vlan-type": "dot1ah-types:802dot1ah",
60             "enabled": "true",
61             "admin-status": "up",
62             "oper-status": "up",
63             "pbb": {
64                 "source-address": "aa:aa:aa:aa:aa:de",
65                 "destination-address": "bb:bb:bb:bb:bb:ed",
66                 "b-vlan-tag-vlan-id": "2223",
67                 "i-tag-isid": "12"
68             },
69         }
70     ]
71 }
72
73 # Expected operational data:
74 oper_pbb_sub_if_1_mod = {
75     'admin-status': 'up',
76     'ietf-ip:ipv4': {},
77     'oper-status': 'up',
78     'sub-interfaces:sub-interfaces': {},
79     'type': 'iana-if-type:ethernetCsmacd',
80     'v3po:ethernet': {
81         'duplex': 'full',
82         'mtu': 9216
83     }
84 }
85
86 # Configuration data
87 cfg_pbb_sub_if_2_ID = '3'
88 cfg_pbb_sub_if_2 = {
89     "sub-interface": [
90         {
91             "identifier": cfg_pbb_sub_if_2_ID,
92             "vlan-type": "dot1ah-types:802dot1ah",
93             "enabled": "true",
94             "admin-status": "up",
95             "oper-status": "up",
96             "pbb": {
97                 "source-address": "aa:aa:aa:aa:aa:cc",
98                 "destination-address": "bb:bb:bb:bb:bb:dd",
99                 "b-vlan-tag-vlan-id": "10",
100                 "i-tag-isid": "20"
101             },
102         }
103     ]
104 }
105
106 # Expected operational data:
107 oper_pbb_sub_if_2 = {
108     'admin-status': 'up',
109     'ietf-ip:ipv4': {},
110     'oper-status': 'up',
111     'sub-interfaces:sub-interfaces': {},
112     'type': 'iana-if-type:ethernetCsmacd',
113     'v3po:ethernet': {
114         'duplex': 'full',
115         'mtu': 9216
116     }
117 }
118
119 # Configuration data
120 cfg_pbb_sub_if_3_ID = '4'
121 cfg_pbb_sub_if_3 = {
122     "sub-interface": [
123         {
124             "identifier": cfg_pbb_sub_if_3_ID,
125             "vlan-type": "dot1ah-types:802dot1ah",
126             "enabled": "true",
127             "admin-status": "up",
128             "oper-status": "up",
129             "pbb": {
130                 "source-address": "aa:aa:aa:aa:cc:aa",
131                 "destination-address": "bb:bb:bb:bb:dd:bb",
132                 "b-vlan-tag-vlan-id": "30",
133                 "i-tag-isid": "40"
134             },
135         }
136     ]
137 }
138
139 # Expected operational data:
140 oper_pbb_sub_if_3 = {
141     'admin-status': 'up',
142     'ietf-ip:ipv4': {},
143     'oper-status': 'up',
144     'sub-interfaces:sub-interfaces': {},
145     'type': 'iana-if-type:ethernetCsmacd',
146     'v3po:ethernet': {
147         'duplex': 'full',
148         'mtu': 9216
149     }
150 }
151
152 # Wrong configuration data
153 # Wrong source-address
154 cfg_pbb_sub_if_ID = '5'
155 cfg_pbb_sub_if_wrong_src_addr = {
156     "sub-interface": [
157         {
158             "identifier": cfg_pbb_sub_if_ID,
159             "vlan-type": "dot1ah-types:802dot1ah",
160             "enabled": "true",
161             "admin-status": "up",
162             "oper-status": "up",
163             "pbb": {
164                 "source-address": "ab:cd:ef:gh:ij",
165                 "destination-address": "bb:bb:bb:bb:bb:bc",
166                 "b-vlan-tag-vlan-id": "2223",
167                 "i-tag-isid": "12"
168             },
169         }
170     ]
171 }
172
173 # Wrong destination-address
174 cfg_pbb_sub_if_wrong_dst_addr = {
175     "sub-interface": [
176         {
177             "identifier": cfg_pbb_sub_if_ID,
178             "vlan-type": "dot1ah-types:802dot1ah",
179             "enabled": "true",
180             "admin-status": "up",
181             "oper-status": "up",
182             "pbb": {
183                 "source-address": "aa:aa:aa:aa:aa:ab",
184                 "destination-address": "ab:cd:ef:gh:ij",
185                 "b-vlan-tag-vlan-id": "2223",
186                 "i-tag-isid": "12"
187             },
188         }
189     ]
190 }
191
192 # Wrong b-vlan-tag-vlan-id
193 cfg_pbb_sub_if_wrong_vlan_tag = {
194     "sub-interface": [
195         {
196             "identifier": cfg_pbb_sub_if_ID,
197             "vlan-type": "dot1ah-types:802dot1ah",
198             "enabled": "true",
199             "admin-status": "up",
200             "oper-status": "up",
201             "pbb": {
202                 "source-address": "aa:aa:aa:aa:aa:ab",
203                 "destination-address": "bb:bb:bb:bb:bb:bc",
204                 "b-vlan-tag-vlan-id": "123456789",
205                 "i-tag-isid": "12"
206             },
207         }
208     ]
209 }
210
211 # Wrong i-tag-isid
212 cfg_pbb_sub_if_wrong_i_tag = {
213     "sub-interface": [
214         {
215             "identifier": cfg_pbb_sub_if_ID,
216             "vlan-type": "dot1ah-types:802dot1ah",
217             "enabled": "true",
218             "admin-status": "up",
219             "oper-status": "up",
220             "pbb": {
221                 "source-address": "aa:aa:aa:aa:aa:ab",
222                 "destination-address": "bb:bb:bb:bb:bb:bc",
223                 "b-vlan-tag-vlan-id": "2223",
224                 "i-tag-isid": "167772152345"
225             },
226         }
227     ]
228 }
229
230 # b-vlan-tag-vlan-id is missing
231 cfg_pbb_sub_if_no_vlan_tag = {
232     "sub-interface": [
233         {
234             "identifier": cfg_pbb_sub_if_ID,
235             "vlan-type": "dot1ah-types:802dot1ah",
236             "enabled": "true",
237             "admin-status": "up",
238             "oper-status": "up",
239             "pbb": {
240                 "source-address": "aa:aa:aa:aa:aa:ab",
241                 "destination-address": "bb:bb:bb:bb:bb:bc",
242                 "i-tag-isid": "12"
243             },
244         }
245     ]
246 }