49f56914be5c455dca5171f6ec52c61a70ec94ba
[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 | Suite Teardown | Honeycomb removes all bridge domains | ${node}
21 | Documentation | *Honeycomb sub-interface management test suite.*
22 | ...
23 | ...           | This test suite tests if it is posible to create, modify and \
24 | ...           | delete a sub-interface.
25 | Force Tags | honeycomb_sanity
26
27 *** Variables ***
28 | ${node}= | ${nodes['DUT1']}
29
30 # Test interface 1 and its sub-interface parameters:
31 | ${super_if}= | ${node['interfaces']['port1']['name']}
32 | ${sub_if_id}= | ${sub_if_1_settings['identifier']}
33 | ${sub_if_name}= | ${super_if}.${sub_if_id}
34
35 *** Test Cases ***
36 | Honycomb creates sub-interface
37 | | [Documentation] | Check if Honeycomb creates a sub-interface.
38 | | ...
39 | | Given sub-interface configuration from Honeycomb should be empty
40 | | ... | ${node} | ${super_if} | ${sub_if_id}
41 | | And interface configuration from VAT should be empty
42 | | ... | ${node} | ${sub_if_name}
43 | | When Honeycomb creates sub-interface | ${node} | ${super_if}
44 | | ... | ${sub_if_1_match} | ${sub_if_1_tags} | ${sub_if_1_settings}
45 | | Then run keyword and continue on failure
46 | | ... | Sub-interface configuration from Honeycomb should be
47 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${sub_if_1_oper}
48 | | And run keyword and continue on failure
49 | | ... | Sub-interface configuration from VAT should be
50 | | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper}
51 | | And sub-interface indices from Honeycomb and VAT should correspond
52 | | ... | ${node} | ${super_if} | ${sub_if_id}
53
54 | Honeycomb sets interface and sub-interface up
55 | | [Documentation] | Honeycomb changes the state of interface up and then \
56 | | ... | changes the state of its sub-interface up, in this order.
57 | | ...
58 | | Given interface state from Honeycomb should be
59 | | ... | ${node} | ${super_if} | down
60 | | And interface state from VAT should be
61 | | ... | ${node} | ${super_if} | down
62 | | When Honeycomb sets interface state
63 | | ... | ${node} | ${super_if} | up
64 | | Then interface state from Honeycomb should be
65 | | ... | ${node} | ${super_if} | up
66 | | And interface state from VAT should be
67 | | ... | ${node} | ${super_if} | up
68 | | Given run keyword and continue on failure
69 | | ... | Sub-interface state from Honeycomb should be
70 | | ... | ${node} | ${super_if} | ${sub_if_id} | down | down
71 | | And run keyword and continue on failure
72 | | ... | Sub-interface state from VAT should be
73 | | ... | ${node} | ${sub_if_name} | down | down
74 | | When Honeycomb sets the sub-interface up
75 | | ... | ${node} | ${super_if} | ${sub_if_id}
76 | | Then run keyword and continue on failure
77 | | ... | Sub-interface state from Honeycomb should be
78 | | ... | ${node} | ${super_if} | ${sub_if_id} | up | up
79 | | And sub-interface state from VAT should be
80 | | ... | ${node} | ${sub_if_name} | up | up
81
82 | Honeycomb sets sub-interface down while its super-interface is up
83 | | [Documentation] | Honeycomb sets the sub-interface down while its \
84 | | ... | super-interface is up. It must be possible.
85 | | ...
86 | | [Teardown] | Set super and sub interfaces up
87 | | ... | ${node} | ${super_if} | ${sub_if_id}
88 | | ...
89 | | Given sub-interface state from Honeycomb should be
90 | | ... | ${node} | ${super_if} | ${sub_if_id} | up | up
91 | | And sub-interface state from VAT should be
92 | | ... | ${node} | ${sub_if_name} | up | up
93 | | And interface state from Honeycomb should be
94 | | ... | ${node} | ${super_if} | up
95 | | And interface state from VAT should be
96 | | ... | ${node} | ${super_if} | up
97 | | When Honeycomb sets the sub-interface down
98 | | ... | ${node} | ${super_if} | ${sub_if_id}
99 | | Then sub-interface state from Honeycomb should be
100 | | ... | ${node} | ${super_if} | ${sub_if_id} | down | down
101 | | And sub-interface state from VAT should be
102 | | ... | ${node} | ${sub_if_name} | down | down
103 | | And interface state from Honeycomb should be
104 | | ... | ${node} | ${super_if} | up
105 | | And interface state from VAT should be
106 | | ... | ${node} | ${super_if} | up
107
108 | Honeycomb sets interface and sub-interface down
109 | | [Documentation] | Honeycomb changes the state of interface down and then \
110 | | ... | changes the state of its sub-interface down, in this order.
111 | | ...
112 | | [Teardown] | Set super and sub interfaces down
113 | | ... | ${node} | ${super_if} | ${sub_if_id}
114 | | ...
115 | | Given interface state from Honeycomb should be
116 | | ... | ${node} | ${super_if} | up
117 | | And interface state from VAT should be
118 | | ... | ${node} | ${super_if} | up
119 | | When Honeycomb sets interface state
120 | | ... | ${node} | ${super_if} | down
121 | | Then interface state from Honeycomb should be
122 | | ... | ${node} | ${super_if} | down
123 | | And interface state from VAT should be
124 | | ... | ${node} | ${super_if} | down
125 | | Given sub-interface state from Honeycomb should be
126 | | ... | ${node} | ${super_if} | ${sub_if_id} | up | down
127 | | And sub-interface state from VAT should be
128 | | ... | ${node} | ${sub_if_name} | up | down
129 | | When Honeycomb sets the sub-interface down
130 | | ... | ${node} | ${super_if} | ${sub_if_id}
131 | | Then sub-interface state from Honeycomb should be
132 | | ... | ${node} | ${super_if} | ${sub_if_id} | down | down
133 | | And sub-interface state from VAT should be
134 | | ... | ${node} | ${sub_if_name} | down | down
135
136 | Honeycomb fails to set sub-interface up while its super-interface is down
137 | | [Documentation] | Honeycomb tries to set the sub-interface up while its \
138 | | ... | super-interface is down. It must not be possible.
139 | | ...
140 | | Given interface state from Honeycomb should be
141 | | ... | ${node} | ${super_if} | down
142 | | And interface state from VAT should be
143 | | ... | ${node} | ${super_if} | down
144 | | And sub-interface state from Honeycomb should be
145 | | ... | ${node} | ${super_if} | ${sub_if_id} | down | down
146 | | And sub-interface state from VAT should be
147 | | ... | ${node} | ${sub_if_name} | down | down
148 | | When Honeycomb fails to set sub-interface up
149 | | ... | ${node} | ${super_if} | ${sub_if_id}
150 | | Then interface state from Honeycomb should be
151 | | ... | ${node} | ${super_if} | down
152 | | And interface state from VAT should be
153 | | ... | ${node} | ${super_if} | down
154 | | And sub-interface state from Honeycomb should be
155 | | ... | ${node} | ${super_if} | ${sub_if_id} | down | down
156 | | And sub-interface state from VAT should be
157 | | ... | ${node} | ${sub_if_name} | down | down
158
159 | Honeycomb fails to delete sub-interface
160 | | [Documentation] | Check if Honeycomb can delete an existing sub-interface.
161 | | ...
162 | | [Setup] | Set super and sub interfaces down
163 | | ... | ${node} | ${super_if} | ${sub_if_id}
164 | | ...
165 | | Given sub-interface configuration from Honeycomb should be
166 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${sub_if_1_oper}
167 | | And sub-interface configuration from VAT should be
168 | | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper}
169 | | When Honeycomb fails to remove all sub-interfaces
170 | | ... | ${node} | ${super_if}
171 | | Then sub-interface configuration from Honeycomb should be
172 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${sub_if_1_oper}
173 | | And sub-interface configuration from VAT should be
174 | | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper}
175
176 | Honeycomb adds sub-interface to new bridge domain
177 | | [Documentation] | Check if Honeycomb adds a sub-interface to bridge domain.
178 | | ...
179 | | [Setup] | Set super and sub interfaces down
180 | | ... | ${node} | ${super_if} | ${sub_if_id}
181 | | ...
182 | | Given sub-interface configuration from Honeycomb should be
183 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${sub_if_1_oper}
184 | | And sub-interface configuration from VAT should be
185 | | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper}
186 | | When Honeycomb creates L2 bridge domain
187 | | ... | ${node} | ${bd_name} | ${bd_settings}
188 | | Then bridge domain configuration from Honeycomb should be
189 | | ... | ${node} | ${bd_name} | ${bd_settings}
190 | | When Honeycomb adds sub-interface to bridge domain
191 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${sub_bd_settings}
192 | | Then sub-interface bridge domain configuration from Honeycomb should be
193 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${sub_bd_settings}
194 | | And sub-interface bridge domain configuration from VAT should be
195 | | ... | ${node} | ${sub_if_name} | ${sub_bd_settings}
196 | | And sub-interface configuration from VAT should be
197 | | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper}
198
199 | Honeycomb enables tag-rewrite pop 1
200 | | [Documentation] | Check if Honeycomb enables tag-rewrite and sets its \
201 | | ... | parameters correctly. Case: pop 1.
202 | | ...
203 | | [Teardown] | Honeycomb disables tag rewrite
204 | | ... | ${node} | ${super_if} | ${sub_if_id}
205 | | ...
206 | | Given rewrite tag from Honeycomb should be empty
207 | | ... | ${node} | ${super_if} | ${sub_if_id}
208 | | When Honeycomb configures tag rewrite
209 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1}
210 | | Then rewrite tag from Honeycomb should be
211 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1_oper}
212 | | And rewrite tag from VAT should be
213 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_pop_1_VAT}
214
215 | Honeycomb enables tag-rewrite push
216 | | [Documentation] | Check if Honeycomb enables tag-rewrite and sets its \
217 | | ... | parameters correctly. Case: push.
218 | | ...
219 | | [Teardown] | Honeycomb disables tag rewrite
220 | | ... | ${node} | ${super_if} | ${sub_if_id}
221 | | ...
222 | | Given rewrite tag from Honeycomb should be empty
223 | | ... | ${node} | ${super_if} | ${sub_if_id}
224 | | When Honeycomb configures tag rewrite
225 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_push}
226 | | Then rewrite tag from Honeycomb should be
227 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_push_oper}
228 | | And rewrite tag from VAT should be
229 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_push_VAT}
230
231 | Honeycomb enables tag-rewrite translate 1-2
232 | | [Documentation] | Check if Honeycomb enables tag-rewrite and sets its \
233 | | ... | parameters correctly. Case: translate 1-2.
234 | | ...
235 | | [Teardown] | Honeycomb disables tag rewrite
236 | | ... | ${node} | ${super_if} | ${sub_if_id}
237 | | ...
238 | | Given rewrite tag from Honeycomb should be empty
239 | | ... | ${node} | ${super_if} | ${sub_if_id}
240 | | When Honeycomb configures tag rewrite
241 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_translate_1_2}
242 | | Then rewrite tag from Honeycomb should be
243 | | ... | ${node} | ${super_if} | ${sub_if_id}
244 | | ... | ${tag_rewrite_translate_1_2_oper}
245 | | And rewrite tag from VAT should be
246 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_translate_1_2_VAT}
247
248 | Honeycomb disables tag-rewrite
249 | | [Documentation] | Check if Honeycomb disables the tag-rewrite.
250 | | ...
251 | | [Teardown] | Honeycomb disables tag rewrite
252 | | ... | ${node} | ${super_if} | ${sub_if_id}
253 | | ...
254 | | When Honeycomb configures tag rewrite
255 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1}
256 | | Then rewrite tag from Honeycomb should be
257 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1_oper}
258 | | When Honeycomb configures tag rewrite
259 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_disabled}
260 | | Then rewrite tag from Honeycomb should be empty
261 | | ... | ${node} | ${super_if} | ${sub_if_id}
262 | | And rewrite tag from VAT should be
263 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_disabled_VAT}
264
265 | Honeycomb enables tag-rewrite pop 1 again
266 | | [Documentation] | Check if Honeycomb can enable tag-rewrite again, once it \
267 | | ... | was disabled by Honeycomb.
268 | | ...
269 | | [Teardown] | Honeycomb disables tag rewrite
270 | | ... | ${node} | ${super_if} | ${sub_if_id}
271 | | ...
272 | | Given rewrite tag from Honeycomb should be empty
273 | | ... | ${node} | ${super_if} | ${sub_if_id}
274 | | When Honeycomb configures tag rewrite
275 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1}
276 | | Then rewrite tag from Honeycomb should be
277 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1_oper}
278 | | And rewrite tag from VAT should be
279 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_pop_1_VAT}
280
281 | Honeycomb modifies the tag-rewrite
282 | | [Documentation] | Honeycomb sets the tag-rewrite:
283 | | ... | 1. pop 1, then
284 | | ... | 2. push, then
285 | | ... | 3. translate 1 - 2
286 | | ... | Then Honeycomb disables the tag-rewrite.
287 | | ...
288 | | [Teardown] | Honeycomb disables tag rewrite
289 | | ... | ${node} | ${super_if} | ${sub_if_id}
290 | | ...
291 | | Given rewrite tag from Honeycomb should be empty
292 | | ... | ${node} | ${super_if} | ${sub_if_id}
293 | | When Honeycomb configures tag rewrite
294 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1}
295 | | Then rewrite tag from Honeycomb should be
296 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1_oper}
297 | | And rewrite tag from VAT should be
298 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_pop_1_VAT}
299 | | When Honeycomb configures tag rewrite
300 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_push}
301 | | Then rewrite tag from Honeycomb should be
302 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_push_oper}
303 | | And rewrite tag from VAT should be
304 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_push_VAT}
305 | | When Honeycomb configures tag rewrite
306 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_translate_1_2}
307 | | Then rewrite tag from Honeycomb should be
308 | | ... | ${node} | ${super_if} | ${sub_if_id}
309 | | ... | ${tag_rewrite_translate_1_2_oper}
310 | | And rewrite tag from VAT should be
311 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_translate_1_2_VAT}
312 | | When Honeycomb configures tag rewrite
313 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_disabled}
314 | | Then rewrite tag from Honeycomb should be empty
315 | | ... | ${node} | ${super_if} | ${sub_if_id}
316 | | And rewrite tag from VAT should be
317 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_disabled_VAT}
318
319 | Honeycomb fails to set wrong vlan-type in tag-rewrite
320 | | [Documentation] | Check that Honeycomb does not accept wrong values of \
321 | | ... | vlan-type in tag-rewrite.
322 | | ...
323 | | Given rewrite tag from Honeycomb should be empty
324 | | ... | ${node} | ${super_if} | ${sub_if_id}
325 | | When Honeycomb fails to set wrong rewrite tag
326 | | ... | ${node} | ${super_if} | ${sub_if_id}
327 | | ... | ${tag_rewrite_translate_1_2_wrong}
328 | | Then rewrite tag from Honeycomb should be empty
329 | | ... | ${node} | ${super_if} | ${sub_if_id}
330 | | And rewrite tag from VAT should be
331 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_disabled_VAT}
332
333 *** Keywords ***
334 | Set super and sub interfaces up
335 | | [Documentation] | Honeycomb sets super-interface and sub-interface up, in \
336 | | ... | this order.
337 | | ...
338 | | ... | *Arguments:*
339 | | ... | - node - Information about a DUT node. Type: dictionary
340 | | ... | - super_interface - Super interface. Type: string
341 | | ... | - identifier - Sub-interface identifier. Type: integer or string
342 | | ...
343 | | ... | *Example:*
344 | | ... | \| Set super and sub interfaces up\
345 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \|
346 | | ...
347 | | [Arguments] | ${node} | ${super_interface} | ${identifier}
348 | | ...
349 | | Honeycomb sets interface state
350 | | ... | ${node} | ${super_interface} | up
351 | | Honeycomb sets the sub-interface up
352 | | ... | ${node} | ${super_interface} | ${identifier}
353
354 | Set super and sub interfaces down
355 | | [Documentation] | Honeycomb sets super-interface and sub-interface down, in\
356 | | ... | this order.
357 | | ...
358 | | ... | *Arguments:*
359 | | ... | - node - Information about a DUT node. Type: dictionary
360 | | ... | - super_interface - Super interface. Type: string
361 | | ... | - identifier - Sub-interface identifier. Type: integer or string
362 | | ...
363 | | ... | *Example:*
364 | | ... | \| Set super and sub interfaces down\
365 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \|
366 | | ...
367 | | [Arguments] | ${node} | ${super_interface} | ${identifier}
368 | | ...
369 | | Honeycomb sets interface state
370 | | ... | ${node} | ${super_interface} | down
371 | | Honeycomb sets the sub-interface down
372 | | ... | ${node} | ${super_interface} | ${identifier}
373
374 | Honeycomb disables tag rewrite
375 | | [Documentation] |
376 | | ...
377 | | ... | *Arguments:*
378 | | ... | - node - Information about a DUT node. Type: dictionary
379 | | ... | - super_if - Super-interface. Type: string
380 | | ... | - identifier - Sub-interface ID. Type: integer or string
381 | | ...
382 | | ... | *Example:*
383 | | ... | \| Honeycomb disables tag rewrite \
384 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \|
385 | | ...
386 | | [Arguments] | ${node} | ${super_if} | ${sub_if_id}
387 | | ...
388 | | Honeycomb configures tag rewrite
389 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_disabled}