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