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