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