cb4f6187e9fa0726fa22b464da7a9c9d1a184d9b
[csit.git] / resources / libraries / robot / honeycomb / interfaces.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.honeycomb.HcAPIKwInterfaces.InterfaceKeywords
18 | ...     | WITH NAME | InterfaceAPI
19 | Library | resources.libraries.python.IPv4Util
20 | Library | resources.libraries.python.TrafficScriptExecutor
21
22 *** Keywords ***
23 | Honeycomb sets interface state
24 | | [Documentation] | Uses Honeycomb API to change the admin state\
25 | | ... | of the specified interface.
26 | | ...
27 | | ... | *Arguments:*
28 | | ... | - node - information about a DUT node. Type: dictionary
29 | | ... | - interface - name of an interface on the specified node. Type: string
30 | | ... | - state - state to set on interface. Type:string
31 | | ...
32 | | ... | *Example:*
33 | | ...
34 | | ... | \| Honeycomb sets interface state \| ${nodes['DUT1']} \
35 | | ... | \| GigabitEthernet0/8/0 \| up \|
36 | | [Arguments] | ${node} | ${interface} | ${state}
37 | | interfaceAPI.Set interface state | ${node} | ${interface} | ${state}
38
39 | Interface state from Honeycomb should be
40 | | [Documentation] | Retrieves interface admin state through Honeycomb and\
41 | | ... | compares with state supplied in argument.
42 | | ...
43 | | ... | *Arguments:*
44 | | ... | - node - information about a DUT node. Type: dictionary
45 | | ... | - interface - name of an interface on the specified node. Type: string
46 | | ... | - state - expected interface state. Type: string
47 | | ...
48 | | ... | *Example:*
49 | | ...
50 | | ... | \| Interface state from Honeycomb should be \| ${nodes['DUT1']} \
51 | | ... | \| GigabitEthernet0/8/0 \| up \|
52 | | [Arguments] | ${node} | ${interface} | ${state}
53 | | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface}
54 | | ${api_state}= | Set Variable | ${api_data['admin-status']}
55 | | Should be equal | ${api_state} | ${state}
56
57 | Interface state from VAT should be
58 | | [Documentation] | Retrieves interface admin state through VAT and compares\
59 | | ... | with state supplied in argument.
60 | | ...
61 | | ... | *Arguments:*
62 | | ... | - node - information about a DUT node. Type: dictionary
63 | | ... | - interface - name of an interface on the specified node. Type: string
64 | | ... | - state - expected interface state. Type: string
65 | | ...
66 | | ... | _NOTE:_ Vat returns state as int (1/0) instead of string (up/down).
67 | | ... | This keyword also handles translation.
68 | | ...
69 | | ... | *Example:*
70 | | ...
71 | | ... | \| Interface state from VAT should be \| ${nodes['DUT1']} \
72 | | ... | \| GigabitEthernet0/8/0 \| up \|
73 | | [Arguments] | ${node} | ${interface} | ${state}
74 | | ${vat_data}= | InterfaceCLI.VPP get interface data | ${node} | ${interface}
75 | | ${vat_state}= | Set Variable if
76 | | ... | ${vat_data['admin_up_down']} == 1 | up | down
77 | | Should be equal | ${vat_state} | ${state}
78
79 | Honeycomb sets interface ipv4 address
80 | | [Documentation] | Uses Honeycomb API to change ipv4 address\
81 | | ... | of the specified interface. Any existing addresses will be removed.
82 | | ...
83 | | ... | *Arguments:*
84 | | ... | - node - information about a DUT node. Type: dictionary
85 | | ... | - interface - name of an interface on the specified node. Type: string
86 | | ... | - address - IP address to set. Type: string
87 | | ... | - netmask - subnet mask to set. Type: string
88 | | ...
89 | | ... | *Example:*
90 | | ...
91 | | ... | \| Honeycomb sets interface ipv4 address \| ${nodes['DUT1']} \
92 | | ... | \| GigabitEthernet0/8/0 \| 192.168.0.2 \| 255.255.255.0 \|
93 | | [Arguments] | ${node} | ${interface} | ${address} | ${netmask}
94 | | interfaceAPI.Add first ipv4 address
95 | | ... | ${node} | ${interface} | ${address} | ${netmask}
96
97 | Honeycomb sets interface ipv4 address with prefix
98 | | [Documentation] | Uses Honeycomb API to assign an ipv4 address to the\
99 | | ... | specified interface. Any existing addresses will be removed.
100 | | ...
101 | | ... | *Arguments:*
102 | | ... | - node - information about a DUT node. Type: dictionary
103 | | ... | - interface - name of an interface on the specified node. Type: string
104 | | ... | - address - IP address to set. Type: string
105 | | ... | - prefix - length of address network prefix. Type: integer
106 | | ...
107 | | ... | *Example:*
108 | | ...
109 | | ... | \| Honeycomb sets interface ipv4 address with prefix \
110 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 192.168.0.2 \| 24 \|
111 | | [Arguments] | ${node} | ${interface} | ${address} | ${prefix}
112 | | interfaceAPI.Add first ipv4 address
113 | | ... | ${node} | ${interface} | ${address} | ${prefix}
114
115 | Honeycomb adds interface ipv4 address
116 | | [Documentation] | Uses Honeycomb API to add an ipv4 address to the\
117 | | ... | specified interface, without removing existing addresses.
118 | | ...
119 | | ... | *Arguments:*
120 | | ... | - node - information about a DUT node. Type: dictionary
121 | | ... | - interface - name of an interface on the specified node. Type: string
122 | | ... | - address - IP address to set. Type: string
123 | | ... | - prefix - length of address network prefix. Type: integer
124 | | ...
125 | | ... | *Example:*
126 | | ...
127 | | ... | \| Honeycomb adds interface ipv4 address \
128 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 192.168.0.2 \| 24 \|
129 | | [Arguments] | ${node} | ${interface} | ${address} | ${prefix}
130 | | interfaceAPI.Add ipv4 address
131 | | ... | ${node} | ${interface} | ${address} | ${prefix}
132
133 | Honeycomb fails to add interface ipv4 address
134 | | [Documentation] | Uses Honeycomb API to add an ipv4 address to the\
135 | | ... | specified interface, and expects to fail with code 500.
136 | | ...
137 | | ... | *Arguments:*
138 | | ... | - node - information about a DUT node. Type: dictionary
139 | | ... | - interface - name of an interface on the specified node. Type: string
140 | | ... | - address - IP address to set. Type: string
141 | | ... | - prefix - length of address network prefix. Type: integer
142 | | ...
143 | | ... | *Example:*
144 | | ...
145 | | ... | \| Honeycomb fails to add interface ipv4 address \
146 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 192.168.0.2 \| 24 \|
147 | | [Arguments] | ${node} | ${interface} | ${address} | ${prefix}
148 | | Run Keyword and Expect Error | *not successful. Status code: 500.
149 | | ... | Honeycomb adds interface ipv4 address
150 | | ... | ${node} | ${interface} | ${address} | ${prefix}
151
152 | IPv4 address from Honeycomb should be
153 | | [Documentation] | Retrieves interface ipv4 address through Honeycomb\
154 | | ... | and compares with state supplied in argument.
155 | | ...
156 | | ... | *Arguments:*
157 | | ... | - node - information about a DUT node. Type: dictionary
158 | | ... | - interface - name of an interface on the specified node. Type: string
159 | | ... | - address - IP address to expect. Type: string
160 | | ... | - prefix - prefix length to expect. Type: string
161 | | ...
162 | | ... | *Example:*
163 | | ...
164 | | ... | \| IPv4 address from Honeycomb should be \| ${nodes['DUT1']} \
165 | | ... | \| GigabitEthernet0/8/0 \| 192.168.0.2 \| ${24} \|
166 | | [Arguments] | ${node} | ${interface} | ${address} | ${prefix}
167 | | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface}
168 | | ${settings}= | Create Dictionary
169 | | ... | ip=${address} | prefix-length=${prefix}
170 | | Should contain | ${api_data['ietf-ip:ipv4']['address']} | ${settings}
171
172 | IPv4 address from VAT should be
173 | | [Documentation] | Retrieves interface ipv4 address through VAT and\
174 | | ... | compares with state supplied in argument.
175 | | ...
176 | | ... | *Arguments:*
177 | | ... | - node - information about a DUT node. Type: dictionary
178 | | ... | - interface - name of an interface on the specified node. Type: string
179 | | ... | - address - IP address to expect. Type: string
180 | | ... | - prefix - prefix length to expect. Type: string
181 | | ... | - netmask - subnet mask to expect. Type: string
182 | | ...
183 | | ... | *Example:*
184 | | ...
185 | | ... | \| IPv4 address from VAT should be \| ${nodes['DUT1']} \
186 | | ... | \| GigabitEthernet0/8/0 \| 192.168.0.2 \| ${24} \| 255.255.255.0 \|
187 | | [Arguments] | ${node} | ${interface} | ${address} | ${prefix} | ${netmask}
188 | | ${vpp_data}= | interfaceCLI.VPP get interface ip addresses
189 | | ... | ${node} | ${interface} | ipv4
190 | | ${settings}= | Create Dictionary
191 | | ... | ip=${address} | netmask=${netmask} | prefix_length=${prefix}
192 | | Should contain | ${vpp_data} | ${settings}
193
194 | Honeycomb removes interface ipv4 addresses
195 | | [Documentation] | Removes all configured ipv4 addresses from the specified\
196 | | ... | interface.
197 | | ...
198 | | ... | *Arguments:*
199 | | ... | - node - information about a DUT node. Type: dictionary
200 | | ... | - interface - name of an interface on the specified node. Type: string
201 | | ...
202 | | ... | *Example:*
203 | | ...
204 | | ... | \| Honeycomb removes interface ipv4 addresses \| ${nodes['DUT1']} \
205 | | ... | \| GigabitEthernet0/8/0 \|
206 | | [Arguments] | ${node} | ${interface}
207 | | Remove all ipv4 addresses | ${node} | ${interface}
208
209 | IPv4 address from Honeycomb should be empty
210 | | [Documentation] | Retrieves interface ipv4 configuration through Honeycomb\
211 | | ... | and expects to find no IPv4 addresses.
212 | | ...
213 | | ... | *Arguments:*
214 | | ... | - node - information about a DUT node. Type: dictionary
215 | | ... | - interface - name of an interface on the specified node. Type: string
216 | | ...
217 | | ... | *Example:*
218 | | ...
219 | | ... | \| IPv4 address from Honeycomb should be empty\| ${nodes['DUT1']} \
220 | | ... | \| GigabitEthernet0/8/0 \|
221 | | [Arguments] | ${node} | ${interface}
222 | | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface}
223 | | Run keyword and expect error | *KeyError:*
224 | | ... | Set Variable | ${api_data['ietf-ip:ipv4']['address']}
225
226 | IPv4 address from VAT should be empty
227 | | [Documentation] | Retrieves interface ipv4 configuration through VAT and\
228 | | ... | and expects to find no ipv4 addresses.
229 | | ...
230 | | ... | *Arguments:*
231 | | ... | - node - information about a DUT node. Type: dictionary
232 | | ... | - interface - name of an interface on the specified node. Type: string
233 | | ...
234 | | ... | *Example:*
235 | | ...
236 | | ... | \| IPv4 config from VAT should be empty \| ${nodes['DUT1']} \
237 | | ... | \| GigabitEthernet0/8/0 \|
238 | | [Arguments] | ${node} | ${interface}
239 | | Run keyword and expect error | *No JSON object could be decoded*
240 | | ... | InterfaceCLI.VPP get interface ip addresses
241 | | ... | ${node} | ${interface} | ipv4
242
243 | Honeycomb adds interface ipv4 neighbor
244 | | [Documentation] | Uses Honeycomb API to assign an ipv4 neighbor to the\
245 | | ... | specified interface.
246 | | ...
247 | | ... | *Arguments:*
248 | | ... | - node - information about a DUT node. Type: dictionary
249 | | ... | - interface - name of an interface on the specified node. Type: string
250 | | ... | - fib_address - IP address to add to fib table. Type: string
251 | | ... | - fib_mac - MAC address to add to fib table. Type: string
252 | | ...
253 | | ... | *Example:*
254 | | ...
255 | | ... | \| Honeycomb adds interface ipv4 neighbor \| ${nodes['DUT1']} \
256 | | ... | \| GigabitEthernet0/8/0 \| 192.168.0.3 \| 08:00:27:c0:5d:37 \
257 | | [Arguments] | ${node} | ${interface} | ${fib_address} | ${fib_mac}
258 | | interfaceAPI.Add ipv4 neighbor
259 | | ... | ${node} | ${interface} | ${fib_address} | ${fib_mac}
260
261 | IPv4 neighbor from Honeycomb should be
262 | | [Documentation] | Retrieves ipv4 neighbor list through Honeycomb\
263 | | ... | and checks if it contains address supplied in arguments.
264 | | ...
265 | | ... | *Arguments:*
266 | | ... | - node - information about a DUT node. Type: dictionary
267 | | ... | - interface - name of an interface on the specified node. Type: string
268 | | ... | - ip_address - ipv4 address of expected neighbor entry. Type: string
269 | | ... | - mac_address - MAC address of expected neighbor entry. Type: string
270 | | ...
271 | | ... | *Example:*
272 | | ...
273 | | ... | \| IPv4 neighbor from Honeycomb should be \| ${nodes['DUT1']} \
274 | | ... | \| GigabitEthernet0/8/0 \| 192.168.0.4 \| 08:00:27:60:26:ab \|
275 | | [Arguments] | ${node} | ${interface} | ${ip_address} | ${mac_address}
276 | | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface}
277 | | ${settings}= | Create Dictionary
278 | | ... | ip=${ip_address} | link-layer-address=${mac_address} | origin=static
279 | | Should contain | ${api_data['ietf-ip:ipv4']['neighbor']} | ${settings}
280
281 | Honeycomb clears all interface ipv4 neighbors
282 | | [Documentation] | Uses Honeycomb API to remove all ipv4 neighbors from the\
283 | | ... | specified interface.
284 | | ...
285 | | ... | *Arguments:*
286 | | ... | - node - information about a DUT node. Type: dictionary
287 | | ... | - interface - name of an interface on the specified node. Type: string
288 | | ...
289 | | ... | *Example:*
290 | | ...
291 | | ... | \| Honeycomb clears all interface ipv4 neighbors \| ${nodes['DUT1']} \
292 | | ... | \| GigabitEthernet0/8/0 \|
293 | | [Arguments] | ${node} | ${interface}
294 | | interfaceAPI.Remove all ipv4 neighbors | ${node} | ${interface}
295
296 | IPv4 neighbor from Honeycomb should be empty
297 | | [Documentation] | Retrieves ipv4 neighbor list through Honeycomb\
298 | | ... | and expects to find no ipv4 neighbors.
299 | | ...
300 | | ... | *Arguments:*
301 | | ... | - node - information about a DUT node. Type: dictionary
302 | | ... | - interface - name of an interface on the specified node. Type: string
303 | | ...
304 | | ... | *Example:*
305 | | ...
306 | | ... | \| IPv4 neighbor from Honeycomb should be empty \| ${nodes['DUT1']} \
307 | | ... | \| GigabitEthernet0/8/0 \|
308 | | [Arguments] | ${node} | ${interface}
309 | | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface}
310 | | Run keyword and expect error | *KeyError:*
311 | | ... | Set Variable | ${api_data['ietf-ip:ipv4']['neighbor'][0]['ip']}
312
313 | Honeycomb sets interface ipv6 address
314 | | [Documentation] | Uses Honeycomb API to change ipv6 address\
315 | | ... | of the specified interface. Existing IPv6 addresses will be removed,\
316 | | ... | with the exception of self-configured link-layer IPv6.
317 | | ...
318 | | ... | *Arguments:*
319 | | ... | - node - information about a DUT node. Type: dictionary
320 | | ... | - interface - name of an interface on the specified node. Type: string
321 | | ... | - address - IP address to set. Type: string
322 | | ... | - prefix - length of subnet prefix to set. Type: string
323 | | ...
324 | | ... | *Example:*
325 | | ...
326 | | ... | \| Honeycomb sets interface ipv6 address \| ${nodes['DUT1']} \
327 | | ... | \| GigabitEthernet0/8/0 \| 10::10 \| 64 \|
328 | | [Arguments] | ${node} | ${interface} | ${address} | ${prefix}
329 | | interfaceAPI.Add first ipv6 address
330 | | ... | ${node} | ${interface} | ${address} | ${prefix}
331
332 | Honeycomb adds interface ipv6 address
333 | | [Documentation] | Uses Honeycomb API to add an ipv6 address\
334 | | ... | to the specified interface.
335 | | ...
336 | | ... | *Arguments:*
337 | | ... | - node - information about a DUT node. Type: dictionary
338 | | ... | - interface - name of an interface on the specified node. Type: string
339 | | ... | - address - IP address to set. Type: string
340 | | ... | - prefix - length of subnet prefix to set. Type: string
341 | | ...
342 | | ... | *Example:*
343 | | ...
344 | | ... | \| Honeycomb adds interface ipv6 address \| ${nodes['DUT1']} \
345 | | ... | \| GigabitEthernet0/8/0 \| 10::10 \| 64 \|
346 | | [Arguments] | ${node} | ${interface} | ${address} | ${prefix}
347 | | interfaceAPI.Add ipv6 address
348 | | ... | ${node} | ${interface} | ${address} | ${prefix}
349
350 | Honeycomb fails to add interface ipv6 address
351 | | [Documentation] | Uses Honeycomb API to add an ipv6 address to the\
352 | | ... | specified interface, and expects to fail with code 500.
353 | | ...
354 | | ... | *Arguments:*
355 | | ... | - node - information about a DUT node. Type: dictionary
356 | | ... | - interface - name of an interface on the specified node. Type: string
357 | | ... | - address - IP address to set. Type: string
358 | | ... | - prefix - length of address network prefix. Type:integer
359 | | ...
360 | | ... | *Example:*
361 | | ...
362 | | ... | \| Honeycomb fails to add interface ipv6 address \
363 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| 10::10 \| 64 \|
364 | | [Arguments] | ${node} | ${interface} | ${address} | ${prefix}
365 | | Run Keyword and Expect Error | *not successful. Status code: 500.
366 | | ... | Honeycomb adds interface ipv6 address
367 | | ... | ${node} | ${interface} | ${address} | ${prefix}
368
369 | IPv6 address from Honeycomb should be
370 | | [Documentation] | Retrieves interface ipv6 address through Honeycomb\
371 | | ... | and compares with state supplied in argument.
372 | | ...
373 | | ... | *Arguments:*
374 | | ... | - node - information about a DUT node. Type: dictionary
375 | | ... | - interface - name of an interface on the specified node. Type: string
376 | | ... | - address - IP address to expect. Type: string
377 | | ... | - prefix - length of subnet prefix to expect. Type: string
378 | | ...
379 | | ... | *Example:*
380 | | ...
381 | | ... | \| IPv6 address from Honeycomb should be \| ${nodes['DUT1']} \
382 | | ... | \| GigabitEthernet0/8/0 \| 10::10 \| 64 \|
383 | | [Arguments] | ${node} | ${interface} | ${address} | ${prefix}
384 | | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface}
385 | | ${settings}= | Create Dictionary
386 | | ... | ip=${address} | prefix-length=${prefix}
387 | | Should contain | ${api_data['ietf-ip:ipv6']['address']} | ${settings}
388
389 | IPv6 address from VAT should be
390 | | [Documentation] | Retrieves interface ipv6 address through VAT and\
391 | | ... | compares with state supplied in argument.
392 | | ...
393 | | ... | *Arguments:*
394 | | ... | - node - information about a DUT node. Type: dictionary
395 | | ... | - interface - name of an interface on the specified node. Type: string
396 | | ... | - address - IP address to expect. Type: string
397 | | ... | - prefix - length of subnet prefix to expect. Type: string
398 | | ...
399 | | ... | *Example:*
400 | | ...
401 | | ... | \| IPv6 address from VAT should be \| ${nodes['DUT1']} \
402 | | ... | \| GigabitEthernet0/8/0 \| 10::10 \| 64 \|
403 | | [Arguments] | ${node} | ${interface} | ${address} | ${prefix}
404 | | ${vpp_data}= | interfaceCLI.VPP get interface ip addresses
405 | | ... | ${node} | ${interface} | ipv6
406 | | ${settings}= | Create Dictionary
407 | | ... | ip=${address} | prefix_length=${prefix}
408 | | Should contain | ${vpp_data} | ${settings}
409
410 | Honeycomb removes interface ipv6 addresses
411 | | [Documentation] | Removes all configured ipv6 addresses from the specified\
412 | | ... | interface.
413 | | ...
414 | | ... | *Arguments:*
415 | | ... | - node - information about a DUT node. Type: dictionary
416 | | ... | - interface - name of an interface on the specified node. Type: string
417 | | ...
418 | | ... | *Example:*
419 | | ...
420 | | ... | \| Honeycomb removes interface ipv6 addresses \| ${nodes['DUT1']} \
421 | | ... | \| GigabitEthernet0/8/0 \|
422 | | [Arguments] | ${node} | ${interface}
423 | | Remove all ipv6 addresses | ${node} | ${interface}
424
425 | IPv6 address from Honeycomb should be empty
426 | | [Documentation] | Retrieves interface ipv6 configuration through Honeycomb\
427 | | ... | and expects to find no IPv6 addresses.
428 | | ...
429 | | ... | *Arguments:*
430 | | ... | - node - information about a DUT node. Type: dictionary
431 | | ... | - interface - name of an interface on the specified node. Type: string
432 | | ...
433 | | ... | *Example:*
434 | | ...
435 | | ... | \| IPv6 address from Honeycomb should be empty\| ${nodes['DUT1']} \
436 | | ... | \| GigabitEthernet0/8/0 \|
437 | | [Arguments] | ${node} | ${interface}
438 | | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface}
439 | | Run keyword and expect error | *KeyError:*
440 | | ... | Set Variable | ${api_data['ietf-ip:ipv6']['address']}
441
442 | IPv6 address from VAT should be empty
443 | | [Documentation] | Retrieves interface ipv6 configuration through VAT and\
444 | | ... | expects to find no ipv6 addresses.
445 | | ...
446 | | ... | *Arguments:*
447 | | ... | - node - information about a DUT node. Type: dictionary
448 | | ... | - interface - name of an interface on the specified node. Type: string
449 | | ...
450 | | ... | *Example:*
451 | | ...
452 | | ... | \| IPv6 config from VAT should be empty \| ${nodes['DUT1']} \
453 | | ... | \| GigabitEthernet0/8/0 \|
454 | | [Arguments] | ${node} | ${interface}
455 | | Run keyword and expect error | *No JSON object could be decoded*
456 | | ... | InterfaceCLI.VPP get interface ip addresses
457 | | ... | ${node} | ${interface} | ipv6
458
459 | Honeycomb adds interface ipv6 neighbor
460 | | [Documentation] | Uses Honeycomb API to assign an ipv6 neighbor to the\
461 | | ... | specified interface.
462 | | ...
463 | | ... | *Arguments:*
464 | | ... | - node - information about a DUT node. Type: dictionary
465 | | ... | - interface - name of an interface on the specified node. Type: string
466 | | ... | - fib_address - IP address to add to fib table. Type: string
467 | | ... | - fib_mac - MAC address to add to fib table. Type: string
468 | | ...
469 | | ... | *Example:*
470 | | ...
471 | | ... | \| Honeycomb adds interface ipv6 neighbor \| ${nodes['DUT1']} \
472 | | ... | \| GigabitEthernet0/8/0 \| 192.168.0.3 \| 08:00:27:c0:5d:37 \|
473 | | [Arguments] | ${node} | ${interface} | ${fib_address} | ${fib_mac}
474 | | InterfaceAPI.Add ipv6 neighbor
475 | | ... | ${node} | ${interface} | ${fib_address} | ${fib_mac}
476
477 | IPv6 neighbor from Honeycomb should be
478 | | [Documentation] | Retrieves ipv6 neighbor list through Honeycomb\
479 | | ... | and checks if it contains address supplied in arguments.
480 | | ...
481 | | ... | *Arguments:*
482 | | ... | - node - information about a DUT node. Type: dictionary
483 | | ... | - interface - name of an interface on the specified node. Type: string
484 | | ... | - ip_address - ipv6 address of expected neighbor entry. Type: string
485 | | ... | - mac_address - MAC address of expected neighbor entry. Type: string
486 | | ...
487 | | ... | *Example:*
488 | | ...
489 | | ... | \| IPv6 neighbor from Honeycomb should be \| ${nodes['DUT1']} \
490 | | ... | \| GigabitEthernet0/8/0 \| 192.168.0.4 \| 08:00:27:60:26:ab \|
491 | | [Arguments] | ${node} | ${interface} | ${ip_address} | ${mac_address}
492 | | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface}
493 | | ${settings}= | Create Dictionary
494 | | ... | ip=${ip_address} | link-layer-address=${mac_address} | origin=static
495 | | Should contain | ${api_data['ietf-ip:ipv6']['neighbor']} | ${settings}
496
497 | Honeycomb clears all interface ipv6 neighbors
498 | | [Documentation] | Uses Honeycomb API to remove all ipv6 neighbors from the\
499 | | ... | specified interface.
500 | | ...
501 | | ... | *Arguments:*
502 | | ... | - node - information about a DUT node. Type: dictionary
503 | | ... | - interface - name of an interface on the specified node. Type: string
504 | | ...
505 | | ... | *Example:*
506 | | ...
507 | | ... | \| Honeycomb clears all interface ipv6 neighbors \| ${nodes['DUT1']} \
508 | | ... | \| GigabitEthernet0/8/0 \|
509 | | [Arguments] | ${node} | ${interface}
510 | | interfaceAPI.Remove all ipv6 neighbors | ${node} | ${interface}
511
512 | IPv6 neighbor from Honeycomb should be empty
513 | | [Documentation] | Retrieves ipv6 neighbor list through Honeycomb\
514 | | ... | and expects to find no ipv6 neighbors.
515 | | ...
516 | | ... | *Arguments:*
517 | | ... | - node - information about a DUT node. Type: dictionary
518 | | ... | - interface - name of an interface on the specified node. Type: string
519 | | ...
520 | | ... | *Example:*
521 | | ...
522 | | ... | \| IPv6 neighbor from Honeycomb should be empty \| ${nodes['DUT1']} \
523 | | ... | \| GigabitEthernet0/8/0 \|
524 | | [Arguments] | ${node} | ${interface}
525 | | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface}
526 | | Run keyword and expect error | *KeyError:*
527 | | ... | Set Variable | ${api_data['ietf-ip:ipv6']['neighbor'][0]['ip']}
528
529 | Honeycomb sets interface ethernet configuration
530 | | [Documentation] | Uses Honeycomb API to change interface ethernet\
531 | | ... | configuration.
532 | | ...
533 | | ... | *Arguments:*
534 | | ... | - node - information about a DUT node. Type: dictionary
535 | | ... | - interface - name of an interface on the specified node. Type: string
536 | | ... | - ethernet - interface ethernet settings. Type: dictionary
537 | | ...
538 | | ... | *Example:*
539 | | ...
540 | | ... | \| Honeycomb sets interface ethernet configuration \
541 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${{'mtu': 1500}} \
542 | | [Arguments] | ${node} | ${interface} | ${ethernet}
543 | | :FOR | ${key} | IN | @{ethernet.keys()}
544 | | | interfaceAPI.Configure interface ethernet
545 | | | ... | ${node} | ${interface} | ${key} | ${ethernet['${key}']}
546
547 | Interface ethernet configuration from Honeycomb should be
548 | | [Documentation] | Retrieves interface ethernet configuration\
549 | | ... | through Honeycomb and compares with settings supplied in arguments.
550 | | ...
551 | | ... | *Arguments:*
552 | | ... | - node - information about a DUT node. Type: dictionary
553 | | ... | - interface - name of an interface on the specified node. Type: string
554 | | ... | - ethernet - interface ethernet settings. Type: dictionary
555 | | ...
556 | | ... | *Example:*
557 | | ...
558 | | ... | \| Interface ethernet configuration from Honeycomb should be \
559 | | ... | should be \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \
560 | | ... | \| ${{'mtu': 1500}} \|
561 | | [Arguments] | ${node} | ${interface} | ${ethernet}
562 | | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface}
563 | | :FOR | ${key} | IN | @{ethernet.keys()}
564 | | | Should be equal
565 | | | ... | ${api_data['v3po:ethernet']['${key}']} | ${ethernet['${key}']}
566
567 | Interface ethernet configuration from VAT should be
568 | | [Documentation] | Retrieves interface ethernet configuration\
569 | | ... | through VAT and compares with settings supplied in arguments.
570 | | ...
571 | | ... | *Arguments:*
572 | | ... | - node - information about a DUT node. Type: dictionary
573 | | ... | - interface - name of an interface on the specified node. Type: string
574 | | ... | - mtu - value of maximum transmission unit expected. Type: integer
575 | | ...
576 | | ... | *Example:*
577 | | ...
578 | | ... | \| Interface ethernet configuration from VAT should be \
579 | | ... | should be \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1500} \|
580 | | [Arguments] | ${node} | ${interface} | ${mtu}
581 | | ${vat_data}= | InterfaceCLI.VPP get interface data | ${node} | ${interface}
582 | | Should be equal | ${vat_data['mtu']} | ${mtu}
583
584 | Honeycomb sets interface vrf ID
585 | | [Documentation] | Uses Honeycomb API to change interface vrf\
586 | | ... | configuration.
587 | | ...
588 | | ... | *Arguments:*
589 | | ... | - node - information about a DUT node. Type: dictionary
590 | | ... | - interface - name of an interface on the specified node. Type: string
591 | | ... | - vrf_id - vrf ID to configure. Type:integer
592 | | ...
593 | | ... | *Example:*
594 | | ...
595 | | ... | \| Honeycomb sets interface vrf ID \
596 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \| ipv4 \|
597 | | [Arguments] | ${node} | ${interface} | ${vrf_id} | ${ip_version}
598 | | interfaceAPI.Configure interface routing
599 | | ... | ${node} | ${interface} | ${ip_version}-vrf-id | ${vrf_id}
600
601 | Interface vrf ID from Honeycomb should be
602 | | [Documentation] | Retrieves interface ethernet configuration\
603 | | ... | through Honeycomb and compares with settings supplied in arguments.
604 | | ...
605 | | ... | *Arguments:*
606 | | ... | - node - information about a DUT node. Type: dictionary
607 | | ... | - interface - name of an interface on the specified node. Type: string
608 | | ... | - vrf_id - vrf ID to expect. Type:integer
609 | | ... | - ip_version - IP protocol version, ipv4 or ipv6. Type: string
610 | | ...
611 | | ... | *Example:*
612 | | ...
613 | | ... | \| Interface vrf ID from Honeycomb should be \
614 | | ... | should be \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \
615 | | ... | \| ipv4 \|
616 | | [Arguments] | ${node} | ${interface} | ${vrf_id} | ${ip_version}
617 | | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface} |
618 | | Should be equal
619 | | ... | ${api_data['v3po:routing']['${ip_version}-vrf-id']} | ${vrf_id}
620
621 | Interface vrf ID from VAT should be
622 | | [Documentation] | Retrieves interface ethernet configuration\
623 | | ... | through VAT and compares with settings supplied in arguments.
624 | | ...
625 | | ... | *Arguments:*
626 | | ... | - node - information about a DUT node. Type: dictionary
627 | | ... | - interface - name of an interface on the specified node. Type: string
628 | | ... | - vrf_id - vrf ID to expect. Type:integer
629 | | ...
630 | | ... | *Example:*
631 | | ...
632 | | ... | \| Interface vrf ID from VAT should be \
633 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \|
634 | | [Arguments] | ${node} | ${interface} | ${vrf_id}
635 | | ${vat_data}= | InterfaceCLI.get interface vrf table
636 | | ... | ${node} | ${interface}
637 | | Should be equal | ${vat_data} | ${vrf_id}
638
639 | Interface configuration from Honeycomb should be empty
640 | | [Documentation] | Attempts to retrieve interface configuration through\
641 | | ... | Honeycomb and expects to get empty dictionary.
642 | | ...
643 | | ... | *Arguments:*
644 | | ... | - node - information about a DUT node. Type: dictionary
645 | | ... | - interface - name of a interface on the specified node. Type:\
646 | | ... | string
647 | | ...
648 | | ... | *Example:*
649 | | ... | \| Interface configuration from Honeycomb should be empty\
650 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \|
651 | | ...
652 | | [Arguments] | ${node} | ${interface}
653 | | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface}
654 | | Should be empty | ${api_data}
655
656 | Interface configuration from VAT should be empty
657 | | [Documentation] | Attempts to retrieve Interface configuration through\
658 | | ... | VAT and expects to get empty dictionary.
659 | | ...
660 | | ... | *Arguments:*
661 | | ... | - node - information about a DUT node. Type: dictionary
662 | | ... | - interface - name of a Interface on the specified node. Type:\
663 | | ... | string
664 | | ...
665 | | ... | *Example:*
666 | | ... | \| Interface configuration from VAT should be empty\
667 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \|
668 | | ...
669 | | [Arguments] | ${node} | ${interface} |
670 | | ${vat_data}= | InterfaceCLI.VPP get interface data | ${node} | ${interface}
671 | | Should be empty | ${vat_data}
672
673 | Interface indices from Honeycomb and VAT should correspond
674 | | [Documentation] | Uses VAT and Honeycomb to get operational data about the\
675 | | ... | given interface and compares the interface indexes. The interface
676 | | ... | index from Honeycomb should be greater than index from VAT by one.
677 | | ...
678 | | ... | *Arguments:*
679 | | ... | - node - information about a DUT node. Type: dictionary
680 | | ... | - interface - name of the interface to be checked. Type: string
681 | | ...
682 | | ... | *Example:*
683 | | ...
684 | | ... | \| Interface indices from Honeycomb and VAT should correspond \
685 | | ... | \| ${nodes['DUT1']} \| vxlan_gpe_tunnel0 \|
686 | | ...
687 | | [Arguments] | ${node} | ${interface}
688 | | ...
689 | | ${api_data}= | interfaceAPI.Get interface oper data | ${node} | ${interface}
690 | | ${vat_data}= | InterfaceCLI.VPP get interface data | ${node} | ${interface}
691 | | ${sw_if_index}= | EVALUATE | ${vat_data['sw_if_index']} + 1
692 | | Should be equal as strings
693 | | ... | ${api_data['if-index']} | ${sw_if_index}
694
695 | Get Interface index from oper data
696 | | [Documentation] | Retrieves interface operational data and returns\
697 | | ... | if-index of the specified interface.
698 | | ...
699 | | ... | *Arguments:*
700 | | ... | - node - information about a DUT node. Type: dictionary
701 | | ... | - interface - name of the interface. Type: string
702 | | ...
703 | | ... | *Example:*
704 | | ...
705 | | ... | \| Get Interface index from oper data \| ${nodes['DUT1']} \| local0 \|
706 | | [Arguments] | ${node} | ${interface}
707 | | ${data}= | interfaceAPI.Get interface oper data | ${node} | ${interface}
708 | | Return from keyword | ${data['if-index']}
709
710 | Honeycomb should show disabled interface in oper data
711 | | [Documentation] | Retrieves list of disabled interfaces\
712 | | ... | and verifies that there is at least one.
713 | | ...
714 | | ... | *Arguments:*
715 | | ... | - node - information about a DUT node. Type: dictionary
716 | | ... | - index - index of the interface to be checked. Type: string
717 | | ...
718 | | ... | *Example:*
719 | | ...
720 | | ... | \| Honeycomb should show disabled interface in oper data \
721 | | ... | \|${nodes['DUT1']} \| ${vx_interface} \|
722 | | [Arguments] | ${node} | ${index}
723 | | interfaceAPI.check disabled interface | ${node} | ${index}
724
725 | Honeycomb should not show disabled interface in oper data
726 | | [Documentation] | Retrieves list of disabled interfaces\
727 | | ... | and expects to fail with a 404 - not found.
728 | | ...
729 | | ... | *Arguments:*
730 | | ... | - node - information about a DUT node. Type: dictionary
731 | | ... | - index - index of the interface to be checked. Type: string
732 | | ...
733 | | ... | *Example:*
734 | | ...
735 | | ... | \| Honeycomb should not show disabled interface in oper data \
736 | | ... | \|${nodes['DUT1']} \| ${vx_interface} \|
737 | | [Arguments] | ${node} | ${index}
738 | | Run keyword and expect error | *
739 | | ... | Honeycomb should show disabled interface in oper data
740 | | ... | ${node} | ${index}
741
742 | Ping and verify IP address
743 | | [Documentation] | Sends ICMP packet from IP (with source mac) to IP
744 | | ... | (with dest mac), then waits for ICMP reply.
745 | | ...
746 | | ... | *Arguments:*
747 | | ...
748 | | ... | _NOTE:_ Arguments are based on topology:
749 | | ... | TG(if1)->(if1)DUT(if2)->TG(if2)
750 | | ...
751 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
752 | | ... | - src_ip - IP of source interface (TG-if1). Type: integer
753 | | ... | - dst_ip - IP of destination interface (TG-if2). Type: integer
754 | | ... | - tx_port - Source interface (TG-if1). Type: string
755 | | ... | - tx_mac - MAC address of source interface (TG-if1). Type: string
756 | | ... | - rx_port - Destionation interface (TG-if1). Type: string
757 | | ... | - rx_mac - MAC address of destination interface (TG-if1). Type: string
758 | | ...
759 | | ... | *Example:*
760 | | ...
761 | | ... | \| Ping verify IP address \| ${nodes['TG']} \
762 | | ... | \| 16.0.0.1 \| 32.0.0.1 \| eth2 \| 08:00:27:cc:4f:54 \
763 | | ... | \| eth4 \| 08:00:27:c9:6a:d5 \|
764 | | ...
765 | | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_port} |
766 | | ... | ${tx_mac} | ${rx_port} | ${rx_mac}
767 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_port}
768 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
769 | | ${args}= | Catenate | --src_mac | ${tx_mac}
770 | | ...                 | --dst_mac | ${rx_mac}
771 | | ...                 | --src_ip | ${src_ip}
772 | | ...                 | --dst_ip | ${dst_ip}
773 | | ...                 | --tx_if | ${tx_port_name}
774 | | ...                 | --rx_if | ${rx_port_name}
775 | | ...                 | --timeout | ${5}
776 | | Run Traffic Script On Node | send_icmp_wait_for_reply.py
777 | | ... | ${tg_node} | ${args}