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