Update Honeycomb persistence tests with new Vlan
[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 interface configuration from Honeycomb should be empty
40 | | ... | ${node} | ${sub_if_name}
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 interface state from Honeycomb should be
69 | | ... | ${node} | ${sub_if_name} | down
70 | | And interface state from VAT should be
71 | | ... | ${node} | ${sub_if_name} | down
72 | | When Honeycomb sets the sub-interface up
73 | | ... | ${node} | ${super_if} | ${sub_if_id}
74 | | Then interface state from Honeycomb should be
75 | | ... | ${node} | ${sub_if_name} | up
76 | | And Interface state from VAT should be
77 | | ... | ${node} | ${sub_if_name} | up
78
79 | Honeycomb sets sub-interface down while its super-interface is up
80 | | [Documentation] | Honeycomb sets the sub-interface down while its\
81 | | ... | super-interface is up. It must be possible.
82 | | ...
83 | | [Teardown] | Set super and sub interfaces up
84 | | ... | ${node} | ${super_if} | ${sub_if_id}
85 | | ...
86 | | Given interface state from Honeycomb should be
87 | | ... | ${node} | ${sub_if_name} | up
88 | | And interface state from VAT should be
89 | | ... | ${node} | ${sub_if_name} | up
90 | | And interface state from Honeycomb should be
91 | | ... | ${node} | ${super_if} | up
92 | | And interface state from VAT should be
93 | | ... | ${node} | ${super_if} | up
94 | | When Honeycomb sets the sub-interface down
95 | | ... | ${node} | ${super_if} | ${sub_if_id}
96 | | Then interface state from Honeycomb should be
97 | | ... | ${node} | ${sub_if_name} | down
98 | | And interface state from VAT should be
99 | | ... | ${node} | ${sub_if_name} | down
100 | | And interface state from Honeycomb should be
101 | | ... | ${node} | ${super_if} | up
102 | | And interface state from VAT should be
103 | | ... | ${node} | ${super_if} | up
104
105 | Honeycomb sets interface and sub-interface down
106 | | [Documentation] | Honeycomb changes the state of interface down and then\
107 | | ... | changes the state of its sub-interface down, in this order.
108 | | ...
109 | | [Teardown] | Set super and sub interfaces down
110 | | ... | ${node} | ${super_if} | ${sub_if_id}
111 | | ...
112 | | Given interface state from Honeycomb should be
113 | | ... | ${node} | ${super_if} | up
114 | | And interface state from VAT should be
115 | | ... | ${node} | ${super_if} | up
116 | | When Honeycomb sets interface state
117 | | ... | ${node} | ${super_if} | down
118 | | Then interface state from Honeycomb should be
119 | | ... | ${node} | ${super_if} | down
120 | | And interface state from VAT should be
121 | | ... | ${node} | ${super_if} | down
122 | | Given interface state from Honeycomb should be
123 | | ... | ${node} | ${sub_if_name} | up
124 | | And interface state from VAT should be
125 | | ... | ${node} | ${sub_if_name} | up
126 | | When Honeycomb sets the sub-interface down
127 | | ... | ${node} | ${super_if} | ${sub_if_id}
128 | | Then interface state from Honeycomb should be
129 | | ... | ${node} | ${sub_if_name} | down
130 | | And interface state from VAT should be
131 | | ... | ${node} | ${sub_if_name} | down
132
133 | Honeycomb fails to set sub-interface up while its super-interface is down
134 | | [Documentation] | Honeycomb tries to set the sub-interface up while its\
135 | | ... | super-interface is down. It must not be possible.
136 | | ...
137 | | Given interface state from Honeycomb should be
138 | | ... | ${node} | ${super_if} | down
139 | | And interface state from VAT should be
140 | | ... | ${node} | ${super_if} | down
141 | | And interface state from Honeycomb should be
142 | | ... | ${node} | ${sub_if_name} | down
143 | | And interface state from VAT should be
144 | | ... | ${node} | ${sub_if_name} | down
145 | | When Honeycomb fails to set sub-interface up
146 | | ... | ${node} | ${super_if} | ${sub_if_id}
147 | | Then interface state from Honeycomb should be
148 | | ... | ${node} | ${super_if} | down
149 | | And interface state from VAT should be
150 | | ... | ${node} | ${super_if} | down
151 | | And interface state from Honeycomb should be
152 | | ... | ${node} | ${sub_if_name} | down
153 | | And interface state from VAT should be
154 | | ... | ${node} | ${sub_if_name} | down
155
156 | Honeycomb fails to delete sub-interface
157 | | [Documentation] | Check if Honeycomb can delete an existing sub-interface.
158 | | ...
159 | | [Setup] | Set super and sub interfaces down
160 | | ... | ${node} | ${super_if} | ${sub_if_id}
161 | | ...
162 | | Given sub-interface configuration from Honeycomb should be
163 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${sub_if_1_oper}
164 | | And sub-interface configuration from VAT should be
165 | | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper}
166 | | When Honeycomb fails to remove all sub-interfaces
167 | | ... | ${node} | ${super_if}
168 | | Then sub-interface configuration from Honeycomb should be
169 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${sub_if_1_oper}
170 | | And sub-interface configuration from VAT should be
171 | | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper}
172
173 | Honeycomb adds sub-interface to new bridge domain
174 | | [Documentation] | Check if Honeycomb adds a sub-interface to bridge domain.
175 | | ...
176 | | [Setup] | Set super and sub interfaces down
177 | | ... | ${node} | ${super_if} | ${sub_if_id}
178 | | ...
179 | | Given sub-interface configuration from Honeycomb should be
180 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${sub_if_1_oper}
181 | | And sub-interface configuration from VAT should be
182 | | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper}
183 | | When Honeycomb creates L2 bridge domain
184 | | ... | ${node} | ${bd_name} | ${bd_settings}
185 | | Then bridge domain configuration from Honeycomb should be
186 | | ... | ${node} | ${bd_name} | ${bd_settings}
187 | | When Honeycomb adds sub-interface to bridge domain
188 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${sub_bd_settings}
189 | | Then sub-interface bridge domain configuration from Honeycomb should be
190 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${sub_bd_settings}
191 | | And sub-interface bridge domain configuration from VAT should be
192 | | ... | ${node} | ${sub_if_name} | ${sub_bd_settings}
193 | | And sub-interface configuration from VAT should be
194 | | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper}
195
196 | Honeycomb enables tag-rewrite pop 1
197 | | [Documentation] | Check if Honeycomb enables tag-rewrite and sets its\
198 | | ... | parameters correctly. Case: pop 1.
199 | | ...
200 | | [Teardown] | VAT disables tag-rewrite | ${node} | ${super_if}.${sub_if_id}
201 | | ...
202 | | Given rewrite tag from Honeycomb should be empty
203 | | ... | ${node} | ${super_if} | ${sub_if_id}
204 | | When Honeycomb configures tag rewrite
205 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1}
206 | | Then rewrite tag from Honeycomb should be
207 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1_oper}
208 | | And rewrite tag from VAT should be
209 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_pop_1_VAT}
210
211 | Honeycomb enables tag-rewrite push
212 | | [Documentation] | Check if Honeycomb enables tag-rewrite and sets its\
213 | | ... | parameters correctly. Case: push.
214 | | ...
215 | | [Teardown] | VAT disables tag-rewrite | ${node} | ${super_if}.${sub_if_id}
216 | | ...
217 | | Given rewrite tag from Honeycomb should be empty
218 | | ... | ${node} | ${super_if} | ${sub_if_id}
219 | | When Honeycomb configures tag rewrite
220 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_push}
221 | | Then rewrite tag from Honeycomb should be
222 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_push_oper}
223 | | And rewrite tag from VAT should be
224 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_push_VAT}
225
226 | Honeycomb enables tag-rewrite translate 1-2
227 | | [Documentation] | Check if Honeycomb enables tag-rewrite and sets its\
228 | | ... | parameters correctly. Case: translate 1-2.
229 | | ...
230 | | [Teardown] | VAT disables tag-rewrite | ${node} | ${super_if}.${sub_if_id}
231 | | ...
232 | | Given rewrite tag from Honeycomb should be empty
233 | | ... | ${node} | ${super_if} | ${sub_if_id}
234 | | When Honeycomb configures tag rewrite
235 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_translate_1_2}
236 | | Then rewrite tag from Honeycomb should be
237 | | ... | ${node} | ${super_if} | ${sub_if_id}
238 | | ... | ${tag_rewrite_translate_1_2_oper}
239 | | And rewrite tag from VAT should be
240 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_translate_1_2_VAT}
241
242 | Honeycomb disables tag-rewrite
243 | | [Documentation] | Check if Honeycomb disables the tag-rewrite.
244 | | ...
245 | | [Teardown] | VAT disables tag-rewrite | ${node} | ${super_if}.${sub_if_id}
246 | | ...
247 | | When Honeycomb configures tag rewrite
248 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1}
249 | | Then rewrite tag from Honeycomb should be
250 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1_oper}
251 | | When Honeycomb configures tag rewrite
252 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_disabled}
253 | | Then rewrite tag from Honeycomb should be empty
254 | | ... | ${node} | ${super_if} | ${sub_if_id}
255 | | And rewrite tag from VAT should be
256 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_disabled_VAT}
257
258 | Honeycomb enables tag-rewrite pop 1 again
259 | | [Documentation] | Check if Honeycomb can enable tag-rewrite again, once it\
260 | | ... | was disabled by Honeycomb.
261 | | ...
262 | | [Teardown] | VAT disables tag-rewrite | ${node} | ${super_if}.${sub_if_id}
263 | | ...
264 | | Given rewrite tag from Honeycomb should be empty
265 | | ... | ${node} | ${super_if} | ${sub_if_id}
266 | | When Honeycomb configures tag rewrite
267 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1}
268 | | Then rewrite tag from Honeycomb should be
269 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1_oper}
270 | | And rewrite tag from VAT should be
271 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_pop_1_VAT}
272
273 | Honeycomb modifies the tag-rewrite
274 | | [Documentation] | Honeycomb sets the tag-rewrite:
275 | | ... | 1. pop 1, then
276 | | ... | 2. push, then
277 | | ... | 3. translate 1 - 2
278 | | ... | Then Honeycomb disables the tag-rewrite.
279 | | ...
280 | | [Teardown] | VAT disables tag-rewrite | ${node} | ${super_if}.${sub_if_id}
281 | | ...
282 | | Given rewrite tag from Honeycomb should be empty
283 | | ... | ${node} | ${super_if} | ${sub_if_id}
284 | | When Honeycomb configures tag rewrite
285 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1}
286 | | Then rewrite tag from Honeycomb should be
287 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_pop_1_oper}
288 | | And rewrite tag from VAT should be
289 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_pop_1_VAT}
290 | | When Honeycomb configures tag rewrite
291 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_push}
292 | | Then rewrite tag from Honeycomb should be
293 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_push_oper}
294 | | And rewrite tag from VAT should be
295 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_push_VAT}
296 | | When Honeycomb configures tag rewrite
297 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_translate_1_2}
298 | | Then rewrite tag from Honeycomb should be
299 | | ... | ${node} | ${super_if} | ${sub_if_id}
300 | | ... | ${tag_rewrite_translate_1_2_oper}
301 | | And rewrite tag from VAT should be
302 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_translate_1_2_VAT}
303 | | When Honeycomb configures tag rewrite
304 | | ... | ${node} | ${super_if} | ${sub_if_id} | ${tag_rewrite_disabled}
305 | | Then rewrite tag from Honeycomb should be empty
306 | | ... | ${node} | ${super_if} | ${sub_if_id}
307 | | And rewrite tag from VAT should be
308 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_disabled_VAT}
309
310 | Honeycomb fails to set wrong vlan-type in tag-rewrite
311 | | [Documentation] | Check that Honeycomb does not accept wrong values of\
312 | | ... | vlan-type in tag-rewrite.
313 | | ...
314 | | Given rewrite tag from Honeycomb should be empty
315 | | ... | ${node} | ${super_if} | ${sub_if_id}
316 | | When Honeycomb fails to set wrong rewrite tag
317 | | ... | ${node} | ${super_if} | ${sub_if_id}
318 | | ... | ${tag_rewrite_translate_1_2_wrong}
319 | | Then rewrite tag from Honeycomb should be empty
320 | | ... | ${node} | ${super_if} | ${sub_if_id}
321 | | And rewrite tag from VAT should be
322 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_disabled_VAT}
323
324 *** Keywords ***
325 | Set super and sub interfaces up
326 | | [Documentation] | Honeycomb sets super-interface and sub-interface up, in\
327 | | ... | this order.
328 | | ...
329 | | ... | *Arguments:*
330 | | ... | - node - Information about a DUT node. Type: dictionary
331 | | ... | - super_interface - Super interface. Type: string
332 | | ... | - identifier - Sub-interface identifier. Type: integer or string
333 | | ...
334 | | ... | *Example:*
335 | | ... | \| Set super and sub interfaces up\
336 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \|
337 | | ...
338 | | [Arguments] | ${node} | ${super_interface} | ${identifier}
339 | | ...
340 | | Honeycomb sets interface state
341 | | ... | ${node} | ${super_interface} | up
342 | | Honeycomb sets the sub-interface up
343 | | ... | ${node} | ${super_interface} | ${identifier}
344
345 | Set super and sub interfaces down
346 | | [Documentation] | Honeycomb sets super-interface and sub-interface down, in\
347 | | ... | this order.
348 | | ...
349 | | ... | *Arguments:*
350 | | ... | - node - Information about a DUT node. Type: dictionary
351 | | ... | - super_interface - Super interface. Type: string
352 | | ... | - identifier - Sub-interface identifier. Type: integer or string
353 | | ...
354 | | ... | *Example:*
355 | | ... | \| Set super and sub interfaces down\
356 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \|
357 | | ...
358 | | [Arguments] | ${node} | ${super_interface} | ${identifier}
359 | | ...
360 | | Honeycomb sets interface state
361 | | ... | ${node} | ${super_interface} | down
362 | | Honeycomb sets the sub-interface down
363 | | ... | ${node} | ${super_interface} | ${identifier}