HC Test: Fix expected error when ACL table should be empty
[csit.git] / resources / libraries / robot / honeycomb / 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 | Library | resources.libraries.python.InterfaceUtil
16 | Library | resources.libraries.python.L2Util
17 | Library | resources.libraries.python.honeycomb.HcAPIKwInterfaces.InterfaceKeywords
18 | Resource | resources/libraries/robot/honeycomb/bridge_domain.robot
19 | Documentation | Keywords used to manipulate sub-interfaces.
20
21 *** Keywords ***
22 | Honeycomb creates sub-interface
23 | | [Documentation] | Create a sub-interface using Honeycomb API.
24 | | ...
25 | | ... | *Arguments:*
26 | | ... | - node - Information about a DUT node. Type: dictionary
27 | | ... | - super_interface - Super-interface where a sub-interface will be\
28 | | ... | created. Type: string
29 | | ... | - match - Match type. Type: string
30 | | ... | - tags - List of tags to be set while creating the sub-interface.\
31 | | ... | Type: list
32 | | ... | - sub_interface_settings - Sub-inteface parameters to be set while\
33 | | ... | creating the sub-interface. Type: dictionary
34 | | ...
35 | | ... | *Example:*
36 | | ... | \| Honeycomb creates sub-interface\
37 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0\
38 | | ... | \| vlan-tagged-exact-match \| ${sub_if_1_tags}\
39 | | ... | \| ${sub_if_1_settings} \|
40 | | ...
41 | | [Arguments] | ${node} | ${super_interface}
42 | | ... | ${match} | ${tags} | ${sub_interface_settings}
43 | | ...
44 | | Honeycomb Create sub interface | ${node} | ${super_interface}
45 | | ... | ${match} | ${tags} | &{sub_interface_settings}
46
47 | Sub-interface Operational Data From Honeycomb Should Be
48 | | [Documentation] | Retrieves sub-interface configuration through Honeycomb\
49 | | ... | and compares it with settings supplied in argument.
50 | | ...
51 | | ... | *Arguments:*
52 | | ... | - node - Information about a DUT node. Type: dictionary
53 | | ... | - super_interface - Super-interface. Type: string
54 | | ... | - identifier - Sub-interface ID. Type: integer or string
55 | | ... | - sub_if_settings - Operational data for sub-interface to be checked.\
56 | | ... | Type: dictionary
57 | | ...
58 | | ... | *Example:*
59 | | ... | \| Sub-interface Operational Data From Honeycomb Should Be\
60 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1\
61 | | ... | \| ${sub_if_1_params} \|
62 | | ...
63 | | [Arguments] | ${node} | ${super_interface} | ${identifier}
64 | | ... | ${sub_if_settings}
65 | | ...
66 | | ${api_data}= | Get sub interface oper data
67 | | ... | ${node} | ${super_interface} | ${identifier}
68 | | Compare Data Structures | ${api_data} | ${sub_if_settings}
69
70 | Sub-interface Operational Data From Honeycomb Should Be empty
71 | | [Documentation] | Retrieves sub-interface configuration through Honeycomb \
72 | | ... | and expects no data.
73 | | ...
74 | | ... | *Arguments:*
75 | | ... | - node - Information about a DUT node. Type: dictionary
76 | | ... | - super_interface - Super-interface. Type: string
77 | | ... | - identifier - Sub-interface ID. Type: integer or string
78 | | ...
79 | | ... | *Example:*
80 | | ... | \| Sub-interface Operational Data From Honeycomb Should Be empty\
81 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \|
82 | | ...
83 | | [Arguments] | ${node} | ${super_interface} | ${identifier}
84 | | ...
85 | | Run keyword and expect error | *KeyError: 'vpp-vlan:sub-interfaces'*
86 | | ... | Get sub interface oper data
87 | | ... | ${node} | ${super_interface} | ${identifier}
88
89 | Sub-interface state from Honeycomb should be
90 | | [Documentation] | Retrieves sub-interface configuration through Honeycomb \
91 | | ... | and checks the administrative and operational state.
92 | | ...
93 | | ... | *Arguments:*
94 | | ... | - node - Information about a DUT node. Type: dictionary
95 | | ... | - super_interface - Super-interface. Type: string
96 | | ... | - identifier - Sub-interface ID. Type: integer or string
97 | | ... | - admin_state - Required administrative state - up or down. \
98 | | ... | Type: string
99 | | ... | - oper_state - Required operational state - up or down. Type: string
100 | | ...
101 | | ... | *Example:*
102 | | ... | \| Sub-interface state from Honeycomb should be\
103 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \| up \| up \|
104 | | ...
105 | | [Arguments] | ${node} | ${super_interface} | ${identifier}
106 | | ... | ${admin_state} | ${oper_state}
107 | | ...
108 | | ${api_data}= | Get sub interface oper data
109 | | ... | ${node} | ${super_interface} | ${identifier}
110 | | Should be equal | ${api_data['admin-status']} | ${admin_state}
111 | | Should be equal | ${api_data['oper-status']} | ${oper_state}
112
113 | Sub-interface Operational Data From VAT Should Be
114 | | [Documentation] | Retrieves sub-interface configuration through VAT and\
115 | | ... | compares it with settings supplied in argument.
116 | | ...
117 | | ... | *Arguments:*
118 | | ... | - node - Information about a DUT node. Type: dictionary
119 | | ... | - sub_interface - Name of an sub-interface on the specified node.\
120 | | ... | Type: string
121 | | ... | - sub_interface_settings - Operational data specific for a\
122 | | ... | sub-interface to be checked. Type: dictionary
123 | | ...
124 | | ... | *Example:*
125 | | ... | \| Sub-interface Operational Data From VAT Should Be\
126 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0.1 \| ${sub_if_1_params} \|
127 | | ...
128 | | [Arguments] | ${node} | ${sub_interface} | ${sub_interface_settings}
129 | | ...
130 | | ${vat_data}= | VPP get interface data
131 | | ... | ${node} | ${sub_interface}
132 | | Should be equal as strings | ${vat_data['sub_id']}
133 | | ... | ${sub_interface_settings['identifier']}
134 | | Should be equal as strings
135 | | ... | ${vat_data['interface_name']} | ${sub_interface}
136 | | Run keyword if | ${vat_data['link_up_down']} == 0
137 | | ... | Should be equal as strings
138 | | ... | ${sub_interface_settings['oper-status']} | down
139 | | Run keyword if | ${vat_data['link_up_down']} == 1
140 | | ... | Should be equal as strings
141 | | ... | ${sub_interface_settings['oper-status']} | up
142
143 | Sub-interface state from VAT should be
144 | | [Documentation] | Retrieves sub-interface configuration through VAT and \
145 | | ... | checks the administrative and operational state.
146 | | ...
147 | | ... | *Arguments:*
148 | | ... | - node - Information about a DUT node. Type: dictionary
149 | | ... | - sub_interface - Name of an sub-interface on the specified node. \
150 | | ... | Type: string
151 | | ... | - admin_state - Required administrative state - up or down. \
152 | | ... | Type: string
153 | | ... | - oper_state - Required operational state - up or down. Type: string
154 | | ...
155 | | ... | *Example:*
156 | | ... | \| Sub-interface state from VAT should be \
157 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0.1 \| up \| up \|
158 | | ...
159 | | [Arguments] | ${node} | ${sub_interface} | ${admin_state} | ${oper_state}
160 | | ...
161 | | ${vat_data}= | VPP get interface data
162 | | ... | ${node} | ${sub_interface}
163 | | Run keyword if | '${admin_state}' == 'down'
164 | | ... | Should be equal as strings | ${vat_data['admin_up_down']} | 0
165 | | Run keyword if | '${admin_state}' == 'up'
166 | | ... | Should be equal as strings | ${vat_data['admin_up_down']} | 1
167 | | Run keyword if | '${oper_state}' == 'down'
168 | | ... | Should be equal as strings | ${vat_data['link_up_down']} | 0
169 | | Run keyword if | '${oper_state}' == 'up'
170 | | ... | Should be equal as strings | ${vat_data['link_up_down']} | 1
171
172 | Sub-interface indices from Honeycomb and VAT should correspond
173 | | [Documentation] | Uses VAT and Honeycomb to get operational data about the\
174 | | ... | given sub-interface and compares the interface indexes. The
175 | | ... | sub-interface index from Honeycomb should be greater than index from
176 | | ... | VAT by one.
177 | | ...
178 | | ... | *Arguments:*
179 | | ... | - node - Information about a DUT node. Type: dictionary
180 | | ... | - super_interface - Super-interface. Type: string
181 | | ... | - identifier - Sub-interface ID. Type: integer or string
182 | | ...
183 | | ... | *Example:*
184 | | ...
185 | | ... | \| Sub-interface indices from Honeycomb and VAT should correspond \
186 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \|
187 | | ...
188 | | [Arguments] | ${node} | ${super_interface} | ${identifier}
189 | | ...
190 | | ${api_data}= | Get sub interface oper data
191 | | ... | ${node} | ${super_interface} | ${identifier}
192 | | ${vat_data}= | VPP get interface data
193 | | ... | ${node} | ${super_interface}.${identifier}
194 | | ${sw_if_index}= | EVALUATE | ${vat_data['sw_if_index']} + 1
195 | | Should be equal as strings
196 | | ... | ${api_data['if-index']} | ${sw_if_index}
197
198 | Honeycomb sets the sub-interface up
199 | | [Documentation] | Honeycomb sets the sub-interface up.
200 | | ...
201 | | ... | *Arguments:*
202 | | ... | - node - Information about a DUT node. Type: dictionary
203 | | ... | - super_interface - Super-interface. Type: string
204 | | ... | - identifier - Sub-interface ID. Type: integer or string
205 | | ...
206 | | ... | *Example:*
207 | | ... | Honeycomb sets the sub-interface up\
208 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \|
209 | | ...
210 | | [Arguments] | ${node} | ${super_interface} | ${identifier}
211 | | ...
212 | | Set sub interface state
213 | | ... | ${node} | ${super_interface} | ${identifier} | up
214
215 | Honeycomb sets the sub-interface down
216 | | [Documentation] | Honeycomb sets the sub-interface down.
217 | | ...
218 | | ... | *Arguments:*
219 | | ... | - node - Information about a DUT node. Type: dictionary
220 | | ... | - super_interface - Super-interface. Type: string
221 | | ... | - identifier - Sub-interface ID. Type: integer or string
222 | | ...
223 | | ... | *Example:*
224 | | ... | Honeycomb sets the sub-interface down\
225 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \|
226 | | ...
227 | | [Arguments] | ${node} | ${super_interface} | ${identifier}
228 | | ...
229 | | Set sub interface state
230 | | ... | ${node} | ${super_interface} | ${identifier} | down
231
232 | Honeycomb fails to set sub-interface up
233 | | [Documentation] | Honeycomb tries to set sub-interface up and expects error.
234 | | ...
235 | | ... | *Arguments:*
236 | | ... | - node - Information about a DUT node. Type: dictionary
237 | | ... | - super_interface - Super-interface. Type: string
238 | | ... | - identifier - Sub-interface ID. Type: integer or string
239 | | ...
240 | | ... | *Example:*
241 | | ... | \| Honeycomb fails to set sub-interface up\
242 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \|
243 | | ...
244 | | [Arguments] | ${node} | ${super_interface} | ${identifier}
245 | | ...
246 | | Run keyword and expect error | *HoneycombError: * was not successful. * 500.
247 | | ... | Set sub interface state
248 | | ... | ${node} | ${super_interface} | ${identifier} | up
249
250 | Honeycomb adds sub-interface to bridge domain
251 | | [Documentation] | Honeycomb adds the given sub-interface to bridge domain.
252 | | ...
253 | | ... | *Arguments:*
254 | | ... | - node - Information about a DUT node. Type: dictionary
255 | | ... | - super_if - Super-interface. Type: string
256 | | ... | - identifier - Sub-interface ID. Type: integer or string
257 | | ... | - sub_bd_setings - Bridge domain parameters to be set while adding\
258 | | ... | the sub-interface to the bridge domain. Type: dictionary
259 | | ...
260 | | ... | *Example:*
261 | | ... | \| Honeycomb adds sub-interface to bridge domain\
262 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \| ${bd_settings} \|
263 | | ...
264 | | [Arguments] | ${node} | ${super_if} | ${identifier} | ${sub_bd_setings}
265 | | ...
266 | | Add bridge domain to sub interface
267 | | ... | ${node} | ${super_if} | ${identifier} | ${sub_bd_setings}
268
269 | Sub-interface bridge domain Operational Data From Honeycomb Should Be
270 | | [Documentation] | Uses Honeycomb API to verify sub-interface assignment to\
271 | | ... | a bridge domain.
272 | | ...
273 | | ... | *Arguments:*
274 | | ... | - node - Information about a DUT node. Type: dictionary
275 | | ... | - super_if - Super-interface. Type: string
276 | | ... | - identifier - Sub-interface ID. Type: integer or string
277 | | ... | - settings - Bridge domain parameters to be checked. Type: dictionary
278 | | ...
279 | | ... | *Example:*
280 | | ... | \| Sub-interface bridge domain Operational Data From Honeycomb Should Be\
281 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \| ${bd_settings} \|
282 | | ...
283 | | [Arguments] | ${node} | ${super_if} | ${identifier} | ${settings}
284 | | ...
285 | | ${if_data}= | Get BD data from sub interface
286 | | ... | ${node} | ${super_if} | ${identifier}
287 | | Should be equal | ${if_data['bridge-domain']}
288 | | ... | ${settings['bridge-domain']}
289
290 | Sub-interface bridge domain Operational Data From VAT Should Be
291 | | [Documentation] | Uses VAT to verify sub-interface assignment to a bridge\
292 | | ... | domain.
293 | | ...
294 | | ... | *Arguments:*
295 | | ... | - node - Information about a DUT node. Type: dictionary
296 | | ... | - interface - Name of a sub-interface on the specified node. Type:\
297 | | ... | string
298 | | ... | - setings - Parameters to be checked. Type: dictionary
299 | | ...
300 | | ... | *Example:*
301 | | ... | \| Sub-interface bridge domain Operational Data From VAT Should Be\
302 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0.1 \| ${sub_bd_setings} \|
303 | | ...
304 | | [Arguments] | ${node} | ${interface} | ${settings}
305 | | ...
306 | | ${bd_data}= | VPP get bridge domain data | ${node}
307 | | ${bd_intf}= | Set Variable | ${bd_data[0]}
308 | | ${sw_if_data}= | Set Variable | ${bd_intf['sw_if'][0]}
309 | | Should be equal as integers | ${bd_intf['flood']} | ${bd_settings['flood']}
310 | | Should be equal as integers | ${bd_intf['forward']}
311 | | ... | ${bd_settings['forward']}
312 | | Should be equal as integers | ${bd_intf['learn']} | ${bd_settings['learn']}
313 | | Should be equal as strings | ${sw_if_data['shg']}
314 | | ... | ${settings['split-horizon-group']}
315
316 | Honeycomb fails to remove all sub-interfaces
317 | | [Documentation] | Honeycomb tries to remove all sub-interfaces using\
318 | | ... | Honeycomb API. This operation must fail.
319 | | ...
320 | | ... | *Arguments:*
321 | | ... | - node - Information about a DUT node. Type: dictionary
322 | | ... | - super_if - Super-interface. Type: string
323 | | ...
324 | | ... | *Example:*
325 | | ... | \| Honeycomb fails to remove all sub-interfaces\
326 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \|
327 | | ...
328 | | [Arguments] | ${node} | ${super_if}
329 | | ...
330 | | Run keyword and expect error | *HoneycombError:*not successful. * code: 500.
331 | | ... | Remove all sub interfaces
332 | | ... | ${node} | ${super_if}
333
334 | Honeycomb configures tag rewrite
335 | | [Documentation] | Honeycomb configures tag-rewrite
336 | | ...
337 | | ... | *Arguments:*
338 | | ... | - node - Information about a DUT node. Type: dictionary
339 | | ... | - super_if - Super-interface. Type: string
340 | | ... | - identifier - Sub-interface ID. Type: integer or string
341 | | ... | - settings - tag-rewrite parameters. Type: dictionary.
342 | | ...
343 | | ... | *Example:*
344 | | ... | \| Honeycomb configures tag rewrite\
345 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1\
346 | | ... | \| ${tag_rewrite_push} \|
347 | | ...
348 | | [Arguments] | ${node} | ${super_if} | ${identifier} | ${settings}
349 | | ...
350 | | Configure tag rewrite
351 | | ... | ${node} | ${super_if} | ${identifier} | ${settings}
352
353 | Rewrite tag from Honeycomb should be empty
354 | | [Documentation] | Checks if the tag-rewrite is empty or does not exist.
355 | | ...
356 | | ... | *Arguments:*
357 | | ... | - node - Information about a DUT node. Type: dictionary
358 | | ... | - super_if - Super-interface. Type: string
359 | | ... | - identifier - Sub-interface ID. Type: integer or string
360 | | ...
361 | | ... | *Example:*
362 | | ... | \| Rewrite tag from Honeycomb should be empty\
363 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1 \|
364 | | ...
365 | | [Arguments] | ${node} | ${super_if} | ${identifier}
366 | | ...
367 | | Run keyword and expect error | *Hon*Error*oper*does not contain*tag-rewrite*
368 | | ... | Get tag rewrite oper data
369 | | ... | ${node} | ${super_if} | ${identifier}
370
371 | Rewrite tag from Honeycomb should be
372 | | [Documentation] | Checks if the operational data retrieved from Honeycomb\
373 | | ... | are as expected.
374 | | ...
375 | | ... | *Arguments:*
376 | | ... | - node - Information about a DUT node. Type: dictionary
377 | | ... | - super_if - Super-interface. Type: string
378 | | ... | - identifier - Sub-interface ID. Type: integer or string
379 | | ... | - settings - tag-rewrite operational parameters to be checked.\
380 | | ... | Type: dictionary.
381 | | ...
382 | | ... | *Example:*
383 | | ... | \| Rewrite tag from Honeycomb should be\
384 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1\
385 | | ... | \| ${tag_rewrite_push_oper} \|
386 | | ...
387 | | [Arguments] | ${node} | ${super_if} | ${identifier} | ${settings}
388 | | ${api_data}= | Get tag rewrite oper data
389 | | ... | ${node} | ${super_if} | ${identifier}
390 | | Compare Data Structures
391 | | ... | ${api_data} | ${settings}
392
393 | Rewrite tag from VAT should be
394 | | [Documentation] | Retrieves sub-interface configuration through VAT and\
395 | | ... | compares values of rewrite tag parameters with settings supplied in\
396 | | ... | argument.
397 | | ...
398 | | ... | *Arguments:*
399 | | ... | - node - information about a DUT node. Type: dictionary
400 | | ... | - interface - name of a sub-interface on the specified node.\
401 | | ... | Type: string
402 | | ... | - rw_settings - Parameters to be set while setting the rewrite tag.\
403 | | ... | Type: dictionary
404 | | ...
405 | | ... | *Example:*
406 | | ... | \| Rewrite tag from VAT should be\
407 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0.1 \| ${rw_params} \|
408 | | ...
409 | | [Arguments] | ${node} | ${interface} | ${rw_settings}
410 | | ${vat_data}= | VPP get interface data | ${node} | ${interface}
411 | | Compare Data Structures | ${vat_data} | ${rw_settings}
412
413 | Honeycomb fails to set wrong rewrite tag
414 | | [Documentation] | Honeycomb tries to set wrong rewrite tag and expects\
415 | | ... | an error.
416 | | ...
417 | | ... | *Arguments:*
418 | | ... | - node - Information about a DUT node. Type: dictionary
419 | | ... | - super_if - Super-interface. Type: string
420 | | ... | - identifier - Sub-interface ID. Type: integer or string
421 | | ... | - settings - tag-rewrite parameters. Type: dictionary.
422 | | ...
423 | | ... | *Example:*
424 | | ... | \| Honeycomb fails to set wrong rewrite tag\
425 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 1\
426 | | ... | \| ${tag_rewrite_push_WRONG} \|
427 | | ...
428 | | [Arguments] | ${node} | ${super_if} | ${identifier} | ${settings}
429 | | Run keyword and expect error | *HoneycombError: * was not successful. *00.
430 | | ... | Configure tag rewrite
431 | | ... | ${node} | ${super_if} | ${identifier} | ${settings}
432
433 | Honeycomb sets sub-interface ipv4 address
434 | | [Documentation] | Uses Honeycomb API to configure an ipv4 address on the\
435 | | ... | spcified sub-interface. Replaces any existing ipv4 addresses.
436 | | ...
437 | | ... | *Arguments:*
438 | | ... | - node - Information about a DUT node. Type: dictionary
439 | | ... | - super_if - Super-interface. Type: string
440 | | ... | - identifier - Sub-interface ID. Type: integer or string
441 | | ... | - address - IPv4 address to set. Type: string
442 | | ... | - prefix - IPv4 network prefix length to set. Type: integer
443 | | ...
444 | | ... | *Example:*
445 | | ... | \| | Honeycomb sets sub-interface ipv4 address\
446 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \
447 | | ... | \| 192.168.0.2 \| ${24} \|
448 | | ...
449 | | [Arguments] | ${node} | ${super_if} | ${identifier} | ${address} | ${prefix}
450 | | Add ip address to sub_interface
451 | | ... | ${node} | ${super_if} | ${identifier} | ${address} | ${prefix} | ipv4
452
453 | Sub-interface ipv4 address from Honeycomb should be
454 | | [Documentation] | Uses Honeycomb API to verify ipv4 address configuration\
455 | | ... | on the specified sub-interface.
456 | | ...
457 | | ... | *Arguments:*
458 | | ... | - node - Information about a DUT node. Type: dictionary
459 | | ... | - super_if - Super-interface. Type: string
460 | | ... | - identifier - Sub-interface ID. Type: integer or string
461 | | ... | - address - IPv4 address to expect. Type: string
462 | | ... | - prefix - IPv4 network prefix length to expect. Type: integer
463 | | ...
464 | | ... | *Example:*
465 | | ... | \| sub-interface ipv4 address from Honeycomb should be\
466 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \
467 | | ... | \| 192.168.0.2 \| ${24} \|
468 | | ...
469 | | [Arguments] | ${node} | ${super_if} | ${identifier} | ${address} | ${prefix}
470 | | ${if_data}= | Get sub interface oper data
471 | | ... | ${node} | ${super_if} | ${identifier}
472 | | Should be equal
473 | | ... | ${if_data['ipv4']['address'][0]['ip']} | ${address}
474 | | Should be equal
475 | | ... | ${if_data['ipv4']['address'][0]['prefix-length']} | ${prefix}
476
477 | Sub-interface ipv4 address from VAT should be
478 | | [Documentation] | Uses VAT to verify ipv4 address configuration\
479 | | ... | on the specified sub-interface.
480 | | ...
481 | | ... | *Arguments:*
482 | | ... | - node - Information about a DUT node. Type: dictionary
483 | | ... | - sub_interface - Name of an sub-interface on the specified node.\
484 | | ... | Type: string
485 | | ... | - address - IPv4 address to expect. Type: string
486 | | ... | - prefix - IPv4 network prefix length to expect. Type: integer
487 | | ...
488 | | ... | *Example:*
489 | | ... | \| sub-interface ipv4 address from VAT should be\
490 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0.1 \|
491 | | ...
492 | | [Arguments] | ${node} | ${sub_interface} | ${address} | ${prefix}
493 | | ${data}= | VPP get interface ip addresses
494 | | ... | ${node} | ${sub_interface} | ipv4
495 | | Should be equal | ${data[0]['ip']} | ${address}
496 | | Should be equal | ${data[0]['prefix_length']} | ${prefix}
497
498 | Honeycomb removes all sub-interface ipv4 addresses
499 | | [Documentation] | Uses Honeycomb API to remove all configured ipv4\
500 | | ... | addresses from the sub-interface.
501 | | ...
502 | | ... | *Arguments:*
503 | | ... | - node - Information about a DUT node. Type: dictionary
504 | | ... | - super_if - Super-interface. Type: string
505 | | ... | - identifier - Sub-interface ID. Type: integer or string
506 | | ...
507 | | ... | *Example:*
508 | | ... | \| Honeycomb removes all sub-interface ipv4 addresses\
509 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \|
510 | | ...
511 | | [Arguments] | ${node} | ${super_if} | ${identifier}
512 | | Remove all ip addresses from sub_interface
513 | | ... | ${node} | ${super_if} | ${identifier} | ipv4
514
515 | Sub-interface ipv4 address from Honeycomb should be empty
516 | | [Documentation] | Uses Honeycomb API to verify that ipv4 address\
517 | | ... | configuration on the specified sub-interface is empty.
518 | | ...
519 | | ... | *Arguments:*
520 | | ... | - node - Information about a DUT node. Type: dictionary
521 | | ... | - super_if - Super-interface. Type: string
522 | | ... | - identifier - Sub-interface ID. Type: integer or string
523 | | ...
524 | | ... | *Example:*
525 | | ... | \| sub-interface ipv4 address from Honeycomb should be empty\
526 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \|
527 | | ...
528 | | [Arguments] | ${node} | ${super_if} | ${identifier}
529 | | ${if_data}= | Get sub interface oper data
530 | | ... | ${node} | ${super_if} | ${identifier}
531 | | Run keyword and expect error | *KeyError: 'ipv4'*
532 | | ... | Set Variable | ${if_data['ipv4']['address'][0]['ip']}
533
534 | Sub-interface ipv4 address from VAT should be empty
535 | | [Documentation] | Uses VAT to verify that ipv4 address\
536 | | ... | configuration on the specified sub-interface is empty.
537 | | ...
538 | | ... | *Arguments:*
539 | | ... | - node - Information about a DUT node. Type: dictionary
540 | | ... | - sub_interface - Name of an sub-interface on the specified node.\
541 | | ... | Type: string
542 | | ...
543 | | ... | *Example:*
544 | | ... | \| sub-interface ipv4 address from VAT should be empty\
545 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0.1 \|
546 | | ...
547 | | [Arguments] | ${node} | ${sub_interface}
548 | | Run keyword and expect error | *No JSON object could be decoded*
549 | | ... | VPP get interface ip addresses
550 | | ... | ${node} | ${sub_interface} | ipv4
551
552 | Honeycomb sets sub-interface ipv6 address
553 | | [Documentation] | Uses Honeycomb API to configure an ipv6 address on the\
554 | | ... | spcified sub-interface. Replaces any existing ipv6 addresses.
555 | | ...
556 | | ... | *Arguments:*
557 | | ... | - node - Information about a DUT node. Type: dictionary
558 | | ... | - super_if - Super-interface. Type: string
559 | | ... | - identifier - Sub-interface ID. Type: integer or string
560 | | ... | - address - IPv6 address to set. Type: string
561 | | ... | - prefix - IPv6 network prefix length to set. Type: integer
562 | | ...
563 | | ... | *Example:*
564 | | ... | \| | Honeycomb sets sub-interface ipv6 address\
565 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \
566 | | ... | \| 10::10 \| ${64} \|
567 | | ...
568 | | [Arguments] | ${node} | ${super_if} | ${identifier} | ${address} | ${prefix}
569 | | Add ip address to sub_interface
570 | | ... | ${node} | ${super_if} | ${identifier} | ${address} | ${prefix} | ipv6
571
572 | Sub-interface IPv6 address from Honeycomb should contain
573 | | [Documentation] | Uses Honeycomb API to verify ipv6 address configuration\
574 | | ... | on the specified sub-interface.
575 | | ...
576 | | ... | *Arguments:*
577 | | ... | - node - Information about a DUT node. Type: dictionary
578 | | ... | - super_if - Super-interface. Type: string
579 | | ... | - identifier - Sub-interface ID. Type: integer or string
580 | | ... | - address - IPv6 address to expect. Type: string
581 | | ... | - prefix - IPv6 network prefix length to expect. Type: integer
582 | | ...
583 | | ... | *Example:*
584 | | ... | \| sub-interface IPv6 address from Honeycomb should contain\
585 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \
586 | | ... | \| 10::10 \| ${64} \|
587 | | ...
588 | | [Arguments] | ${node} | ${super_if} | ${identifier} | ${address} | ${prefix}
589 | | ${if_data}= | Get sub interface oper data
590 | | ... | ${node} | ${super_if} | ${identifier}
591 | | ${settings}= | Create Dictionary
592 | | ... | ip=${address} | prefix-length=${prefix}
593 | | Should contain | ${if_data['ipv6']['address']} | ${settings}
594
595 | Sub-interface IPv6 address from VAT should contain
596 | | [Documentation] | Uses VAT to verify ipv6 address configuration\
597 | | ... | on the specified sub-interface.
598 | | ...
599 | | ... | *Arguments:*
600 | | ... | - node - Information about a DUT node. Type: dictionary
601 | | ... | - sub_interface - Name of an sub-interface on the specified node.\
602 | | ... | Type: string
603 | | ... | - address - IPv6 address to expect. Type: string
604 | | ... | - prefix - IPv6 network prefix length to expect. Type: integer
605 | | ...
606 | | ... | *Example:*
607 | | ... | \| sub-interface IPv6 address from VAT should contain\
608 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0.1 \|
609 | | ...
610 | | [Arguments] | ${node} | ${sub_interface} | ${address} | ${prefix}
611 | | ${data}= | VPP get interface ip addresses
612 | | ... | ${node} | ${sub_interface} | ipv6
613 | | Should be equal | ${data[0]['ip']} | ${address}
614 | | Should be equal | ${data[0]['prefix_length']} | ${prefix}
615
616 | Honeycomb removes all sub-interface ipv6 addresses
617 | | [Documentation] | Uses Honeycomb API to remove all configured ipv6\
618 | | ... | addresses from the sub-interface.
619 | | ...
620 | | ... | *Arguments:*
621 | | ... | - node - Information about a DUT node. Type: dictionary
622 | | ... | - super_if - Super-interface. Type: string
623 | | ... | - identifier - Sub-interface ID. Type: integer or string
624 | | ...
625 | | ... | *Example:*
626 | | ... | \| Honeycomb removes all sub-interface ipv6 addresses\
627 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \|
628 | | ...
629 | | [Arguments] | ${node} | ${super_if} | ${identifier}
630 | | Remove all ip addresses from sub_interface
631 | | ... | ${node} | ${super_if} | ${identifier} | ipv6
632
633 | Sub-interface ipv6 address from Honeycomb should be empty
634 | | [Documentation] | Uses Honeycomb API to verify that ipv6 address\
635 | | ... | configuration on the specified sub-interface is empty.
636 | | ...
637 | | ... | *Arguments:*
638 | | ... | - node - Information about a DUT node. Type: dictionary
639 | | ... | - super_if - Super-interface. Type: string
640 | | ... | - identifier - Sub-interface ID. Type: integer or string
641 | | ...
642 | | ... | *Example:*
643 | | ... | \| sub-interface ipv6 address from Honeycomb should be empty\
644 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \|
645 | | ...
646 | | [Arguments] | ${node} | ${super_if} | ${identifier}
647 | | ${if_data}= | Get sub interface oper data
648 | | ... | ${node} | ${super_if} | ${identifier}
649 | | Run keyword and expect error | *KeyError: 'ipv6'*
650 | | ... | Set Variable | ${if_data['ipv6']['address'][0]['ip']}
651
652 | Sub-interface ipv6 address from VAT should be empty
653 | | [Documentation] | Uses VAT to verify that ipv6 address\
654 | | ... | configuration on the specified sub-interface is empty.
655 | | ...
656 | | ... | *Arguments:*
657 | | ... | - node - Information about a DUT node. Type: dictionary
658 | | ... | - sub_interface - Name of an sub-interface on the specified node.\
659 | | ... | Type: string
660 | | ...
661 | | ... | *Example:*
662 | | ... | \| sub-interface ipv6 address from VAT should be empty\
663 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0.1 \|
664 | | ...
665 | | [Arguments] | ${node} | ${sub_interface}
666 | | Run keyword and expect error | *No JSON object could be decoded*
667 | | ... | VPP get interface ip addresses
668 | | ... | ${node} | ${sub_interface} | ipv6