CSIT-1471: Policer - VAT API to PAPI
[csit.git] / resources / libraries / robot / shared / traffic.robot
1 # Copyright (c) 2019 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 """Traffic keywords"""
15
16 *** Settings ***
17 | Library | resources.libraries.python.InterfaceUtil
18 | Library | resources.libraries.python.IPv6Util
19 | Library | resources.libraries.python.NodePath
20 | Library | resources.libraries.python.Policer
21 | Library | resources.libraries.python.topology.Topology
22 | Library | resources.libraries.python.TrafficScriptExecutor
23 | ...
24 | Documentation | Traffic keywords
25
26 *** Keywords ***
27 | Send packet and verify headers
28 | | [Documentation] | Sends packet from IP (with source mac) to IP\
29 | | ... | (with dest mac). There has to be 4 MAC addresses when using\
30 | | ... | 2-node + xconnect (one for each eth).
31 | | ...
32 | | ... | *Arguments:*
33 | | ...
34 | | ... | _NOTE:_ Arguments are based on topology:
35 | | ... | TG(if1)->(if1)DUT(if2)->TG(if2)
36 | | ...
37 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
38 | | ... | - src_ip - IP of source interface (TG-if1). Type: string
39 | | ... | - dst_ip - IP of destination interface (TG-if2). Type: string
40 | | ... | - tx_src_port - Interface of TG-if1. Type: string
41 | | ... | - tx_src_mac - MAC address of TG-if1. Type: string
42 | | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string
43 | | ... | - rx_port - Interface of TG-if1. Type: string
44 | | ... | - rx_src_mac - MAC address of DUT1-if2. Type: string
45 | | ... | - rx_dst_mac - MAC address of TG-if2. Type: string
46 | | ... | - encaps_tx - Expected encapsulation on TX side: Dot1q or Dot1ad
47 | | ... | (Optional). Type: string
48 | | ... | - vlan_tx - VLAN (inner) tag on TX side (Optional). Type: integer
49 | | ... | - vlan_outer_tx - .1AD VLAN (outer) tag on TX side (Optional).
50 | | ... | Type: integer
51 | | ... | - encaps_rx - Expected encapsulation on RX side: Dot1q or Dot1ad
52 | | ... | (Optional). Type: string
53 | | ... | - vlan_rx - VLAN (inner) tag on RX side (Optional). Type: integer
54 | | ... | - vlan_outer_rx - .1AD VLAN (outer) tag on RX side (Optional).
55 | | ... | Type: integer
56 | | ...
57 | | ... | *Return:*
58 | | ... | - No value returned
59 | | ...
60 | | ... | *Example:*
61 | | ...
62 | | ... | \| Send packet and verify headers \| ${nodes['TG']} \| 10.0.0.1 \
63 | | ... | \| 32.0.0.1 \| eth2 \| 08:00:27:ee:fd:b3 \| 08:00:27:a2:52:5b \
64 | | ... | \| eth3 \| 08:00:27:4d:ca:7a \| 08:00:27:7d:fd:10 \|
65 | | ...
66 | | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_src_port}
67 | | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac}
68 | | ... | ${rx_dst_mac} | ${encaps_tx}=${EMPTY} | ${vlan_tx}=${EMPTY}
69 | | ... | ${vlan_outer_tx}=${EMPTY} | ${encaps_rx}=${EMPTY}
70 | | ... | ${vlan_rx}=${EMPTY} | ${vlan_outer_rx}=${EMPTY}
71 | | ...
72 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port}
73 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
74 | | ${args}= | Catenate | --tg_src_mac ${tx_src_mac}
75 | | ... | --tg_dst_mac ${rx_dst_mac} | --dut_if1_mac ${tx_dst_mac}
76 | | ... | --dut_if2_mac ${rx_src_mac} | --src_ip ${src_ip} | --dst_ip ${dst_ip}
77 | | ... | --tx_if ${tx_port_name} | --rx_if ${rx_port_name}
78 | | ${args}= | Run Keyword If | '${encaps_tx}' == '${EMPTY}'
79 | | | ... | Set Variable | ${args}
80 | | ... | ELSE | Catenate
81 | | ... | ${args} | --encaps_tx ${encaps_tx} | --vlan_tx ${vlan_tx}
82 | | ${args}= | Run Keyword If | '${encaps_rx}' == '${EMPTY}'
83 | | | ... | Set Variable | ${args}
84 | | ... | ELSE | Catenate
85 | | ... | ${args} | --encaps_rx ${encaps_rx} | --vlan_rx ${vlan_rx}
86 | | ${args}= | Run Keyword If | '${vlan_outer_tx}' == '${EMPTY}'
87 | | | ... | Set Variable | ${args}
88 | | ... | ELSE | Catenate | ${args} | --vlan_outer_tx ${vlan_outer_tx}
89 | | ${args}= | Run Keyword If | '${vlan_outer_rx}' == '${EMPTY}'
90 | | | ... | Set Variable | ${args}
91 | | ... | ELSE | Catenate | ${args} | --vlan_outer_rx ${vlan_outer_rx}
92 | | Run Traffic Script On Node | send_icmp_check_headers.py | ${tg_node} |
93 | | ... | ${args}
94
95 | Packet transmission from port to port should fail
96 | | [Documentation] | Sends packet from ip (with specified mac) to ip\
97 | | ... | (with dest mac). Using keyword : Send packet And Check Headers\
98 | | ... | and subsequently checks the return value.
99 | | ...
100 | | ... | *Arguments:*
101 | | ...
102 | | ... | _NOTE:_ Arguments are based on topology:
103 | | ... | TG(if1)->(if1)DUT(if2)->TG(if2)
104 | | ...
105 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
106 | | ... | - src_ip - IP of source interface (TG-if1). Type: string
107 | | ... | - dst_ip - IP of destination interface (TG-if2). Type: string
108 | | ... | - tx_src_port - Interface of TG-if1. Type: string
109 | | ... | - tx_src_mac - MAC address of TG-if1. Type: string
110 | | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string
111 | | ... | - rx_port - Interface of TG-if1. Type: string
112 | | ... | - rx_src_mac - MAC address of DUT1-if2. Type: string
113 | | ... | - rx_dst_mac - MAC address of TG-if2. Type: string
114 | | ...
115 | | ... | *Return:*
116 | | ... | - No value returned
117 | | ...
118 | | ... | *Example:*
119 | | ...
120 | | ... | \| Packet transmission from port to port should fail \
121 | | ... | \| ${nodes['TG']} \| 10.0.0.1 \ \| 32.0.0.1 \| eth2 \
122 | | ... | \| 08:00:27:a2:52:5b \| eth3 \| 08:00:27:4d:ca:7a \
123 | | ... | \| 08:00:27:ee:fd:b3 \| 08:00:27:7d:fd:10 \|
124 | | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_src_port}
125 | | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac}
126 | | ... | ${rx_dst_mac}
127 | | ...
128 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port}
129 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
130 | | ${args}= | Catenate | --tg_src_mac ${tx_src_mac}
131 | | ... | --tg_dst_mac ${rx_dst_mac} | --dut_if1_mac ${tx_dst_mac}
132 | | ... | --dut_if2_mac ${rx_src_mac} | --src_ip ${src_ip} | --dst_ip ${dst_ip}
133 | | ... | --tx_if ${tx_port_name} | --rx_if ${rx_port_name}
134 | | Run Keyword And Expect Error | ICMP echo Rx timeout |
135 | | ... | Run Traffic Script On Node | send_icmp_check_headers.py
136 | | ... | ${tg_node} | ${args}
137
138 | Send packet and verify ARP request
139 | | [Documentation] | Send IP packet from tx_port and check if ARP Request\
140 | | ... | packet is received on rx_port.
141 | | ...
142 | | ... | *Arguments:*
143 | | ...
144 | | ... | _NOTE:_ Arguments are based on topology:
145 | | ... | TG(if1)->(if1)DUT(if2)->TG(if2)
146 | | ...
147 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
148 | | ... | - tx_src_ip - Source IP address of transferred packet (TG-if1).
149 | | ... | Type: string
150 | | ... | - tx_dst_ip - Destination IP address of transferred packet (TG-if2).
151 | | ... | Type: string
152 | | ... | - tx_port - Interface from which the IP packet is sent (TG-if1).
153 | | ... | Type: string
154 | | ... | - tx_dst_mac - Destination MAC address of IP packet (DUT-if1).
155 | | ... | Type: string
156 | | ... | - rx_port - Interface where the IP packet is received (TG-if2).
157 | | ... | Type: string
158 | | ... | - rx_src_mac - Source MAC address of ARP packet (DUT-if2).
159 | | ... | Type: string
160 | | ... | - rx_arp_src_ip - Source IP address of ARP packet (DUT-if2).
161 | | ... | Type: string
162 | | ... | - rx_arp_dst_ip - Destination IP address of ARP packet. Type: string
163 | | ...
164 | | ... | *Return:*
165 | | ... | - No value returned
166 | | ...
167 | | ... | *Example:*
168 | | ...
169 | | ... | \| Send Packet And Check ARP Packet \| ${nodes['TG']} \| 16.0.0.1 \
170 | | ... | \| 32.0.0.1 \| eth2 \| 08:00:27:cc:4f:54 \
171 | | ... | \| eth4 \| 08:00:27:5b:49:dd \| 192.168.2.1 \| 192.168.2.2 \|
172 | | ...
173 | | [Arguments] | ${tg_node} | ${tx_src_ip} | ${tx_dst_ip} | ${tx_port}
174 | | ... | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac} | ${rx_arp_src_ip}
175 | | ... | ${rx_arp_dst_ip}
176 | | ...
177 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_port}
178 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
179 | | ${args}= | Catenate | --tx_dst_mac ${tx_dst_mac}
180 | | ... | --rx_src_mac ${rx_src_mac} | --tx_src_ip ${tx_src_ip}
181 | | ... | --tx_dst_ip ${tx_dst_ip} | --tx_if ${tx_port_name}
182 | | ... | --rx_if ${rx_port_name} | --rx_arp_src_ip ${rx_arp_src_ip}
183 | | ... | --rx_arp_dst_ip ${rx_arp_dst_ip}
184 | | Run Traffic Script On Node | send_icmp_check_arp.py | ${tg_node} | ${args}
185
186 | Send TCP or UDP packet and verify received packet
187 | | [Documentation] | Sends TCP or UDP packet with specified source\
188 | | ... | and destination port.
189 | | ...
190 | | ... | *Arguments:*
191 | | ...
192 | | ... | _NOTE:_ Arguments are based on topology:
193 | | ... | TG(if1)->(if1)DUT(if2)->TG(if2)
194 | | ...
195 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
196 | | ... | - src_ip - IP of source interface (TG-if1). Type: integer
197 | | ... | - dst_ip - IP of destination interface (TG-if2). Type: integer
198 | | ... | - tx_port - Source interface (TG-if1). Type: string
199 | | ... | - tx_mac - MAC address of source interface (TG-if1). Type: string
200 | | ... | - rx_port - Destionation interface (TG-if1). Type: string
201 | | ... | - rx_mac - MAC address of destination interface (TG-if1). Type: string
202 | | ... | - protocol - Type of protocol. Type: string
203 | | ... | - source_port - Source TCP/UDP port. Type: string or integer
204 | | ... | - destination_port - Destination TCP/UDP port. Type: string or integer
205 | | ...
206 | | ... | *Return:*
207 | | ... | - No value returned
208 | | ...
209 | | ... | *Example:*
210 | | ...
211 | | ... | \| Send TCP or UDP packet and verify received packet \
212 | | ... | \| ${nodes['TG']} \| 16.0.0.1 \| 32.0.0.1 \| eth2 \
213 | | ... | \| 08:00:27:cc:4f:54 \| eth4 \| 08:00:27:c9:6a:d5 \| TCP \| 20 \
214 | | ... | 80 \|
215 | | ...
216 | | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_port} | ${tx_mac}
217 | | ... | ${rx_port} | ${rx_mac} | ${protocol} | ${source_port}
218 | | ... | ${destination_port}
219 | | ...
220 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_port}
221 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
222 | | ${args}= | Catenate | --tx_mac ${tx_mac} | --rx_mac ${rx_mac}
223 | | ... | --src_ip ${src_ip} | --dst_ip ${dst_ip}
224 | | ... | --tx_if ${tx_port_name} | --rx_if ${rx_port_name}
225 | | ... | --protocol ${protocol} | --source_port ${source_port}
226 | | ... | --destination_port ${destination_port}
227 | | Run Traffic Script On Node | send_tcp_udp.py
228 | | ... | ${tg_node} | ${args}
229
230 | TCP or UDP packet transmission should fail
231 | | [Documentation] | Sends TCP or UDP packet with specified source\
232 | | ... | and destination port.
233 | | ...
234 | | ... | *Arguments:*
235 | | ...
236 | | ... | _NOTE:_ Arguments are based on topology:
237 | | ... | TG(if1)->(if1)DUT(if2)->TG(if2)
238 | | ...
239 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
240 | | ... | - src_ip - IP of source interface (TG-if1). Type: integer
241 | | ... | - dst_ip - IP of destination interface (TG-if2). Type: integer
242 | | ... | - tx_port - Source interface (TG-if1). Type: string
243 | | ... | - tx_mac - MAC address of source interface (TG-if1). Type: string
244 | | ... | - rx_port - Destionation interface (TG-if1). Type: string
245 | | ... | - rx_mac - MAC address of destination interface (TG-if1). Type: string
246 | | ... | - protocol - Type of protocol. Type: string
247 | | ... | - source_port - Source TCP/UDP port. Type: string or integer
248 | | ... | - destination_port - Destination TCP/UDP port. Type: string or integer
249 | | ...
250 | | ... | *Return:*
251 | | ... | - No value returned
252 | | ...
253 | | ... | *Example:*
254 | | ...
255 | | ... | \| TCP or UDP packet transmission should fail \| ${nodes['TG']} \
256 | | ... | \| 16.0.0.1 \| 32.0.0.1 \| eth2 \| 08:00:27:cc:4f:54 \
257 | | ... | \| eth4 \| 08:00:27:c9:6a:d5 \| TCP \| 20 \| 80 \|
258 | | ...
259 | | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_port} | ${tx_mac}
260 | | ... | ${rx_port} | ${rx_mac} | ${protocol} | ${source_port}
261 | | ... | ${destination_port}
262 | | ...
263 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_port}
264 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
265 | | ${args}= | Catenate | --tx_mac ${tx_mac} | --rx_mac ${rx_mac}
266 | | ... | --src_ip ${src_ip} | --dst_ip ${dst_ip} | --tx_if ${tx_port_name}
267 | | ... | --rx_if ${rx_port_name} | --protocol ${protocol}
268 | | ... | --source_port ${source_port} | --destination_port ${destination_port}
269 | | Run Keyword And Expect Error | TCP/UDP Rx timeout
270 | | ... | Run Traffic Script On Node | send_tcp_udp.py
271 | | ... | ${tg_node} | ${args}
272
273 | Receive and verify router advertisement packet
274 | | [Documentation] | Wait until RA packet is received and then verify\
275 | | ... | specific fields of received RA packet.
276 | | ...
277 | | ... | *Arguments:*
278 | | ...
279 | | ... | - node - Node where to check for RA packet. Type: dictionary
280 | | ... | - rx_port - Interface where the packet is received. Type: string
281 | | ... | - src_mac - MAC address of source interface from which the link-local\
282 | | ... | IPv6 address is constructed and checked. Type: string
283 | | ... | - interval - Configured retransmit interval. Optional. Type: integer
284 | | ...
285 | | ... | *Return:*
286 | | ... | - No value returned
287 | | ...
288 | | ... | *Example:*
289 | | ...
290 | | ... | \| Receive and verify router advertisement packet \
291 | | ... | \| ${nodes['DUT1']} \| eth2 \| 08:00:27:cc:4f:54 \|
292 | | ...
293 | | [Arguments] | ${node} | ${rx_port} | ${src_mac} | ${interval}=${0}
294 | | ...
295 | | ${rx_port_name}= | Get interface name | ${node} | ${rx_port}
296 | | ${args}= | Catenate | --rx_if ${rx_port_name} | --src_mac ${src_mac}
297 | | ... | --interval ${interval}
298 | | Run Traffic Script On Node | check_ra_packet.py | ${node} | ${args}
299
300 | Send router solicitation and verify response
301 | | [Documentation] | Send RS packet, wait for response and then verify\
302 | | ... | specific fields of received RA packet.
303 | | ...
304 | | ... | *Arguments:*
305 | | ...
306 | | ... | - tg_node - TG node to send RS packet from. Type: dictionary
307 | | ... | - dut_node - DUT node to send RS packet to. Type: dictionary
308 | | ... | - rx_port - Interface where the packet is sent from. Type: string
309 | | ... | - tx_port - Interface where the packet is sent to. Type: string
310 | | ... | - src_ip - Source IP address of RS packet. Optional. If not provided,\
311 | | ... | link local address will be used. Type: string
312 | | ...
313 | | ... | *Return:*
314 | | ... | - No value returned
315 | | ...
316 | | ... | *Example:*
317 | | ...
318 | | ... | \| Send router solicitation and verify response \
319 | | ... | \| ${nodes['TG']} \| ${nodes['DUT1']} \| eth2 \
320 | | ... | \| GigabitEthernet0/8/0 \| 10::10 \|
321 | | ...
322 | | [Arguments] | ${tg_node} | ${dut_node} | ${tx_port} | ${rx_port}
323 | | ... | ${src_ip}=''
324 | | ...
325 | | ${src_mac}= | Get Interface Mac | ${tg_node} | ${tx_port}
326 | | ${dst_mac}= | Get Interface Mac | ${dut_node} | ${rx_port}
327 | | ${src_int_name}= | Get interface name | ${tg_node} | ${tx_port}
328 | | ${dst_int_name}= | Get interface name | ${dut_node} | ${rx_port}
329 | | ${args}= | Catenate | --rx_if ${dst_int_name} | --tx_if ${src_int_name}
330 | | ... | --src_mac ${src_mac} | --dst_mac ${dst_mac} | --src_ip ${src_ip}
331 | | Run Traffic Script On Node | send_rs_check_ra.py
332 | | ... | ${tg_node} | ${args}
333
334 | Send ARP Request
335 | | [Documentation] | Send ARP Request and check if the ARP Response is\
336 | | ... | received.
337 | | ...
338 | | ... | *Arguments:*
339 | | ...
340 | | ... | _NOTE:_ Arguments are based on topology:
341 | | ... | TG(if1)<->(if1)DUT
342 | | ...
343 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
344 | | ... | - tx_port - Interface from which the ARP packet is sent (TG-if1).
345 | | ... | Type: string
346 | | ... | - src_mac - Source MAC address of ARP packet (TG-if1).
347 | | ... | Type: string
348 | | ... | - tgt_mac - Target MAC address which is expected in the response
349 | | ... | (DUT-if1). Type: string
350 | | ... | - src_ip - Source IP address of ARP packet (TG-if1).
351 | | ... | Type: string
352 | | ... | - tgt_ip - Target IP address of ARP packet (DUT-if1).
353 | | ... | Type: string
354 | | ...
355 | | ... | *Return:*
356 | | ... | - No value returned
357 | | ...
358 | | ... | *Example:*
359 | | ...
360 | | ... | \| Send ARP Request \| ${nodes['TG']} \| eth3 \
361 | | ... | \| 08:00:27:cc:4f:54 \| 08:00:27:c9:6a:d5 \
362 | | ... | \| 10.0.0.100 \| 192.168.1.5 \|
363 | | ...
364 | | [Arguments] | ${tg_node} | ${tx_port} | ${src_mac} | ${tgt_mac} | ${src_ip}
365 | | ... | ${tgt_ip}
366 | | ...
367 | | ${args}= | Catenate | --tx_if ${tx_port} | --src_mac ${src_mac}
368 | | ... | --dst_mac ${tgt_mac} | --src_ip ${src_ip} | --dst_ip ${tgt_ip}
369 | | Run Traffic Script On Node | arp_request.py | ${tg_node} | ${args}
370
371 | ARP request should fail
372 | | [Documentation] | Send ARP Request and the ARP Response should not\
373 | | ... | be received.
374 | | ...
375 | | ... | *Arguments:*
376 | | ...
377 | | ... | _NOTE:_ Arguments are based on topology:
378 | | ... | TG(if1)<->(if1)DUT
379 | | ...
380 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
381 | | ... | - tx_port - Interface from which the ARP packet is sent (TG-if1).
382 | | ... | Type: string
383 | | ... | - src_mac - Source MAC address of ARP packet (TG-if1).
384 | | ... | Type: string
385 | | ... | - tgt_mac - Target MAC address which is expected in the response
386 | | ... | (DUT-if1). Type: string
387 | | ... | - src_ip - Source IP address of ARP packet (TG-if1).
388 | | ... | Type: string
389 | | ... | - tgt_ip - Target IP address of ARP packet (DUT-if1).
390 | | ... | Type: string
391 | | ...
392 | | ... | *Return:*
393 | | ... | - No value returned
394 | | ...
395 | | ... | *Example:*
396 | | ...
397 | | ... | \| ARP request should fail \| ${nodes['TG']} \| eth3 \
398 | | ... | \| 08:00:27:cc:4f:54 \| 08:00:27:c9:6a:d5 \
399 | | ... | \| 10.0.0.100 \| 192.168.1.5 \|
400 | | ...
401 | | [Arguments] | ${tg_node} | ${tx_port} | ${src_mac} | ${tgt_mac} | ${src_ip}
402 | | ... | ${tgt_ip}
403 | | ...
404 | | ${args}= | Catenate | --tx_if ${tx_port} | --src_mac ${src_mac}
405 | | ... | --dst_mac ${tgt_mac} | --src_ip ${src_ip} | --dst_ip ${tgt_ip}
406 | | Run Keyword And Expect Error | ARP reply timeout
407 | | ... | Run Traffic Script On Node | arp_request.py | ${tg_node} | ${args}
408
409 | Send packets and verify multipath routing
410 | | [Documentation] | Send 100 IP ICMP packets traffic and check if it is\
411 | | ... | divided into two paths.
412 | | ...
413 | | ... | *Arguments:*
414 | | ...
415 | | ... | _NOTE:_ Arguments are based on topology:
416 | | ... | TG(if1)->(if1)DUT(if2)->TG(if2)
417 | | ...
418 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
419 | | ... | - src_port - Interface of TG-if1. Type: string
420 | | ... | - dst_port - Interface of TG-if2. Type: string
421 | | ... | - src_ip - IP of source interface (TG-if1). Type: string
422 | | ... | - dst_ip - IP of destination interface (TG-if2). Type: string
423 | | ... | - tx_src_mac - MAC address of TG-if1. Type: string
424 | | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string
425 | | ... | - rx_src_mac - MAC address of DUT-if2. Type: string
426 | | ... | - rx_dst_mac_1 - MAC address of interface for path 1. Type: string
427 | | ... | - rx_dst_mac_2 - MAC address of interface for path 2. Type: string
428 | | ...
429 | | ... | *Return:*
430 | | ... | - No value returned
431 | | ...
432 | | ... | *Example:*
433 | | ...
434 | | ... | \| Send Packet And Check Multipath Routing \| ${nodes['TG']} \
435 | | ... | \| eth2 \| eth3 \| 16.0.0.1 \| 32.0.0.1 \
436 | | ... | \| 08:00:27:cc:4f:54 \| 08:00:27:c9:6a:d5 \| 08:00:27:54:59:f9 \
437 | | ... | \| 02:00:00:00:00:02 \| 02:00:00:00:00:03 \|
438 | | ...
439 | | [Arguments] | ${tg_node} | ${src_port} | ${dst_port} | ${src_ip} | ${dst_ip}
440 | | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_src_mac} | ${rx_dst_mac_1}
441 | | ... | ${rx_dst_mac_2}
442 | | ...
443 | | ${src_port_name}= | Get interface name | ${tg_node} | ${src_port}
444 | | ${dst_port_name}= | Get interface name | ${tg_node} | ${dst_port}
445 | | ${args}= | Catenate | --tx_if ${src_port_name}
446 | | ... | --rx_if ${dst_port_name} | --src_ip ${src_ip} | --dst_ip ${dst_ip}
447 | | ... | --tg_if1_mac ${tx_src_mac} | --dut_if1_mac ${tx_dst_mac}
448 | | ... | --dut_if2_mac ${rx_src_mac} | --path_1_mac ${rx_dst_mac_1}
449 | | ... | --path_2_mac ${rx_dst_mac_2}
450 | | Run Traffic Script On Node | send_icmp_check_multipath.py | ${tg_node}
451 | | ... | ${args}
452
453 | Send IPv4 ping packet and verify headers
454 | | [Documentation] | Send ICMP Echo Request message from source port of source\
455 | | ... | node to destination port of destination node and check the received\
456 | | ... | ICMP Echo Reply message for correctness inlcuding source and\
457 | | ... | destination IPv4 and MAC addresses and ttl value. If the destination\
458 | | ... | node is TG type the ttl of received ICMP Echo Request message is\
459 | | ... | checked too and corresponding ICMP Echo Reply message is created.
460 | | ...
461 | | ... | *Arguments:*
462 | | ...
463 | | ... | _NOTE:_ Arguments are based on topology:
464 | | ... | TG(if1)->(if1)DUT(if2)->TG(if2)
465 | | ...
466 | | ... | - tx_node - Source node to execute scripts on (mostly TG).
467 | | ... | Type: dictionary
468 | | ... | - tx_port - Source interface of tx_node. Type: string
469 | | ... | - rx_node - Destinantion node. Type: dictionary
470 | | ... | - rx_port - Destination interface of rx_node. Type: string
471 | | ... | - src_ip - IP address of source interface or source remote host.
472 | | ... | Type: string
473 | | ... | - dst_ip - IP address of destination interface or destination remote
474 | | ... | host. Type: string
475 | | ... | - first_hop_mac - Destination MAC address for the first hop in
476 | | ... | the path. Type: string
477 | | ... | - hops - Expected number of hops. Type: string or integer
478 | | ...
479 | | ... | *Return:*
480 | | ... | - No value returned
481 | | ...
482 | | ... | *Example:*
483 | | ...
484 | | ... | \| Send IPv4 ping packet and verify headers \| ${nodes['TG']} \
485 | | ... | \| eth2 \| ${nodes['DUT1']} \| eth3 \| 16.0.0.1 \| 32.0.0.1 \
486 | | ... | \| 08:00:27:cc:4f:54 \| 1 \|
487 | | ...
488 | | [Arguments] | ${tx_node} | ${tx_port} | ${rx_node} | ${rx_port}
489 | | ... | ${src_ip} | ${dst_ip} | ${first_hop_mac} | ${hops}
490 | | ...
491 | | ${src_mac}= | Get interface MAC | ${tx_node} | ${tx_port}
492 | | ${dst_mac}= | Get interface MAC | ${rx_node} | ${rx_port}
493 | | ${is_dst_tg}= | Is TG node | ${rx_node}
494 | | ${tx_port_name}= | Get interface name | ${tx_node} | ${tx_port}
495 | | ${rx_port_name}= | Get interface name | ${rx_node} | ${rx_port}
496 | | ${args}= | Traffic Script Gen Arg | ${rx_port_name} | ${tx_port_name}
497 | | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip}
498 | | ${args}= | Catenate | ${args} | --hops ${hops}
499 | | ... | --first_hop_mac ${first_hop_mac} | --is_dst_tg ${is_dst_tg}
500 | | Run Traffic Script On Node | ipv4_ping_ttl_check.py | ${tx_node} | ${args}
501
502 | Send IPv6 echo request packet and verify headers
503 | | [Documentation] | Send ICMPv6 Echo Request message from source port of\
504 | | ... | source node to destination port of destination node and check\
505 | | ... | the received ICMPv6 Echo Reply message for correctness inlcuding\
506 | | ... | source and destination IPv4 and MAC addresses and hlim value. If\
507 | | ... | the destination node is TG type the hlim of received ICMP Echo\
508 | | ... | Request message is checked too and corresponding ICMP Echo Reply\
509 | | ... | message is created and sent.
510 | | ...
511 | | ... | *Arguments:*
512 | | ...
513 | | ... | _NOTE:_ Arguments are based on topology:
514 | | ... | TG(if1)->(if1)DUT(if2)->TG(if2)
515 | | ...
516 | | ... | - tx_node - Source node to execute scripts on (mostly TG).
517 | | ... | Type: dictionary
518 | | ... | - tx_port - Source interface of tx_node. Type: string
519 | | ... | - rx_node - Destinantion node. Type: dictionary
520 | | ... | - rx_port - Destination interface of rx_node. Type: string
521 | | ... | - src_ip - IPv6 address of source interface or source remote host.
522 | | ... | Type: string
523 | | ... | - dst_ip - IPv6 address of destination interface or destination remote
524 | | ... | host. Type: string
525 | | ... | - src_nh_mac - Destination MAC address for the first hop in
526 | | ... | the path in direction from source node. Type: string
527 | | ... | - hops - Expected number of hops. Type: string or integer
528 | | ... | - dst_nh_mac - Destination MAC address for the first hop in
529 | | ... | the path in direction from destination node (Optional). Type: string
530 | | ...
531 | | ... | *Return:*
532 | | ... | - No value returned
533 | | ...
534 | | ... | *Example:*
535 | | ...
536 | | ... | \| Send IPv6 echo request packet and verify headers \
537 | | ... | \| ${nodes['TG']} \| eth2 \| ${nodes['DUT1']} \| eth3 \| 3ffe:5f::1 \
538 | | ... | \| 3ffe:5f::2 \| 08:00:27:cc:4f:54 \| 1 \|
539 | | ...
540 | | [Arguments] | ${tx_node} | ${tx_port} | ${rx_node} | ${rx_port} | ${src_ip}
541 | | ... | ${dst_ip} | ${src_nh_mac} | ${hops} | ${dst_nh_mac}=${NONE}
542 | | ...
543 | | ${src_mac}= | Get interface MAC | ${tx_node} | ${tx_port}
544 | | ${dst_mac}= | Get interface MAC | ${rx_node} | ${rx_port}
545 | | ${is_dst_tg}= | Is TG node | ${rx_node}
546 | | ${tx_port_name}= | Get interface name | ${tx_node} | ${tx_port}
547 | | ${rx_port_name}= | Get interface name | ${rx_node} | ${rx_port}
548 | | ${args}= | Traffic Script Gen Arg | ${rx_port_name} | ${tx_port_name}
549 | | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip}
550 | | ${args}= | Catenate | ${args} | --h_num ${hops} | --src_nh_mac ${src_nh_mac}
551 | | ... | --dst_nh_mac ${dst_nh_mac} | --is_dst_tg ${is_dst_tg}
552 | | Run Traffic Script On Node | icmpv6_echo_req_resp.py | ${tx_node} | ${args}
553
554 | Send packet and verify marking
555 | | [Documentation] | Send packet and verify DSCP of the received packet.
556 | | ...
557 | | ... | *Arguments:*
558 | | ... | - node - TG node. Type: dictionary
559 | | ... | - tx_if - TG transmit interface. Type: string
560 | | ... | - rx_if - TG receive interface. Type: string
561 | | ... | - src_mac - Packet source MAC. Type: string
562 | | ... | - dst_mac - Packet destination MAC. Type: string
563 | | ... | - src_ip - Packet source IP address. Type: string
564 | | ... | - dst_ip - Packet destination IP address. Type: string
565 | | ...
566 | | ... | *Example:*
567 | | ... | \| Send packet and verify marking \| ${nodes['TG']} \| eth1 \| eth2 \
568 | | ... | \| 08:00:27:87:4d:f7 \| 52:54:00:d4:d8:22 \| 192.168.122.2 \
569 | | ... | \| 192.168.122.1 \|
570 | | ...
571 | | [Arguments] | ${node} | ${tx_if} | ${rx_if} | ${src_mac} | ${dst_mac}
572 | | ... | ${src_ip} | ${dst_ip}
573 | | ...
574 | | ${tx_if_name}= | Get Interface Name | ${node} | ${tx_if}
575 | | ${rx_if_name}= | Get Interface Name | ${node} | ${rx_if}
576 | | ${args}= | Traffic Script Gen Arg | ${rx_if_name} | ${tx_if_name}
577 | | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip}
578 | | ${dscp_num}= | Get DSCP Num Value | ${dscp}
579 | | ${args}= | Set Variable | ${args} --dscp ${dscp_num}
580 | | Run Traffic Script On Node | policer.py | ${node} | ${args}
581
582 | Send VXLAN encapsulated packet and verify received packet
583 | | [Documentation] | Send VXLAN encapsulated Ethernet frame and check \
584 | | ... | received one.
585 | | ...
586 | | ... | *Arguments:*
587 | | ... | - tg_node - Node where to run traffic script. Type: dictionary
588 | | ... | - tx_if - Interface from where send VXLAN packet. Type: string
589 | | ... | - rx_if - Interface where receive VXLAN packet. Type: string
590 | | ... | - tx_src_mac - Source MAC address of sent packet. Type: string
591 | | ... | - tx_dst_mac - Destination MAC address of sent packet. Type: string
592 | | ... | - tx_src_ip - Source IP address of sent VXLAN packet. Type: string
593 | | ... | - tx_dst_ip - Destination IP address of sent VXLAN packet.
594 | | ... | Type: string
595 | | ... | - tx_vni - VNI of sent VXLAN packet. Type: string
596 | | ... | - rx_src_ip - Source IP address of received VXLAN packet. Type: string
597 | | ... | - rx_dst_ip - Destination IP address of received VXLAN packet.
598 | | ... | Type: string
599 | | ... | - rx_vni - VNI of received VXLAN packet. Type: string
600 | | ...
601 | | ... | *Return:*
602 | | ... | - No value returned
603 | | ...
604 | | ... | *Example:*
605 | | ...
606 | | ... | \| Send VXLAN encapsulated packet and verify received packet \
607 | | ... | \| ${tg_node} \| port4 \| port4 \
608 | | ... | \| fa:16:3e:6d:f9:c5 \| fa:16:3e:e6:6d:9a \| 192.168.0.1 \
609 | | ... | \| 192.168.0.2 \| ${101} \| 192.168.0.2 \| 192.168.0.1 \| ${102} \|
610 | | ...
611 | | [Arguments] | ${tg_node} | ${tx_if} | ${rx_if}
612 | | ... | ${tx_src_mac} | ${tx_dst_mac}
613 | | ... | ${tx_src_ip} | ${tx_dst_ip} | ${tx_vni}
614 | | ... | ${rx_src_ip} | ${rx_dst_ip} | ${rx_vni}
615 | | ${tx_if_name}= | Get interface name | ${tg_node} | ${tx_if}
616 | | ${rx_if_name}= | Get interface name | ${tg_node} | ${rx_if}
617 | | ${args}= | Catenate
618 | | ... | --tx_if ${tx_if_name}
619 | | ... | --rx_if ${rx_if_name}
620 | | ... | --tx_src_mac ${tx_src_mac}
621 | | ... | --tx_dst_mac ${tx_dst_mac}
622 | | ... | --tx_src_ip ${tx_src_ip}
623 | | ... | --tx_dst_ip ${tx_dst_ip}
624 | | ... | --tx_vni ${tx_vni}
625 | | ... | --rx_src_ip ${rx_src_ip}
626 | | ... | --rx_dst_ip ${rx_dst_ip}
627 | | ... | --rx_vni ${rx_vni}
628 | | Run Traffic Script On Node | send_vxlan_check_vxlan.py | ${tg_node}
629 | | ... | ${args}
630
631 | Send Packet And Check Received Copies
632 | | [Documentation] | Sends an ARP or ICMP packet from TG to DUT using one\
633 | | ... | link, then receive a copy of both the sent packet and the DUT's reply\
634 | | ... | on the second link.
635 | | ...
636 | | ... | Used by Honeycomb.
637 | | ...
638 | | ... | *Arguments:*
639 | | ...
640 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
641 | | ... | - tx_src_port - First interface on TG. Type: string
642 | | ... | - tx_src_mac - MAC address of the first interface on TG. Type: string
643 | | ... | - tx_dst_mac - MAC address of the first interface on DUT. Type: string
644 | | ... | - rx_port - Second interface on TG. Type: string
645 | | ... | - src_ip - Packet source IP address. Type: string
646 | | ... | - dst_ip - Packet destination IP address. Type: string
647 | | ... | - ptype - Type of payload, ARP, ICMP or ICMPv6. Type: string
648 | | ...
649 | | ... | *Return:*
650 | | ... | - No value returned
651 | | ...
652 | | ... | *Example:*
653 | | ...
654 | | ... | \| Send Packet And Check Received Copies \| ${nodes['TG']} \| eth1 \
655 | | ... | \| 8:00:27:ee:fd:b3 \| 08:00:27:a2:52:5b \
656 | | ... | \| eth3 \| 192.168.0.2 \| 192.168.0.3 \| ARP \|
657 | | ...
658 | | [Arguments] | ${tg_node} | ${tx_src_port}
659 | | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_port}
660 | | ... | ${src_ip} | ${dst_ip} | ${ptype}
661 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port}
662 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
663 | | ${args}= | Catenate
664 | | ... | --tg_src_mac ${tx_src_mac} --dut_if1_mac ${tx_dst_mac}
665 | | ... | --src_ip ${src_ip} --dst_ip ${dst_ip}
666 | | ... | --tx_if ${tx_port_name} --rx_if | ${rx_port_name}
667 | | ... | --ptype ${ptype}
668 | | Run Traffic Script On Node | span_check.py | ${tg_node} |
669 | | ... | ${args}
670
671 | Send ICMPv4 and check received GRE header
672 | | [Documentation] | Send ICMPv4 packet and check if received packed contains \
673 | | ... | correct GRE, IP, MAC headers.
674 | | ...
675 | | ... | *Arguments:*
676 | | ... | - tg_node - Node where to run traffic script. Type: dictionary
677 | | ... | - tx_if - Interface from where send ICPMv4 packet. Type: string
678 | | ... | - rx_if - Interface where to receive GRE packet. Type: string
679 | | ... | - tx_dst_mac - Destination MAC address of ICMP packet. Type: string
680 | | ... | - rx_dst_mac - Expected destination MAC address of GRE packet.
681 | | ... |   Type: string
682 | | ... | - inner_src_ip - Source IP address of ICMP packet. Type: string
683 | | ... | - inner_dst_ip - Destination IP address of ICMP packet.
684 | | ... |   Type: string
685 | | ... | - outer_src_ip - Source IP address of GRE packet. Type: string
686 | | ... | - outer_dst_ip - Destination IP address of GRE packet.
687 | | ... |   Type: string
688 | | ...
689 | | ... | *Return:*
690 | | ... | - No value returned
691 | | ...
692 | | ... | *Example:*
693 | | ...
694 | | ... | \| Send ICMPv4 and check received GRE header \
695 | | ... | \| ${tg_node} \| ${tg_to_dut_if1} \| ${tg_to_dut_if2} \
696 | | ... | \| ${tx_dst_mac} \| ${rx_dst_mac} \| ${net1_host_address} \
697 | | ... | \| ${net2_host_address} \| ${dut1_ip_address} \| ${dut2_ip_address} \|
698 | | ...
699 | | [Arguments] | ${tg_node} | ${tx_if} | ${rx_if}
700 | | ... | ${tx_dst_mac} | ${rx_dst_mac}
701 | | ... | ${inner_src_ip} | ${inner_dst_ip}
702 | | ... | ${outer_src_ip} | ${outer_dst_ip}
703 | | ${tx_if_name}= | Get interface name | ${tg_node} | ${tx_if}
704 | | ${rx_if_name}= | Get interface name | ${tg_node} | ${rx_if}
705 | | ${args}= | Catenate | --tx_if | ${tx_if_name} | --rx_if | ${rx_if_name}
706 | | ... | --tx_dst_mac | ${tx_dst_mac} | --rx_dst_mac | ${rx_dst_mac}
707 | | ... | --inner_src_ip | ${inner_src_ip} | --inner_dst_ip | ${inner_dst_ip}
708 | | ... | --outer_src_ip | ${outer_src_ip} | --outer_dst_ip | ${outer_dst_ip}
709 | | Run Traffic Script On Node
710 | | ... | send_icmp_check_gre_headers.py | ${tg_node} | ${args}
711
712
713 | Send GRE and check received ICMPv4 header
714 | | [Documentation] | Send IPv4 ICMPv4 packet encapsulated into GRE and \
715 | | ... | check IP, MAC headers on received packed.
716 | | ...
717 | | ... | *Arguments:*
718 | | ... | - tg_node - Node where to run traffic script. Type: dictionary
719 | | ... | - tx_if - Interface from where send ICPMv4 packet. Type: string
720 | | ... | - rx_if - Interface where receive GRE packet. Type: string
721 | | ... | - tx_dst_mac - Destination MAC address of GRE packet. Type: string
722 | | ... | - rx_dst_mac - Expected destination MAC address of ICMP packet.
723 | | ... |   Type: string
724 | | ... | - inner_src_ip - Source IP address of ICMP packet. Type: string
725 | | ... | - inner_dst_ip - Destination IP address of ICMP packet.
726 | | ... |   Type: string
727 | | ... | - outer_src_ip - Source IP address of GRE packet. Type: string
728 | | ... | - outer_dst_ip - Destination IP address of  GRE packet.
729 | | ... |   Type: string
730 | | ...
731 | | ... | *Return:*
732 | | ... | - No value returned
733 | | ...
734 | | ... | *Example:*
735 | | ...
736 | | ... | \| Send GRE and check received ICMPv4 header \| ${tg_node} \
737 | | ... | \| ${tg_to_dut_if2} \| ${tg_to_dut_if1} \| ${tx_dst_mac} \
738 | | ... | \| ${rx_dst_mac} \| ${net2_host_address} \| ${net1_host_address} \
739 | | ... | \| ${dut2_ip_address} \| ${dut1_ip_address} \|
740 | | ...
741 | | [Arguments] | ${tg_node} | ${tx_if} | ${rx_if}
742 | | ... | ${tx_dst_mac} | ${rx_dst_mac}
743 | | ... | ${inner_src_ip} | ${inner_dst_ip}
744 | | ... | ${outer_src_ip} | ${outer_dst_ip}
745 | | ${tx_if_name}= | Get interface name | ${tg_node} | ${tx_if}
746 | | ${rx_if_name}= | Get interface name | ${tg_node} | ${rx_if}
747 | | ${args}= | Catenate | --tx_if | ${tx_if_name} | --rx_if | ${rx_if_name}
748 | | ... | --tx_dst_mac | ${tx_dst_mac} | --rx_dst_mac | ${rx_dst_mac}
749 | | ... | --inner_src_ip | ${inner_src_ip} | --inner_dst_ip | ${inner_dst_ip}
750 | | ... | --outer_src_ip | ${outer_src_ip} | --outer_dst_ip | ${outer_dst_ip}
751 | | Run Traffic Script On Node
752 | | ... | send_gre_check_icmp_headers.py | ${tg_node} | ${args}
753
754 | Send GRE and check received GRE header
755 | | [Documentation] | Send IPv4 UDP packet encapsulated into GRE and \
756 | | ... | check if received packed contains correct MAC GRE, IP, UDP headers.
757 | | ...
758 | | ... | *Arguments:*
759 | | ... | - tg_node - Node where to run traffic script. Type: dictionary
760 | | ... | - tx_if - Interface from where send GRE packet. Type: string
761 | | ... | - rx_if - Interface where to receive GRE packet. Type: string
762 | | ... | - tx_dst_mac - Destination MAC address of transferred packet.
763 | | ... |   Type: string
764 | | ... | - tx_src_mac - Source MAC address of transferred packet. Type: string
765 | | ... | - tx_outer_dst_ip - Destination IP address of GRE packet. Type: string
766 | | ... | - tx_outer_src_ip - Source IP address of GRE packet. Type: string
767 | | ... | - tx_inner_dst_ip - Destination IP address of UDP packet. Type: string
768 | | ... | - tx_inner_src_ip - Source IP address of UDP packet. Type: string
769 | | ... | - rx_dst_mac - Expected destination MAC address. Type: string
770 | | ... | - rx_src_mac - Expected source MAC address. Type: string
771 | | ... | - rx_outer_dst_ip - Expected destination IP address of received GRE
772 | | ... |   packet. Type: string
773 | | ... | - rx_outer_src_ip - Expected source IP address of received GRE
774 | | ... |   packet. Type: string
775 | | ...
776 | | ... | __Note:__
777 | | ... | rx_inner_dst_ip and rx_inner_src_ip should be same as transferred
778 | | ...
779 | | ... | *Return:*
780 | | ... | - No value returned
781 | | ...
782 | | ... | *Example:*
783 | | ... | \| Send GRE and check received GRE header \| ${tg_node} \
784 | | ... | \| port3 \| port3 \| 08:00:27:f3:be:f0 \| 08:00:27:46:2b:4c \
785 | | ... | \| 10.0.0.1 \| 10.0.0.2 \| 192.168.3.100 \| 192.168.2.100 \
786 | | ... | \| 08:00:27:46:2b:4c \| 08:00:27:f3:be:f0 \| 10.0.0.3 \| 10.0.0.1 \|
787 | | ...
788 | | [Arguments] | ${tg_node} | ${tx_if} | ${rx_if}
789 | | ... | ${tx_dst_mac} | ${tx_src_mac}
790 | | ... | ${tx_outer_dst_ip} | ${tx_outer_src_ip}
791 | | ... | ${tx_inner_dst_ip} | ${tx_inner_src_ip}
792 | | ... | ${rx_dst_mac} | ${rx_src_mac}
793 | | ... | ${rx_outer_dst_ip} | ${rx_outer_src_ip}
794 | | ${tx_if_name}= | Get interface name | ${tg_node} | ${tx_if}
795 | | ${rx_if_name}= | Get interface name | ${tg_node} | ${rx_if}
796 | | ${args}= | Catenate | --tx_if | ${tx_if_name} | --rx_if | ${rx_if_name}
797 | | ... | --tx_dst_mac | ${tx_dst_mac} | --tx_src_mac | ${tx_src_mac}
798 | | ... | --tx_outer_dst_ip | ${tx_outer_dst_ip}
799 | | ... | --tx_outer_src_ip | ${tx_outer_src_ip}
800 | | ... | --tx_inner_dst_ip | ${tx_inner_dst_ip}
801 | | ... | --tx_inner_src_ip | ${tx_inner_src_ip}
802 | | ... | --rx_dst_mac | ${rx_dst_mac}
803 | | ... | --rx_src_mac | ${rx_src_mac}
804 | | ... | --rx_outer_dst_ip | ${rx_outer_dst_ip}
805 | | ... | --rx_outer_src_ip | ${rx_outer_src_ip}
806 | | Run Traffic Script On Node
807 | | ... | send_gre_check_gre_headers.py | ${tg_node} | ${args}
808
809 | Send ICMP echo request and verify answer
810 | | [Documentation] | Run traffic script that waits for ICMP reply and ignores
811 | | ... | all other packets.
812 | | ...
813 | | ... | *Arguments:*
814 | | ... | - tg_node - TG node where run traffic script. Type: dictionary
815 | | ... | - tg_interface - TG interface where send ICMP echo request.
816 | | ... | Type: string
817 | | ... | - dst_mac - Destination MAC address. Type: string
818 | | ... | - src_mac - Source MAC address. Type: string
819 | | ... | - dst_ip - Destination IP address. Type: string
820 | | ... | - src_ip - Source IP address. Type: string
821 | | ... | - timeout - Wait timeout in seconds (Default: 10). Type: integer
822 | | ...
823 | | ... | *Example:*
824 | | ...
825 | | ... | \| Send ICMP echo request and verify answer \
826 | | ... | \| ${nodes['TG']} \| eth2 \
827 | | ... | \| 08:00:27:46:2b:4c \| 08:00:27:66:b8:57 \
828 | | ... | \| 192.168.23.10 \| 192.168.23.1 \| 10 \|
829 | | ...
830 | | [Arguments] | ${tg_node} | ${tg_interface}
831 | | ... | ${dst_mac} | ${src_mac} | ${dst_ip} | ${src_ip} | ${timeout}=${10}
832 | | ...
833 | | ${tg_interface_name}= | Get interface name | ${tg_node} | ${tg_interface}
834 | | ${args}= | Catenate | --rx_if ${tg_interface_name}
835 | | ... | --tx_if ${tg_interface_name} | --dst_mac ${dst_mac}
836 | | ... | --src_mac ${src_mac} | --dst_ip ${dst_ip} | --src_ip ${src_ip}
837 | | ... | --timeout ${timeout}
838 | | Run Traffic Script On Node | send_icmp_wait_for_reply.py
839 | | ... | ${tg_node} | ${args}
840
841 | Send IPsec Packet and verify ESP encapsulation in received packet
842 | | [Documentation] | Send IPsec packet from TG to DUT. Receive IPsec packet\
843 | | ... | from DUT on TG and verify ESP encapsulation.
844 | | ...
845 | | ... | *Arguments:*
846 | | ... | - node - TG node. Type: dictionary
847 | | ... | - interface - TG Interface. Type: string
848 | | ... | - dst_mac - Destination MAC. Type: string
849 | | ... | - crypto_alg - Encrytion algorithm. Type: enum
850 | | ... | - crypto_key - Encryption key. Type: string
851 | | ... | - integ_alg - Integrity algorithm. Type: enum
852 | | ... | - integ_key - Integrity key. Type: string
853 | | ... | - l_spi - Local SPI. Type: integer
854 | | ... | - r_spi - Remote SPI. Type: integer
855 | | ... | - l_ip - Local IP address. Type: string
856 | | ... | - r_ip - Remote IP address. Type: string
857 | | ... | - l_tunnel - Local tunnel IP address (optional). Type: string
858 | | ... | - r_tunnel - Remote tunnel IP address (optional). Type: string
859 | | ...
860 | | ... | *Example:*
861 | | ... | \| ${encr_alg}= \| Crypto Alg AES CBC 128 \|
862 | | ... | \| ${auth_alg}= \| Integ Alg SHA1 96 \|
863 | | ... | \| Send IPsec Packet and verify ESP encapsulation in received packet\
864 | | ... | \| ${nodes['TG']} \| eth1 \
865 | | ... | \| 52:54:00:d4:d8:22 \| ${encr_alg} \| sixteenbytes_key \
866 | | ... | \| ${auth_alg} \| twentybytessecretkey \| ${1001} \| ${1000} \
867 | | ... | \| 192.168.3.3 \| 192.168.4.4 \| 192.168.100.2 \| 192.168.100.3 \|
868 | | ...
869 | | [Arguments] | ${node} | ${interface} | ${dst_mac} | ${crypto_alg}
870 | | ... | ${crypto_key} | ${integ_alg} | ${integ_key} | ${l_spi}
871 | | ... | ${r_spi} | ${l_ip} | ${r_ip} | ${l_tunnel}=${None}
872 | | ... | ${r_tunnel}=${None}
873 | | ...
874 | | ${src_mac}= | Get Interface Mac | ${node} | ${interface}
875 | | ${if_name}= | Get Interface Name | ${node} | ${interface}
876 | | ${args}= | Traffic Script Gen Arg | ${if_name} | ${if_name} | ${src_mac}
877 | | ... | ${dst_mac} | ${l_ip} | ${r_ip}
878 | | ${crypto_alg_str}= | Get Crypto Alg Scapy Name | ${crypto_alg}
879 | | ${integ_alg_str}= | Get Integ Alg Scapy Name | ${integ_alg}
880 | | ${args}= | Catenate | ${args} | --crypto_alg ${crypto_alg_str}
881 | | ... | --crypto_key ${crypto_key} | --integ_alg ${integ_alg_str}
882 | | ... | --integ_key ${integ_key} | --l_spi ${l_spi} | --r_spi ${r_spi}
883 | | ${args}= | Set Variable If | "${l_tunnel}" == "${None}" | ${args}
884 | | ... | ${args} --src_tun ${l_tunnel}
885 | | ${args}= | Set Variable If | "${r_tunnel}" == "${None}" | ${args}
886 | | ... | ${args} --dst_tun ${r_tunnel}
887 | | Run Traffic Script On Node | ipsec.py | ${node} | ${args}
888
889 | Send packet and verify LISP encap
890 | | [Documentation] | Send ICMP packet to DUT out one interface and receive\
891 | | ... | a LISP encapsulated packet on the other interface.
892 | | ...
893 | | ... | *Arguments:*
894 | | ...
895 | | ... | _NOTE:_ Arguments are based on topology:
896 | | ... | TG(if1)->(if1)DUT(if2)->TG(if2)
897 | | ...
898 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
899 | | ... | - src_ip - IP of source interface (TG-if1). Type: string
900 | | ... | - dst_ip - IP of destination interface (TG-if2). Type: string
901 | | ... | - tx_src_port - Interface of TG-if1. Type: string
902 | | ... | - tx_src_mac - MAC address of TG-if1. Type: string
903 | | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string
904 | | ... | - rx_port - Interface of TG-if1. Type: string
905 | | ... | - rx_src_mac - MAC address of DUT1-if2. Type: string
906 | | ... | - rx_dst_mac - MAC address of TG-if2. Type: string
907 | | ... | - src_rloc - configured RLOC source address. Type: string
908 | | ... | - dst_rloc - configured RLOC destination address. Type: string
909 | | ...
910 | | ... | *Return:*
911 | | ... | - No value returned
912 | | ...
913 | | ... | *Example:*
914 | | ...
915 | | ... | \| Send packet and verify LISP encap \| ${nodes['TG']} \| 10.0.0.1 \
916 | | ... | \| 32.0.0.1 \| eth2 \| 08:00:27:ee:fd:b3 \| 08:00:27:a2:52:5b \
917 | | ... | \| eth3 \| 08:00:27:4d:ca:7a \| 08:00:27:7d:fd:10 \| 10.0.1.1 \
918 | | ... | \| 10.0.1.2 \|
919 | | ...
920 | | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_src_port}
921 | | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac}
922 | | ... | ${rx_dst_mac} | ${src_rloc} | ${dst_rloc}
923 | | ...
924 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port}
925 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
926 | | ${args}= | Catenate | --tg_src_mac | ${tx_src_mac} | --tg_dst_mac
927 | | ... | ${rx_dst_mac} | --dut_if1_mac | ${tx_dst_mac} | --dut_if2_mac
928 | | ... | ${rx_src_mac} | --src_ip | ${src_ip} | --dst_ip | ${dst_ip}
929 | | ... | --tx_if | ${tx_port_name} | --rx_if | ${rx_port_name}
930 | | ... | --src_rloc | ${src_rloc} | --dst_rloc | ${dst_rloc}
931 | | Run Traffic Script On Node | lisp/lisp_check.py | ${tg_node}
932 | | ... | ${args}
933
934 | Send packet and verify LISP GPE encap
935 | | [Documentation] | Send ICMP packet to DUT out one interface and receive\
936 | | ... | a LISP-GPE encapsulated packet on the other interface.
937 | | ...
938 | | ... | *Arguments:*
939 | | ...
940 | | ... | _NOTE:_ Arguments are based on topology:
941 | | ...             | TG(if1)->(if1)DUT(if2)->TG(if2)
942 | | ...
943 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
944 | | ... | - src_ip - IP of source interface (TG-if1). Type: string
945 | | ... | - dst_ip - IP of destination interface (TG-if2). Type: string
946 | | ... | - tx_src_port - Interface of TG-if1. Type: string
947 | | ... | - tx_src_mac - MAC address of TG-if1. Type: string
948 | | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string
949 | | ... | - rx_port - Interface of TG-if1. Type: string
950 | | ... | - rx_src_mac - MAC address of DUT1-if2. Type: string
951 | | ... | - rx_dst_mac - MAC address of TG-if2. Type: string
952 | | ... | - src_rloc - configured RLOC source address. Type: string
953 | | ... | - dst_rloc - configured RLOC destination address. Type: string
954 | | ...
955 | | ... | *Return:*
956 | | ... | - No value returned
957 | | ...
958 | | ... | *Example:*
959 | | ...
960 | | ... | \| Send packet and verify LISP GPE encap \| ${nodes['TG']} \
961 | | ... | \| 10.0.0.1 \| 32.0.0.1 \
962 | | ... | \| eth2 \| 08:00:27:ee:fd:b3 \| 08:00:27:a2:52:5b \
963 | | ... | \| eth3 \| 08:00:27:4d:ca:7a \| 08:00:27:7d:fd:10 \
964 | | ... | \| 10.0.1.1 \| 10.0.1.2 \|
965 | | ...
966 | | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_src_port} |
967 | | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac}
968 | | ... | ${rx_dst_mac} | ${src_rloc} | ${dst_rloc}
969 | | ...
970 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port}
971 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
972 | | ${args}= | Catenate | --tg_src_mac | ${tx_src_mac} | --tg_dst_mac
973 | | ... | ${rx_dst_mac} | --dut_if1_mac | ${tx_dst_mac} | --dut_if2_mac
974 | | ... | ${rx_src_mac} | --src_ip | ${src_ip} | --dst_ip | ${dst_ip}
975 | | ... | --tx_if | ${tx_port_name} | --rx_if | ${rx_port_name}
976 | | ... | --src_rloc | ${src_rloc} | --dst_rloc | ${dst_rloc}
977 | | Run Traffic Script On Node | lisp/lispgpe_check.py | ${tg_node}
978 | | ... | ${args}
979
980 | Send packet and verify LISPoTunnel encap
981 | | [Documentation] | Send ICMP packet to DUT out one interface and receive\
982 | | ... | a LISP encapsulated packet on the other interface.
983 | | ...
984 | | ... | *Arguments:*
985 | | ...
986 | | ... | _NOTE:_ Arguments are based on topology:
987 | | ... | TG(if1)->(if1)DUT(if2)->TG(if2)
988 | | ...
989 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
990 | | ... | - src_ip - IP of source interface (TG-if1). Type: string
991 | | ... | - dst_ip - IP of destination interface (TG-if2). Type: string
992 | | ... | - tx_src_port - Interface of TG-if1. Type: string
993 | | ... | - tx_src_mac - MAC address of TG-if1. Type: string
994 | | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string
995 | | ... | - rx_port - Interface of TG-if1. Type: string
996 | | ... | - rx_src_mac - MAC address of DUT1-if2. Type: string
997 | | ... | - rx_dst_mac - MAC address of TG-if2. Type: string
998 | | ... | - src_rloc - configured RLOC source address. Type: string
999 | | ... | - dst_rloc - configured RLOC destination address. Type: string
1000 | | ... | - ot_mode - overlay tunnel mode. Type: string
1001 | | ...
1002 | | ... | *Return:*
1003 | | ... | - No value returned
1004 | | ...
1005 | | ... | *Example:*
1006 | | ...
1007 | | ... | \| Send packet and verify LISP encap \| ${nodes['TG']} \| 10.0.0.1 \
1008 | | ... | \| 32.0.0.1 \| eth2 \| 08:00:27:ee:fd:b3 \| 08:00:27:a2:52:5b \
1009 | | ... | \| eth3 \| 08:00:27:4d:ca:7a \| 08:00:27:7d:fd:10 \| 10.0.1.1 \
1010 | | ... | \| 10.0.1.2 \|
1011 | | ...
1012 | | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_src_port}
1013 | | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac}
1014 | | ... | ${rx_dst_mac} | ${src_rloc} | ${dst_rloc} | ${ot_mode}
1015 | | ...
1016 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port}
1017 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
1018 | | ${args}= | Catenate | --tg_src_mac | ${tx_src_mac} | --tg_dst_mac
1019 | | ... | ${rx_dst_mac} | --dut_if1_mac | ${tx_dst_mac} | --dut_if2_mac
1020 | | ... | ${rx_src_mac} | --src_ip | ${src_ip} | --dst_ip | ${dst_ip}
1021 | | ... | --tx_if | ${tx_port_name} | --rx_if | ${rx_port_name}
1022 | | ... | --src_rloc | ${src_rloc} | --dst_rloc | ${dst_rloc}
1023 | | ... | --ot_mode | ${ot_mode}
1024 | | Run Traffic Script On Node | lisp/lispgpe_check.py | ${tg_node}
1025 | | ... | ${args}