Add Honeycomb sub-interface and VLAN tests
[csit.git] / tests / suites / honeycomb / 6 - sub_interface.robot
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 *** Settings ***
15 | Resource | resources/libraries/robot/default.robot
16 | Resource | resources/libraries/robot/honeycomb/sub_interface.robot
17 | Resource | resources/libraries/robot/honeycomb/bridge_domain.robot
18 | Resource | resources/libraries/robot/honeycomb/interfaces.robot
19 | Variables | tests/suites/honeycomb/resources/sub_interfaces.py
20 | Documentation | *Honeycomb sub-interface management test suite.*
21 | ...
22 | ...           | This test suite tests if it is posible to create, modify and\
23 | ...           | delete a sub-interface.
24
25 *** Variables ***
26 | ${node}= | ${nodes['DUT1']}
27
28 # Test interface 1 and its sub-interface parameters:
29 | ${interface}= | ${node['interfaces']['port1']['name']}
30 | ${sub_interface_id}= | 10
31 | ${sub_interface_name}= | ${interface}.${sub_interface_id}
32 | &{sub_interface_base_settings}=
33 | ... | name=${sub_interface_name}
34 | ... | type=v3po:sub-interface
35 | &{sub_interface_settings}=
36 | ... | super-interface=${interface}
37 | ... | identifier=${sub_interface_id}
38 | ... | vlan-type=802dot1ad
39 | ... | number-of-tags=2
40 | ... | outer-id=22
41 | ... | inner-id=33
42 | ... | match-any-outer-id=${FALSE}
43 | ... | match-any-inner-id=${FALSE}
44 | ... | exact-match=${TRUE}
45 | ... | default-subif=${TRUE}
46 | &{sub_interface_settings_wrong}=
47 | ... | super-interface=${interface}
48 | ... | identifier=${sub_interface_id}
49 | ... | vlan-type=WRONG_TYPE
50 | ... | number-of-tags=2
51 | ... | outer-id=22
52 | ... | inner-id=33
53 | ... | match-any-outer-id=${TRUE}
54 | ... | match-any-inner-id=${TRUE}
55 | ... | exact-match=${TRUE}
56 | ... | default-subif=${TRUE}
57
58 # Test interface 2 and its sub-interface parameters:
59 | ${interface2}= | ${node['interfaces']['port3']['name']}
60 | ${sub_interface2_name}= | ${interface2}.${sub_interface_id}
61 | &{sub_interface2_base_settings}=
62 | ... | name=${sub_interface2_name}
63 | ... | type=v3po:sub-interface
64 | ... | v3po:l2=&{bd_rw_settings}
65 | &{sub_interface2_settings}=
66 | ... | super-interface=${interface2}
67 | ... | identifier=${sub_interface_id}
68 | ... | vlan-type=802dot1ad
69 | ... | number-of-tags=2
70 | ... | outer-id=44
71 | ... | inner-id=55
72 | ... | match-any-outer-id=${FALSE}
73 | ... | match-any-inner-id=${FALSE}
74 | ... | exact-match=${TRUE}
75 | ... | default-subif=${FALSE}
76
77 *** Test Cases ***
78 | Honycomb creates sub-interface
79 | | [Documentation] | Check if Honeycomb creates a sub-interface.
80 | | ...
81 | | [Tags] | honeycomb_sanity
82 | | ...
83 | | Given sub-interface configuration from Honeycomb should be empty
84 | | ... | ${node} | ${sub_interface_name}
85 | | And sub-interface configuration from VAT should be empty
86 | | ... | ${node} | ${sub_interface_name}
87 | | When Honeycomb creates sub-interface
88 | | ... | ${node} | ${interface} | ${sub_interface_id}
89 | | ... | ${sub_interface_base_settings} | ${sub_interface_settings}
90 | | Then sub-interface configuration from Honeycomb should be
91 | | ... | ${node} | ${sub_interface_name} | ${sub_interface_base_settings}
92 | | ... | ${sub_interface_settings}
93 | | And sub-interface configuration from VAT should be
94 | | ... | ${node} | ${sub_interface_name} | ${sub_interface_settings}
95
96 | Honeycomb adds sub-interface to bridge domain
97 | | [Documentation] | Check if Honeycomb adds a sub-interface to bridge domain.
98 | | ...
99 | | [Tags] | honeycomb_sanity
100 | | ...
101 | | Given sub-interface configuration from Honeycomb should be
102 | | ... | ${node} | ${sub_interface_name} | ${sub_interface_base_settings}
103 | | ... | ${sub_interface_settings}
104 | | When Honeycomb creates L2 bridge domain
105 | | ... | ${node} | ${bd_name} | ${bd_settings}
106 | | Then Bridge domain configuration from Honeycomb should be
107 | | ... | ${node} | ${bd_name} | ${bd_settings}
108 | | When Honeycomb adds sub-interface to bridge domain
109 | | ... | ${node} | ${sub_interface_name} | ${bd_name} | ${sub_bd_settings}
110 | | Then sub-interface bridge domain configuration from Honeycomb should be
111 | | ... | ${node} | ${sub_interface_name} | ${sub_bd_settings}
112 | | And sub-interface bridge domain configuration from VAT should be
113 | | ... | ${node} | ${sub_interface_name} | ${sub_bd_settings}
114 | | And sub-interface configuration from VAT should be
115 | | ... | ${node} | ${sub_interface_name} | ${sub_interface_settings}
116
117 | Honeycomb sets vlan tag rewrite on sub-interface in bridge domain
118 | | [Documentation] | Check if Honeycomb adds vlan tag rewrite on sub-interface\
119 | | ... | in bridge domain.
120 | | ...
121 | | [Tags] | honeycomb_sanity
122 | | ...
123 | | Given sub-interface configuration from Honeycomb should be
124 | | ... | ${node} | ${sub_interface_name} | ${sub_interface_base_settings}
125 | | ... | ${sub_interface_settings}
126 | | And sub-interface bridge domain configuration from Honeycomb should be
127 | | ... | ${node} | ${sub_interface_name} | ${sub_bd_settings}
128 | | &{init_rw_params}= | Create dictionary | first-pushed=802dot1ad
129 | | ... | rewrite-operation=disabled
130 | | And rewrite tag from Honeycomb should be
131 | | ... | ${node} | ${sub_interface_name} | ${init_rw_params}
132 | | When Honeycomb sets rewrite tag
133 | | ... | ${node} | ${sub_interface_name} | ${rw_params}
134 | | Then rewrite tag from Honeycomb should be
135 | | ... | ${node} | ${sub_interface_name} | ${rw_params}
136 | | And rewrite tag configuration from VAT should be
137 | | ... | ${node} | ${sub_interface_name} | ${rw_params}
138 | | And sub-interface configuration from VAT should be
139 | | ... | ${node} | ${sub_interface_name} | ${sub_interface_settings}
140
141 | Honeycomb edits vlan tag rewrite on sub-interface in bridge domain
142 | | [Documentation] | Check if Honeycomb updates vlan tag rewrite on\
143 | | ... | sub-interface in bridge domain.
144 | | ...
145 | | [Tags] | honeycomb_sanity
146 | | ...
147 | | Given sub-interface configuration from Honeycomb should be
148 | | ... | ${node} | ${sub_interface_name} | ${sub_interface_base_settings}
149 | | ... | ${sub_interface_settings}
150 | | And rewrite tag from Honeycomb should be
151 | | ... | ${node} | ${sub_interface_name} | ${rw_params}
152 | | When Honeycomb sets rewrite tag
153 | | ... | ${node} | ${sub_interface_name} | ${rw_params_edited}
154 | | Then rewrite tag from Honeycomb should be
155 | | ... | ${node} | ${sub_interface_name} | ${rw_params_edited}
156 | | And rewrite tag configuration from VAT should be
157 | | ... | ${node} | ${sub_interface_name} | ${rw_params_edited}
158 | | And sub-interface configuration from VAT should be
159 | | ... | ${node} | ${sub_interface_name} | ${sub_interface_settings}
160
161 | Honeycomb removes vlan tag rewrite from sub-interface
162 | | [Documentation] | Check if Honeycomb removes vlan tag rewrite from\
163 | | ... | sub-interface.
164 | | ...
165 | | [Tags] | honeycomb_sanity
166 | | ...
167 | | Given sub-interface configuration from Honeycomb should be
168 | | ... | ${node} | ${sub_interface_name} | ${sub_interface_base_settings}
169 | | ... | ${sub_interface_settings}
170 | | And rewrite tag from Honeycomb should be
171 | | ... | ${node} | ${sub_interface_name} | ${rw_params_edited}
172 | | When Honeycomb removes rewrite tag
173 | | ... | ${node} | ${sub_interface_name}
174 | | Then rewrite tag from Honeycomb should be
175 | | ... | ${node} | ${sub_interface_name} | ${rw_params_disabled}
176 | | And rewrite tag configuration from VAT should be
177 | | ... | ${node} | ${sub_interface_name} | ${rw_params_disabled}
178 | | And sub-interface configuration from VAT should be
179 | | ... | ${node} | ${sub_interface_name} | ${sub_interface_settings}
180
181 | Honeycomb sets again vlan tag rewrite on sub-interface in bridge domain
182 | | [Documentation] | Check if Honeycomb adds vlan tag rewrite on sub-interface\
183 | | ... | in bridge domain if it was disabled before.
184 | | ...
185 | | [Tags] | honeycomb_sanity
186 | | ...
187 | | Given sub-interface configuration from Honeycomb should be
188 | | ... | ${node} | ${sub_interface_name} | ${sub_interface_base_settings}
189 | | ... | ${sub_interface_settings}
190 | | And rewrite tag from Honeycomb should be
191 | | ... | ${node} | ${sub_interface_name} | ${rw_params_disabled}
192 | | When Honeycomb sets rewrite tag
193 | | ... | ${node} | ${sub_interface_name} | ${rw_params}
194 | | Then rewrite tag from Honeycomb should be
195 | | ... | ${node} | ${sub_interface_name} | ${rw_params}
196 | | And rewrite tag configuration from VAT should be
197 | | ... | ${node} | ${sub_interface_name} | ${rw_params}
198 | | And sub-interface configuration from VAT should be
199 | | ... | ${node} | ${sub_interface_name} | ${sub_interface_settings}
200
201 | Honycomb deletes sub-interface
202 | | [Documentation] | Check if Honeycomb can delete an existing sub-interface.
203 | | ...
204 | | [Tags] | honeycomb_sanity
205 | | ...
206 | | Given sub-interface configuration from Honeycomb should be
207 | | ... | ${node} | ${sub_interface_name} | ${sub_interface_base_settings}
208 | | ... | ${sub_interface_settings}
209 | | When Honeycomb fails to remove sub-interface
210 | | ... | ${node} | ${sub_interface_name}
211 | | Then sub-interface configuration from Honeycomb should be
212 | | ... | ${node} | ${sub_interface_name} | ${sub_interface_base_settings}
213 | | ... | ${sub_interface_settings}
214 | | And sub-interface configuration from VAT should be
215 | | ... | ${node} | ${sub_interface_name} | ${sub_interface_settings}
216
217 | Honycomb creates sub-interface with bridge domain
218 | | [Documentation] | Check if Honeycomb creates a sub-interface with bridge\
219 | | ... | domain and rewrite tag configured.
220 | | ...
221 | | [Tags] | honeycomb_sanity
222 | | ...
223 | | Given sub-interface configuration from Honeycomb should be empty
224 | | ... | ${node} | ${sub_interface2_name}
225 | | And sub-interface configuration from VAT should be empty
226 | | ... | ${node} | ${sub_interface2_name}
227 | | When Honeycomb creates L2 bridge domain
228 | | ... | ${node} | ${bd2_name} | ${bd2_settings}
229 | | And Honeycomb creates sub-interface
230 | | ... | ${node} | ${interface2} | ${sub_interface_id}
231 | | ... | ${sub_interface2_base_settings} | ${sub_interface2_settings}
232 | | Then sub-interface configuration with bd and rw from Honeycomb should be
233 | | ... | ${node} | ${sub_interface2_name} | ${sub_interface2_base_settings}
234 | | ... | ${sub_interface2_settings}
235 | | And sub-interface configuration from VAT should be
236 | | ... | ${node} | ${sub_interface2_name} | ${sub_interface2_settings}
237 | | And rewrite tag configuration from VAT should be
238 | | ... | ${node} | ${sub_interface2_name} | ${rw_params}
239
240 | Honeycomb sets wrong operation in vlan tag rewrite
241 | | [Documentation] | Negative test: Honeycomb tries to set a wrong value of\
242 | | ... | "rewrite-operation" parameter in "vlan-tag-rewrite". The operation\
243 | | ... | must fail.
244 | | ...
245 | | [Tags] | honeycomb_sanity
246 | | ...
247 | | Given sub-interface configuration with bd and rw from Honeycomb should be
248 | | ... | ${node} | ${sub_interface2_name} | ${sub_interface2_base_settings}
249 | | ... | ${sub_interface2_settings}
250 | | And rewrite tag from Honeycomb should be
251 | | ... | ${node} | ${sub_interface_name} | ${rw_params_disabled}
252 | | When Honeycomb fails to set wrong rewrite tag
253 | | ... | ${node} | ${sub_interface_name} | ${rw_params_wrong_op}
254 | | Then sub-interface configuration with bd and rw from Honeycomb should be
255 | | ... | ${node} | ${sub_interface2_name} | ${sub_interface2_base_settings}
256 | | ... | ${sub_interface2_settings}
257 | | And rewrite tag from Honeycomb should be
258 | | ... | ${node} | ${sub_interface_name} | ${rw_params_disabled}
259 | | And rewrite tag configuration from VAT should be
260 | | ... | ${node} | ${sub_interface_name} | ${rw_params_disabled}
261
262 | Honeycomb sets wrong first-pushed in vlan tag rewrite
263 | | [Documentation] | Negative test: Honeycomb tries to set a wrong value of\
264 | | ... | "first-pushed" parameter in "vlan-tag-rewrite". The operation must\
265 | | ... | fail.
266 | | ...
267 | | [Tags] | honeycomb_sanity
268 | | ...
269 | | Given sub-interface configuration with bd and rw from Honeycomb should be
270 | | ... | ${node} | ${sub_interface2_name} | ${sub_interface2_base_settings}
271 | | ... | ${sub_interface2_settings}
272 | | And rewrite tag from Honeycomb should be
273 | | ... | ${node} | ${sub_interface_name} | ${rw_params_disabled}
274 | | When Honeycomb fails to set wrong rewrite tag
275 | | ... | ${node} | ${sub_interface_name} | ${rw_params_wrong_pushed}
276 | | Then sub-interface configuration with bd and rw from Honeycomb should be
277 | | ... | ${node} | ${sub_interface2_name} | ${sub_interface2_base_settings}
278 | | ... | ${sub_interface2_settings}
279 | | And rewrite tag from Honeycomb should be
280 | | ... | ${node} | ${sub_interface_name} | ${rw_params_disabled}
281 | | And rewrite tag configuration from VAT should be
282 | | ... | ${node} | ${sub_interface_name} | ${rw_params_disabled}
283
284 | Honeycomb sets interface and sub-interface up
285 | | [Documentation] | Honeycomb changes the state of interface up and then\
286 | | ... | changes the state of its sub-interface up, in this order.
287 | | ...
288 | | [Tags] | honeycomb_sanity
289 | | ...
290 | | Given interface state from Honeycomb should be
291 | | ... | ${node} | ${interface} | down
292 | | And interface state from VAT should be
293 | | ... | ${node} | ${interface} | down
294 | | When Honeycomb sets interface state
295 | | ... | ${node} | ${interface} | up
296 | | Then interface state from Honeycomb should be
297 | | ... | ${node} | ${interface} | up
298 | | And interface state from VAT should be
299 | | ... | ${node} | ${interface} | up
300 | | Given interface state from Honeycomb should be
301 | | ... | ${node} | ${sub_interface_name} | down
302 | | And interface state from VAT should be
303 | | ... | ${node} | ${sub_interface_name} | down
304 | | When Honeycomb sets interface state
305 | | ... | ${node} | ${sub_interface_name} | up
306 | | Then interface state from Honeycomb should be
307 | | ... | ${node} | ${sub_interface_name} | up
308 | | And Interface state from VAT should be
309 | | ... | ${node} | ${sub_interface_name} | up
310
311 | Honeycomb sets sub-interface down while its super-interface is up
312 | | [Documentation] | Honeycomb sets the sub-interface down while its\
313 | | ... | super-interface is up. It must be possible.
314 | | ...
315 | | [Tags] | honeycomb_sanity
316 | | ...
317 | | Given interface state from Honeycomb should be
318 | | ... | ${node} | ${sub_interface_name} | up
319 | | And Interface state from VAT should be
320 | | ... | ${node} | ${sub_interface_name} | up
321 | | And interface state from Honeycomb should be
322 | | ... | ${node} | ${interface} | up
323 | | And interface state from VAT should be
324 | | ... | ${node} | ${interface} | up
325 | | When Honeycomb sets interface state
326 | | ... | ${node} | ${sub_interface_name} | down
327 | | Then Interface state from Honeycomb should be
328 | | ... | ${node} | ${sub_interface_name} | down
329 | | And Interface state from VAT should be
330 | | ... | ${node} | ${sub_interface_name} | down
331 | | And interface state from Honeycomb should be
332 | | ... | ${node} | ${interface} | up
333 | | And interface state from VAT should be
334 | | ... | ${node} | ${interface} | up
335
336 | Honeycomb sets interface and sub-interface down
337 | | [Documentation] | Honeycomb changes the state of interface down and then\
338 | | ... | changes the state of its sub-interface down, in this order.
339 | | ...
340 | | [Tags] | honeycomb_sanity
341 | | ...
342 | | Given interface state from Honeycomb should be
343 | | ... | ${node} | ${interface} | up
344 | | And interface state from VAT should be
345 | | ... | ${node} | ${interface} | up
346 | | When Honeycomb sets interface state
347 | | ... | ${node} | ${interface} | down
348 | | Then interface state from Honeycomb should be
349 | | ... | ${node} | ${interface} | down
350 | | And Interface state from VAT should be
351 | | ... | ${node} | ${interface} | down
352 | | Given interface state from Honeycomb should be
353 | | ... | ${node} | ${sub_interface_name} | up
354 | | And interface state from VAT should be
355 | | ... | ${node} | ${sub_interface_name} | up
356 | | When Honeycomb sets interface state
357 | | ... | ${node} | ${sub_interface_name} | down
358 | | Then Interface state from Honeycomb should be
359 | | ... | ${node} | ${sub_interface_name} | down
360 | | And Interface state from VAT should be
361 | | ... | ${node} | ${sub_interface_name} | down
362
363 | Honeycomb fails to set sub-interface up while its super-interface is down
364 | | [Documentation] | Honeycomb tries to set the sub-interface up while its\
365 | | ... | super-interface is down. It must not be possible.
366 | | ...
367 | | [Tags] | honeycomb_sanity
368 | | ...
369 | | Given interface state from Honeycomb should be
370 | | ... | ${node} | ${interface} | down
371 | | And interface state from VAT should be
372 | | ... | ${node} | ${interface} | down
373 | | And interface state from Honeycomb should be
374 | | ... | ${node} | ${sub_interface_name} | down
375 | | And interface state from VAT should be
376 | | ... | ${node} | ${sub_interface_name} | down
377 | | When Honeycomb fails to set sub-interface up
378 | | ... | ${node} | ${sub_interface_name}
379 | | Then interface state from Honeycomb should be
380 | | ... | ${node} | ${interface} | down
381 | | And interface state from VAT should be
382 | | ... | ${node} | ${interface} | down
383 | | And interface state from Honeycomb should be
384 | | ... | ${node} | ${sub_interface_name} | down
385 | | And interface state from VAT should be
386 | | ... | ${node} | ${sub_interface_name} | down