Improve test tag string parsing
[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.IPUtil
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 | | ... | - sw_if_index - Index of interface. Type: integer
181 | | ...
182 | | ... | *Example:*
183 | | ...
184 | | ... | \| IPv4 address from VAT should be \| ${nodes['DUT1']} \
185 | | ... | \| GigabitEthernet0/8/0 \| 192.168.0.2 \| ${24} \| 255.255.255.0 \|
186 | | [Arguments] | ${node} | ${interface} | ${address} | ${prefix} | ${netmask}
187 | | ${sw_if_index}= | Vpp Get Interface Sw Index | ${node} | ${interface}
188 | | ${vpp_data}= | VPP get interface ip addresses
189 | | ... | ${node} | ${interface} | ipv4
190 | | ${settings}= | Create Dictionary
191 | | ... | ip=${address} | netmask=${netmask} | sw_if_index=${sw_if_index}
192 | | ... | prefix_length=${prefix} | is_ipv6=${0}
193 | | Should contain | ${vpp_data} | ${settings}
194
195 | Honeycomb removes interface IPv4 addresses
196 | | [Documentation] | Removes all configured ipv4 addresses from the specified\
197 | | ... | interface.
198 | | ...
199 | | ... | *Arguments:*
200 | | ... | - node - information about a DUT node. Type: dictionary
201 | | ... | - interface - name of an interface on the specified node. Type: string
202 | | ...
203 | | ... | *Example:*
204 | | ...
205 | | ... | \| Honeycomb removes interface IPv4 addresses \| ${nodes['DUT1']} \
206 | | ... | \| GigabitEthernet0/8/0 \|
207 | | [Arguments] | ${node} | ${interface}
208 | | Remove all ipv4 addresses | ${node} | ${interface}
209
210 | IPv4 address from Honeycomb should be empty
211 | | [Documentation] | Retrieves interface ipv4 configuration through Honeycomb\
212 | | ... | and expects to find no IPv4 addresses.
213 | | ...
214 | | ... | *Arguments:*
215 | | ... | - node - information about a DUT node. Type: dictionary
216 | | ... | - interface - name of an interface on the specified node. Type: string
217 | | ...
218 | | ... | *Example:*
219 | | ...
220 | | ... | \| IPv4 address from Honeycomb should be empty\| ${nodes['DUT1']} \
221 | | ... | \| GigabitEthernet0/8/0 \|
222 | | [Arguments] | ${node} | ${interface}
223 | | ${api_data}= | Get interface oper data | ${node} | ${interface}
224 | | Run keyword and expect error | *KeyError:*
225 | | ... | Set Variable | ${api_data['ietf-ip:ipv4']['address']}
226
227 | IPv4 address from VAT should be empty
228 | | [Documentation] | Retrieves interface ipv4 configuration through VAT and\
229 | | ... | and expects to find no ipv4 addresses.
230 | | ...
231 | | ... | *Arguments:*
232 | | ... | - node - information about a DUT node. Type: dictionary
233 | | ... | - interface - name of an interface on the specified node. Type: string
234 | | ...
235 | | ... | *Example:*
236 | | ...
237 | | ... | \| IPv4 config from VAT should be empty \| ${nodes['DUT1']} \
238 | | ... | \| GigabitEthernet0/8/0 \|
239 | | [Arguments] | ${node} | ${interface}
240 | | ${data}= | VPP get interface ip addresses | ${node} | ${interface} | ipv4
241 | | Should be empty | ${data}
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 | | 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}= | 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 | | 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}= | 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 | | 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 | | 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 contain
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 contain \| ${nodes['DUT1']} \
382 | | ... | \| GigabitEthernet0/8/0 \| 10::10 \| 64 \|
383 | | [Arguments] | ${node} | ${interface} | ${address} | ${prefix}
384 | | ${api_data}= | 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 contain
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 | | ... | - sw_if_index - index of interface. Type: integer
399 | | ...
400 | | ... | *Example:*
401 | | ...
402 | | ... | \| IPv6 address from VAT should contain \| ${nodes['DUT1']} \
403 | | ... | \| GigabitEthernet0/8/0 \| 10::10 \| 64 \|
404 | | [Arguments] | ${node} | ${interface} | ${address} | ${prefix} | ${netmask}
405 | | ${sw_if_index}= | Vpp Get Interface Sw Index | ${node} | ${interface}
406 | | ${vpp_data}= | VPP get interface ip addresses
407 | | ... | ${node} | ${interface} | ipv6
408 | | ${settings}= | Create Dictionary
409 | | ... | ip=${address} | netmask=${netmask} | sw_if_index=${sw_if_index}
410 | | ... | prefix_length=${prefix} | is_ipv6=${1}
411 | | Should contain | ${vpp_data} | ${settings}
412
413 | Honeycomb removes interface IPv6 addresses
414 | | [Documentation] | Removes all configured ipv6 addresses from the specified\
415 | | ... | interface.
416 | | ...
417 | | ... | *Arguments:*
418 | | ... | - node - information about a DUT node. Type: dictionary
419 | | ... | - interface - name of an interface on the specified node. Type: string
420 | | ...
421 | | ... | *Example:*
422 | | ...
423 | | ... | \| Honeycomb removes interface IPv6 addresses \| ${nodes['DUT1']} \
424 | | ... | \| GigabitEthernet0/8/0 \|
425 | | [Arguments] | ${node} | ${interface}
426 | | Remove all ipv6 addresses | ${node} | ${interface}
427
428 | IPv6 address from Honeycomb should be empty
429 | | [Documentation] | Retrieves interface ipv6 configuration through Honeycomb\
430 | | ... | and expects to find no IPv6 addresses.
431 | | ...
432 | | ... | *Arguments:*
433 | | ... | - node - information about a DUT node. Type: dictionary
434 | | ... | - interface - name of an interface on the specified node. Type: string
435 | | ...
436 | | ... | *Example:*
437 | | ...
438 | | ... | \| IPv6 address from Honeycomb should be empty\| ${nodes['DUT1']} \
439 | | ... | \| GigabitEthernet0/8/0 \|
440 | | [Arguments] | ${node} | ${interface}
441 | | ${api_data}= | Get interface oper data | ${node} | ${interface}
442 | | Run keyword and expect error | *KeyError:*
443 | | ... | Set Variable | ${api_data['ietf-ip:ipv6']['address']}
444
445 | IPv6 address from VAT should be empty
446 | | [Documentation] | Retrieves interface ipv6 configuration through VAT and\
447 | | ... | expects to find no ipv6 addresses.
448 | | ...
449 | | ... | *Arguments:*
450 | | ... | - node - information about a DUT node. Type: dictionary
451 | | ... | - interface - name of an interface on the specified node. Type: string
452 | | ...
453 | | ... | *Example:*
454 | | ...
455 | | ... | \| IPv6 config from VAT should be empty \| ${nodes['DUT1']} \
456 | | ... | \| GigabitEthernet0/8/0 \|
457 | | [Arguments] | ${node} | ${interface}
458 | | ${data}= | VPP get interface ip addresses | ${node} | ${interface} | ipv6
459 | | Should be empty | ${data}
460
461 | Honeycomb adds interface IPv6 neighbor
462 | | [Documentation] | Uses Honeycomb API to assign an ipv6 neighbor to the\
463 | | ... | specified interface.
464 | | ...
465 | | ... | *Arguments:*
466 | | ... | - node - information about a DUT node. Type: dictionary
467 | | ... | - interface - name of an interface on the specified node. Type: string
468 | | ... | - fib_address - IP address to add to fib table. Type: string
469 | | ... | - fib_mac - MAC address to add to fib table. Type: string
470 | | ...
471 | | ... | *Example:*
472 | | ...
473 | | ... | \| Honeycomb adds interface IPv6 neighbor \| ${nodes['DUT1']} \
474 | | ... | \| GigabitEthernet0/8/0 \| 192.168.0.3 \| 08:00:27:c0:5d:37 \|
475 | | [Arguments] | ${node} | ${interface} | ${fib_address} | ${fib_mac}
476 | | Add ipv6 neighbor
477 | | ... | ${node} | ${interface} | ${fib_address} | ${fib_mac}
478
479 | IPv6 neighbor from Honeycomb should be
480 | | [Documentation] | Retrieves ipv6 neighbor list through Honeycomb\
481 | | ... | and checks if it contains address supplied in arguments.
482 | | ...
483 | | ... | *Arguments:*
484 | | ... | - node - information about a DUT node. Type: dictionary
485 | | ... | - interface - name of an interface on the specified node. Type: string
486 | | ... | - ip_address - ipv6 address of expected neighbor entry. Type: string
487 | | ... | - mac_address - MAC address of expected neighbor entry. Type: string
488 | | ...
489 | | ... | *Example:*
490 | | ...
491 | | ... | \| IPv6 neighbor from Honeycomb should be \| ${nodes['DUT1']} \
492 | | ... | \| GigabitEthernet0/8/0 \| 192.168.0.4 \| 08:00:27:60:26:ab \|
493 | | [Arguments] | ${node} | ${interface} | ${ip_address} | ${mac_address}
494 | | ${api_data}= | Get interface oper data | ${node} | ${interface}
495 | | ${settings}= | Create Dictionary
496 | | ... | ip=${ip_address} | link-layer-address=${mac_address} | origin=static
497 | | Should contain | ${api_data['ietf-ip:ipv6']['neighbor']} | ${settings}
498
499 | Honeycomb clears all interface IPv6 neighbors
500 | | [Documentation] | Uses Honeycomb API to remove all ipv6 neighbors from the\
501 | | ... | specified interface.
502 | | ...
503 | | ... | *Arguments:*
504 | | ... | - node - information about a DUT node. Type: dictionary
505 | | ... | - interface - name of an interface on the specified node. Type: string
506 | | ...
507 | | ... | *Example:*
508 | | ...
509 | | ... | \| Honeycomb clears all interface IPv6 neighbors \| ${nodes['DUT1']} \
510 | | ... | \| GigabitEthernet0/8/0 \|
511 | | [Arguments] | ${node} | ${interface}
512 | | Remove all ipv6 neighbors | ${node} | ${interface}
513
514 | IPv6 neighbor from Honeycomb should be empty
515 | | [Documentation] | Retrieves ipv6 neighbor list through Honeycomb\
516 | | ... | and expects to find no ipv6 neighbors.
517 | | ...
518 | | ... | *Arguments:*
519 | | ... | - node - information about a DUT node. Type: dictionary
520 | | ... | - interface - name of an interface on the specified node. Type: string
521 | | ...
522 | | ... | *Example:*
523 | | ...
524 | | ... | \| IPv6 neighbor from Honeycomb should be empty \| ${nodes['DUT1']} \
525 | | ... | \| GigabitEthernet0/8/0 \|
526 | | [Arguments] | ${node} | ${interface}
527 | | ${api_data}= | Get interface oper data | ${node} | ${interface}
528 | | Run keyword and expect error | *KeyError:*
529 | | ... | Set Variable | ${api_data['ietf-ip:ipv6']['neighbor'][0]['ip']}
530
531 | Honeycomb sets interface ethernet configuration
532 | | [Documentation] | Uses Honeycomb API to change interface ethernet\
533 | | ... | configuration.
534 | | ...
535 | | ... | *Arguments:*
536 | | ... | - node - information about a DUT node. Type: dictionary
537 | | ... | - interface - name of an interface on the specified node. Type: string
538 | | ... | - ethernet - interface ethernet settings. Type: dictionary
539 | | ...
540 | | ... | *Example:*
541 | | ...
542 | | ... | \| Honeycomb sets interface ethernet configuration \
543 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${{'mtu': 1500}} \
544 | | [Arguments] | ${node} | ${interface} | ${ethernet}
545 | | :FOR | ${key} | IN | @{ethernet.keys()}
546 | | | Configure interface ethernet
547 | | | ... | ${node} | ${interface} | ${key} | ${ethernet['${key}']}
548
549 | Interface ethernet Operational Data From Honeycomb Should Be
550 | | [Documentation] | Retrieves interface ethernet configuration\
551 | | ... | through Honeycomb and compares with settings supplied in arguments.
552 | | ...
553 | | ... | *Arguments:*
554 | | ... | - node - information about a DUT node. Type: dictionary
555 | | ... | - interface - name of an interface on the specified node. Type: string
556 | | ... | - ethernet - interface ethernet settings. Type: dictionary
557 | | ...
558 | | ... | *Example:*
559 | | ...
560 | | ... | \| Interface ethernet Operational Data From Honeycomb Should Be \
561 | | ... | should be \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \
562 | | ... | \| ${{'mtu': 1500}} \|
563 | | [Arguments] | ${node} | ${interface} | ${ethernet}
564 | | ${api_data}= | Get interface oper data | ${node} | ${interface}
565 | | :FOR | ${key} | IN | @{ethernet.keys()}
566 | | | Should be equal
567 | | | ... | ${api_data['v3po:ethernet']['${key}']} | ${ethernet['${key}']}
568
569 | Interface ethernet Operational Data From VAT Should Be
570 | | [Documentation] | Retrieves interface ethernet configuration\
571 | | ... | through VAT and compares with settings supplied in arguments.
572 | | ...
573 | | ... | *Arguments:*
574 | | ... | - node - information about a DUT node. Type: dictionary
575 | | ... | - interface - name of an interface on the specified node. Type: string
576 | | ... | - mtu - value of maximum transmission unit expected. Type: integer
577 | | ...
578 | | ... | *Example:*
579 | | ...
580 | | ... | \| Interface ethernet Operational Data From VAT Should Be \
581 | | ... | should be \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1500} \|
582 | | [Arguments] | ${node} | ${interface} | ${mtu}
583 | | ${vat_data}= | VPP get interface data | ${node} | ${interface}
584 | | Should be equal | ${vat_data['mtu']} | ${mtu}
585
586 | Honeycomb sets interface VRF ID
587 | | [Documentation] | Uses Honeycomb API to change interface vrf\
588 | | ... | configuration.
589 | | ...
590 | | ... | *Arguments:*
591 | | ... | - node - information about a DUT node. Type: dictionary
592 | | ... | - interface - name of an interface on the specified node. Type: string
593 | | ... | - vrf_id - vrf ID to configure. Type:integer
594 | | ...
595 | | ... | *Example:*
596 | | ...
597 | | ... | \| Honeycomb sets interface VRF ID \
598 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \| ipv4 \|
599 | | [Arguments] | ${node} | ${interface} | ${vrf_id} | ${ip_version}
600 | | Configure interface routing
601 | | ... | ${node} | ${interface} | ${ip_version}-vrf-id | ${vrf_id}
602
603 | Interface VRF ID from Honeycomb should be
604 | | [Documentation] | Retrieves interface ethernet configuration\
605 | | ... | through Honeycomb and compares with settings supplied in arguments.
606 | | ...
607 | | ... | *Arguments:*
608 | | ... | - node - information about a DUT node. Type: dictionary
609 | | ... | - interface - name of an interface on the specified node. Type: string
610 | | ... | - vrf_id - vrf ID to expect. Type:integer
611 | | ... | - ip_version - IP protocol version, ipv4 or ipv6. Type: string
612 | | ...
613 | | ... | *Example:*
614 | | ...
615 | | ... | \| Interface VRF ID from Honeycomb should be \
616 | | ... | should be \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \
617 | | ... | \| ipv4 \|
618 | | [Arguments] | ${node} | ${interface} | ${vrf_id} | ${ip_version}
619 | | ${api_data}= | Get interface oper data | ${node} | ${interface} |
620 | | Should be equal
621 | | ... | ${api_data['v3po:routing']['${ip_version}-vrf-id']} | ${vrf_id}
622
623 | Interface VRF ID from VAT should be
624 | | [Documentation] | Retrieves interface ethernet configuration\
625 | | ... | through VAT and compares with settings supplied in arguments.
626 | | ...
627 | | ... | *Arguments:*
628 | | ... | - node - information about a DUT node. Type: dictionary
629 | | ... | - interface - name of an interface on the specified node. Type: string
630 | | ... | - vrf_id - vrf ID to expect. Type:integer
631 | | ...
632 | | ... | *Example:*
633 | | ...
634 | | ... | \| Interface VRF ID from VAT should be \
635 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| ${1} \|
636 | | [Arguments] | ${node} | ${interface} | ${vrf_id}
637 | | ${vat_data}= | get interface vrf table
638 | | ... | ${node} | ${interface}
639 | | Should be equal | ${vat_data} | ${vrf_id}
640
641 | Interface Operational Data From Honeycomb Should Be empty
642 | | [Documentation] | Attempts to retrieve interface configuration through\
643 | | ... | Honeycomb and expects to get empty dictionary.
644 | | ...
645 | | ... | *Arguments:*
646 | | ... | - node - information about a DUT node. Type: dictionary
647 | | ... | - interface - name of a interface on the specified node. Type:\
648 | | ... | string
649 | | ...
650 | | ... | *Example:*
651 | | ... | \| Interface Operational Data From Honeycomb Should Be empty\
652 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \|
653 | | ...
654 | | [Arguments] | ${node} | ${interface}
655 | | ${api_data}= | Get interface oper data | ${node} | ${interface}
656 | | Should be empty | ${api_data}
657
658 | Interface Operational Data From VAT Should Be empty
659 | | [Documentation] | Attempts to retrieve Interface configuration through\
660 | | ... | VAT and expects to get empty dictionary.
661 | | ...
662 | | ... | *Arguments:*
663 | | ... | - node - information about a DUT node. Type: dictionary
664 | | ... | - interface - name of a Interface on the specified node. Type:\
665 | | ... | string
666 | | ...
667 | | ... | *Example:*
668 | | ... | \| Interface Operational Data From VAT Should Be empty\
669 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \|
670 | | ...
671 | | [Arguments] | ${node} | ${interface} |
672 | | ${vat_data}= | VPP get interface data | ${node} | ${interface}
673 | | Should be empty | ${vat_data}
674
675 | Interface indices from Honeycomb and VAT should correspond
676 | | [Documentation] | Uses VAT and Honeycomb to get operational data about the\
677 | | ... | given interface and compares the interface indexes. The interface
678 | | ... | index from Honeycomb should be greater than index from VAT by one.
679 | | ...
680 | | ... | *Arguments:*
681 | | ... | - node - information about a DUT node. Type: dictionary
682 | | ... | - interface - name of the interface to be checked. Type: string
683 | | ...
684 | | ... | *Example:*
685 | | ...
686 | | ... | \| Interface indices from Honeycomb and VAT should correspond \
687 | | ... | \| ${nodes['DUT1']} \| vxlan_gpe_tunnel0 \|
688 | | ...
689 | | [Arguments] | ${node} | ${interface}
690 | | ...
691 | | ${api_data}= | Get interface oper data | ${node} | ${interface}
692 | | ${vat_data}= | VPP get interface data | ${node} | ${interface}
693 | | ${sw_if_index}= | EVALUATE | ${vat_data['sw_if_index']} + 1
694 | | Should be equal as strings
695 | | ... | ${api_data['if-index']} | ${sw_if_index}
696
697 | Get interface index from oper data
698 | | [Documentation] | Retrieves interface operational data and returns\
699 | | ... | if-index of the specified interface.
700 | | ...
701 | | ... | *Arguments:*
702 | | ... | - node - information about a DUT node. Type: dictionary
703 | | ... | - interface - name of the interface. Type: string
704 | | ...
705 | | ... | *Example:*
706 | | ...
707 | | ... | \| Get interface index from oper data \| ${nodes['DUT1']} \| local0 \|
708 | | [Arguments] | ${node} | ${interface}
709 | | ${data}= | Get interface oper data | ${node} | ${interface}
710 | | Return from keyword | ${data['if-index']}
711
712 | Honeycomb should show disabled interface in oper data
713 | | [Documentation] | Retrieves list of disabled interfaces\
714 | | ... | and verifies that there is at least one.
715 | | ...
716 | | ... | *Arguments:*
717 | | ... | - node - information about a DUT node. Type: dictionary
718 | | ... | - index - index of the interface to be checked. Type: string
719 | | ...
720 | | ... | *Example:*
721 | | ...
722 | | ... | \| Honeycomb should show disabled interface in oper data \
723 | | ... | \| ${nodes['DUT1']} \| ${vx_interface} \|
724 | | [Arguments] | ${node} | ${index}
725 | | check disabled interface | ${node} | ${index}
726
727 | Honeycomb should not show disabled interface in oper data
728 | | [Documentation] | Retrieves list of disabled interfaces\
729 | | ... | and expects to fail with a 404 - not found.
730 | | ...
731 | | ... | *Arguments:*
732 | | ... | - node - information about a DUT node. Type: dictionary
733 | | ... | - index - index of the interface to be checked. Type: string
734 | | ...
735 | | ... | *Example:*
736 | | ...
737 | | ... | \| Honeycomb should not show disabled interface in oper data \
738 | | ... | \| ${nodes['DUT1']} \| ${vx_interface} \|
739 | | [Arguments] | ${node} | ${index}
740 | | Run keyword and expect error | *
741 | | ... | Honeycomb should show disabled interface in oper data
742 | | ... | ${node} | ${index}
743
744 | Ping and verify IP address
745 | | [Documentation] | Sends ICMP packet from IP (with source mac) to IP
746 | | ... | (with dest mac), then waits for ICMP reply.
747 | | ...
748 | | ... | *Arguments:*
749 | | ...
750 | | ... | _NOTE:_ Arguments are based on topology:
751 | | ... | TG(if1)->(if1)DUT(if2)->TG(if2)
752 | | ...
753 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
754 | | ... | - src_ip - IP of source interface (TG-if1). Type: integer
755 | | ... | - dst_ip - IP of destination interface (TG-if2). Type: integer
756 | | ... | - tx_port - Source interface (TG-if1). Type: string
757 | | ... | - tx_mac - MAC address of source interface (TG-if1). Type: string
758 | | ... | - rx_port - Destionation interface (TG-if1). Type: string
759 | | ... | - rx_mac - MAC address of destination interface (TG-if1). Type: string
760 | | ...
761 | | ... | *Example:*
762 | | ...
763 | | ... | \| Ping verify IP address \| ${nodes['TG']} \
764 | | ... | \| 16.0.0.1 \| 32.0.0.1 \| eth2 \| 08:00:27:cc:4f:54 \
765 | | ... | \| eth4 \| 08:00:27:c9:6a:d5 \|
766 | | ...
767 | | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_port} |
768 | | ... | ${tx_mac} | ${rx_port} | ${rx_mac}
769 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_port}
770 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
771 | | ${args}= | Catenate | --src_mac | ${tx_mac}
772 | | ...                 | --dst_mac | ${rx_mac}
773 | | ...                 | --src_ip | ${src_ip}
774 | | ...                 | --dst_ip | ${dst_ip}
775 | | ...                 | --tx_if | ${tx_port_name}
776 | | ...                 | --rx_if | ${rx_port_name}
777 | | ...                 | --timeout | ${5}
778 | | Run Traffic Script On Node | send_icmp_wait_for_reply.py
779 | | ... | ${tg_node} | ${args}
780
781 | Honeycomb adds unnumbered configuration to interface
782 | | [Documentation] | Adds unnumbered configuration to interface, borrowing IP
783 | | ... | address from the other specified interface.
784 | | ...
785 | | ... | *Arguments:*
786 | | ... | - node - information about a DUT node. Type: dictionary
787 | | ... | - interface - Name of the interface to be configured. Type: string
788 | | ... | - interface_src - Name of the interface to borrow IP address from.\
789 | | ... | Type: string
790 | | ...
791 | | ... | *Example:*
792 | | ...
793 | | ... | \| Honeycomb adds unnumbered configuration to interface \
794 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \| GigabitEthernet0/9/0 \|
795 | | ...
796 | | [Arguments] | ${node} | ${Interface} | ${interface_src}
797 | | Configure interface unnumbered | ${node} | ${interface} | ${interface_src}
798
799 | Honeycomb removes unnumbered configuration from interface
800 | | [Documentation] | Removes unnumbered configuration from the specified
801 | | ... | interface.
802 | | ...
803 | | ... | *Arguments:*
804 | | ... | - node - information about a DUT node. Type: dictionary
805 | | ... | - interface - Name of the interface to be configured. Type: string
806 | | ...
807 | | ... | *Example:*
808 | | ...
809 | | ... | \| Honeycomb adds unnumbered configuration to interface \
810 | | ... | \| ${nodes['DUT1']} \| GigabitEthernet0/8/0 \|
811 | | ...
812 | | [Arguments] | ${node} | ${Interface}
813 | | Configure interface unnumbered | ${node} | ${interface}