Add flow test suites
[csit.git] / resources / libraries / robot / shared / traffic.robot
1 # Copyright (c) 2021 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_dst_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 | | ... | - traffic_script - Scapy Traffic script used for validation.
57 | | ... | Type: string
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_dst_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 | | ... | ${traffic_script}=send_ip_check_headers
74 | |
75 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port}
76 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_dst_port}
77 | | ${args}= | Catenate | --tg_src_mac ${tx_src_mac}
78 | | ... | --tg_dst_mac ${rx_dst_mac} | --dut_if1_mac ${tx_dst_mac}
79 | | ... | --dut_if2_mac ${rx_src_mac} | --src_ip ${src_ip} | --dst_ip ${dst_ip}
80 | | ... | --tx_if ${tx_port_name} | --rx_if ${rx_port_name}
81 | | ${args}= | Run Keyword If | '${encaps_tx}' == '${EMPTY}'
82 | | | ... | Set Variable | ${args}
83 | | ... | ELSE | Catenate
84 | | ... | ${args} | --encaps_tx ${encaps_tx} | --vlan_tx ${vlan_tx}
85 | | ${args}= | Run Keyword If | '${encaps_rx}' == '${EMPTY}'
86 | | | ... | Set Variable | ${args}
87 | | ... | ELSE | Catenate
88 | | ... | ${args} | --encaps_rx ${encaps_rx} | --vlan_rx ${vlan_rx}
89 | | ${args}= | Run Keyword If | '${vlan_outer_tx}' == '${EMPTY}'
90 | | | ... | Set Variable | ${args}
91 | | ... | ELSE | Catenate | ${args} | --vlan_outer_tx ${vlan_outer_tx}
92 | | ${args}= | Run Keyword If | '${vlan_outer_rx}' == '${EMPTY}'
93 | | | ... | Set Variable | ${args}
94 | | ... | ELSE | Catenate | ${args} | --vlan_outer_rx ${vlan_outer_rx}
95 | | Run Traffic Script On Node | ${traffic_script}.py | ${tg_node} | ${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 | IP packet Rx timeout |
137 | | ... | Run Traffic Script On Node | send_ip_check_headers.py
138 | | ... | ${tg_node} | ${args}
139
140 | Send packet and verify marking
141 | | [Documentation] | Send packet and verify DSCP of the received packet.
142 | |
143 | | ... | *Arguments:*
144 | | ... | - node - TG node. Type: dictionary
145 | | ... | - tx_if - TG transmit interface. Type: string
146 | | ... | - rx_if - TG receive interface. Type: string
147 | | ... | - src_mac - Packet source MAC. Type: string
148 | | ... | - dst_mac - Packet destination MAC. Type: string
149 | | ... | - src_ip - Packet source IP address. Type: string
150 | | ... | - dst_ip - Packet destination IP address. Type: string
151 | |
152 | | ... | *Example:*
153 | | ... | \| Send packet and verify marking \| \${nodes['TG']} \| eth1 \| eth2 \
154 | | ... | \| 08:00:27:87:4d:f7 \| 52:54:00:d4:d8:22 \| 192.168.122.2 \
155 | | ... | \| 192.168.122.1 \|
156 | |
157 | | [Arguments] | ${node} | ${tx_if} | ${rx_if} | ${src_mac} | ${dst_mac}
158 | | ... | ${src_ip} | ${dst_ip}
159 | |
160 | | ${tx_if_name}= | Get Interface Name | ${node} | ${tx_if}
161 | | ${rx_if_name}= | Get Interface Name | ${node} | ${rx_if}
162 | | ${args}= | Traffic Script Gen Arg | ${rx_if_name} | ${tx_if_name}
163 | | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip}
164 | | ${dscp_num}= | Get DSCP Num Value | ${dscp}
165 | | ${args}= | Set Variable | ${args} --dscp ${dscp_num}
166 | | Run Traffic Script On Node | policer.py | ${node} | ${args}
167
168 | Send VXLAN encapsulated packet and verify received packet
169 | | [Documentation] | Send VXLAN encapsulated Ethernet frame and check \
170 | | ... | received one.
171 | |
172 | | ... | *Arguments:*
173 | | ... | - tg_node - Node where to run traffic script. Type: dictionary
174 | | ... | - tx_if - Interface from where send VXLAN packet. Type: string
175 | | ... | - rx_if - Interface where receive VXLAN packet. Type: string
176 | | ... | - tx_src_mac - Source MAC address of sent packet. Type: string
177 | | ... | - tx_dst_mac - Destination MAC address of sent packet. Type: string
178 | | ... | - tx_src_ip - Source IP address of sent VXLAN packet. Type: string
179 | | ... | - tx_dst_ip - Destination IP address of sent VXLAN packet.
180 | | ... | Type: string
181 | | ... | - tx_vni - VNI of sent VXLAN packet. Type: string
182 | | ... | - rx_src_ip - Source IP address of received VXLAN packet. Type: string
183 | | ... | - rx_dst_ip - Destination IP address of received VXLAN packet.
184 | | ... | Type: string
185 | | ... | - rx_vni - VNI of received VXLAN packet. Type: string
186 | |
187 | | ... | *Return:*
188 | | ... | - No value returned
189 | |
190 | | ... | *Example:*
191 | |
192 | | ... | \| Send VXLAN encapsulated packet and verify received packet \
193 | | ... | \| \${tg_node} \| port4 \| port4 \
194 | | ... | \| fa:16:3e:6d:f9:c5 \| fa:16:3e:e6:6d:9a \| 192.168.0.1 \
195 | | ... | \| 192.168.0.2 \| ${101} \| 192.168.0.2 \| 192.168.0.1 \| \${102} \|
196 | |
197 | | [Arguments] | ${tg_node} | ${tx_if} | ${rx_if}
198 | | ... | ${tx_src_mac} | ${tx_dst_mac}
199 | | ... | ${tx_src_ip} | ${tx_dst_ip} | ${tx_vni}
200 | | ... | ${rx_src_ip} | ${rx_dst_ip} | ${rx_vni}
201 | | ${tx_if_name}= | Get interface name | ${tg_node} | ${tx_if}
202 | | ${rx_if_name}= | Get interface name | ${tg_node} | ${rx_if}
203 | | ${args}= | Catenate
204 | | ... | --tx_if ${tx_if_name}
205 | | ... | --rx_if ${rx_if_name}
206 | | ... | --tx_src_mac ${tx_src_mac}
207 | | ... | --tx_dst_mac ${tx_dst_mac}
208 | | ... | --tx_src_ip ${tx_src_ip}
209 | | ... | --tx_dst_ip ${tx_dst_ip}
210 | | ... | --tx_vni ${tx_vni}
211 | | ... | --rx_src_ip ${rx_src_ip}
212 | | ... | --rx_dst_ip ${rx_dst_ip}
213 | | ... | --rx_vni ${rx_vni}
214 | | Run Traffic Script On Node | send_vxlan_check_vxlan.py | ${tg_node}
215 | | ... | ${args}
216
217 | Send ICMP echo request and verify answer
218 | | [Documentation] | Run traffic script that waits for ICMP reply and ignores
219 | | ... | all other packets.
220 | |
221 | | ... | *Arguments:*
222 | | ... | - tg_node - TG node where run traffic script. Type: dictionary
223 | | ... | - tg_interface - TG interface where send ICMP echo request.
224 | | ... | Type: string
225 | | ... | - dst_mac - Destination MAC address. Type: string
226 | | ... | - src_mac - Source MAC address. Type: string
227 | | ... | - dst_ip - Destination IP address. Type: string
228 | | ... | - src_ip - Source IP address. Type: string
229 | | ... | - timeout - Wait timeout in seconds (Default: 10). Type: integer
230 | |
231 | | ... | *Example:*
232 | |
233 | | ... | \| Send ICMP echo request and verify answer \
234 | | ... | \| \${nodes['TG']} \| eth2 \
235 | | ... | \| 08:00:27:46:2b:4c \| 08:00:27:66:b8:57 \
236 | | ... | \| 192.168.23.10 \| 192.168.23.1 \| 10 \|
237 | |
238 | | [Arguments] | ${tg_node} | ${tg_interface}
239 | | ... | ${dst_mac} | ${src_mac} | ${dst_ip} | ${src_ip} | ${timeout}=${10}
240 | |
241 | | ${tg_interface_name}= | Get interface name | ${tg_node} | ${tg_interface}
242 | | ${args}= | Catenate | --rx_if ${tg_interface_name}
243 | | ... | --tx_if ${tg_interface_name} | --dst_mac ${dst_mac}
244 | | ... | --src_mac ${src_mac} | --dst_ip ${dst_ip} | --src_ip ${src_ip}
245 | | ... | --timeout ${timeout}
246 | | Run Traffic Script On Node | send_icmp_wait_for_reply.py
247 | | ... | ${tg_node} | ${args}
248
249 | Send IPsec Packet and verify ESP encapsulation in received packet
250 | | [Documentation] | Send IPsec packet from TG to DUT. Receive IPsec packet\
251 | | ... | from DUT on TG and verify ESP encapsulation.
252 | |
253 | | ... | *Arguments:*
254 | | ... | - node - TG node. Type: dictionary
255 | | ... | - tx_interface - TG Interface 1. Type: string
256 | | ... | - rx_interface - TG Interface 2. Type: string
257 | | ... | - tx_dst_mac - Destination MAC for TX interface / DUT interface 1 MAC.
258 | | ... | Type: string
259 | | ... | - rx_src_mac - Source MAC for RX interface / DUT interface 2 MAC.
260 | | ... | Type: string
261 | | ... | - crypto_alg - Encrytion algorithm. Type: enum
262 | | ... | - crypto_key - Encryption key. Type: string
263 | | ... | - integ_alg - Integrity algorithm. Type: enum
264 | | ... | - integ_key - Integrity key. Type: string
265 | | ... | - l_spi - Local SPI. Type: integer
266 | | ... | - r_spi - Remote SPI. Type: integer
267 | | ... | - l_ip - Local IP address. Type: string
268 | | ... | - r_ip - Remote IP address. Type: string
269 | | ... | - l_tunnel - Local tunnel IP address (optional). Type: string
270 | | ... | - r_tunnel - Remote tunnel IP address (optional). Type: string
271 | |
272 | | ... | *Example:*
273 | | ... | \| \${encr_alg}= \| Crypto Alg AES CBC 128 \|
274 | | ... | \| \${auth_alg}= \| Integ Alg SHA1 96 \|
275 | | ... | \| Send IPsec Packet and verify ESP encapsulation in received packet\
276 | | ... | \| \${nodes['TG']} \| eth1 \| eth2 \
277 | | ... | \| 52:54:00:d4:d8:22 \| 52:54:00:d4:d8:3e \| \${encr_alg} \
278 | | ... | \| sixteenbytes_key \| ${auth_alg} \| twentybytessecretkey \
279 | | ... | \| \${1001} \| \00} \| 192.168.3.3 \| 192.168.4.4 \
280 | | ... | \| 192.168.100.2 \| 192.168.100.3 \|
281 | |
282 | | [Arguments] | ${node} | ${tx_interface} | ${rx_interface} | ${tx_dst_mac}
283 | | ... | ${rx_src_mac} | ${crypto_alg} | ${crypto_key} | ${integ_alg}
284 | | ... | ${integ_key} | ${l_spi} | ${r_spi} | ${l_ip} | ${r_ip}
285 | | ... | ${l_tunnel}=${None} | ${r_tunnel}=${None}
286 | |
287 | | ${tx_src_mac}= | Get Interface Mac | ${node} | ${tx_interface}
288 | | ${tx_if_name}= | Get Interface Name | ${node} | ${tx_interface}
289 | | ${rx_dst_mac}= | Get Interface Mac | ${node} | ${rx_interface}
290 | | ${rx_if_name}= | Get Interface Name | ${node} | ${rx_interface}
291 | | ${args}= | Catenate | --rx_if ${rx_if_name} | --tx_if ${tx_if_name}
292 | | ... | --tx_src_mac ${tx_src_mac} | --tx_dst_mac ${tx_dst_mac}
293 | | ... | --rx_src_mac ${rx_src_mac} | --rx_dst_mac ${rx_dst_mac}
294 | | ... | --src_ip ${l_ip} | --dst_ip ${r_ip}
295 | | ${crypto_alg_str}= | Get Crypto Alg Scapy Name | ${crypto_alg}
296 | | ${integ_alg_str}= | Get Integ Alg Scapy Name | ${integ_alg}
297 | | ${args}= | Catenate | ${args} | --crypto_alg ${crypto_alg_str}
298 | | ... | --crypto_key ${crypto_key} | --integ_alg ${integ_alg_str}
299 | | ... | --integ_key ${integ_key} | --l_spi ${l_spi} | --r_spi ${r_spi}
300 | | ${args}= | Set Variable If | "${l_tunnel}" == "${None}" | ${args}
301 | | ... | ${args} --src_tun ${l_tunnel}
302 | | ${args}= | Set Variable If | "${r_tunnel}" == "${None}" | ${args}
303 | | ... | ${args} --dst_tun ${r_tunnel}
304 | | Run Traffic Script On Node | ipsec_policy.py | ${node} | ${args}
305
306 | Send packet and verify LISP encap
307 | | [Documentation] | Send ICMP packet to DUT out one interface and receive\
308 | | ... | a LISP encapsulated packet on the other interface.
309 | |
310 | | ... | *Arguments:*
311 | |
312 | | ... | _NOTE:_ Arguments are based on topology:
313 | | ... | TG(if1)->(if1)DUT(if2)->TG(if2)
314 | |
315 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
316 | | ... | - src_ip - IP of source interface (TG-if1). Type: string
317 | | ... | - dst_ip - IP of destination interface (TG-if2). Type: string
318 | | ... | - tx_src_port - Interface of TG-if1. Type: string
319 | | ... | - tx_src_mac - MAC address of TG-if1. Type: string
320 | | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string
321 | | ... | - rx_port - Interface of TG-if1. Type: string
322 | | ... | - rx_src_mac - MAC address of DUT1-if2. Type: string
323 | | ... | - rx_dst_mac - MAC address of TG-if2. Type: string
324 | | ... | - src_rloc - configured RLOC source address. Type: string
325 | | ... | - dst_rloc - configured RLOC destination address. Type: string
326 | |
327 | | ... | *Return:*
328 | | ... | - No value returned
329 | |
330 | | ... | *Example:*
331 | |
332 | | ... | \| Send packet and verify LISP encap \| \${nodes['TG']} \| 10.0.0.1 \
333 | | ... | \| 32.0.0.1 \| eth2 \| 08:00:27:ee:fd:b3 \| 08:00:27:a2:52:5b \
334 | | ... | \| eth3 \| 08:00:27:4d:ca:7a \| 08:00:27:7d:fd:10 \| 10.0.1.1 \
335 | | ... | \| 10.0.1.2 \|
336 | |
337 | | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_src_port}
338 | | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac}
339 | | ... | ${rx_dst_mac} | ${src_rloc} | ${dst_rloc}
340 | |
341 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port}
342 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
343 | | ${args}= | Catenate | --tg_src_mac | ${tx_src_mac} | --tg_dst_mac
344 | | ... | ${rx_dst_mac} | --dut_if1_mac | ${tx_dst_mac} | --dut_if2_mac
345 | | ... | ${rx_src_mac} | --src_ip | ${src_ip} | --dst_ip | ${dst_ip}
346 | | ... | --tx_if | ${tx_port_name} | --rx_if | ${rx_port_name}
347 | | ... | --src_rloc | ${src_rloc} | --dst_rloc | ${dst_rloc}
348 | | Run Traffic Script On Node | lisp/lisp_check.py | ${tg_node}
349 | | ... | ${args}
350
351 | Send IP Packet and verify ESP encapsulation in received packet
352 | | [Documentation] | Send IP packet from TG to DUT. Receive IPsec packet\
353 | | ... | from DUT on TG and verify ESP encapsulation. Send IPsec packet in\
354 | | ... | opposite direction and verify received IP packet.
355 | |
356 | | ... | *Arguments:*
357 | | ... | - node - TG node. Type: dictionary
358 | | ... | - tx_interface - TG Interface 1. Type: string
359 | | ... | - rx_interface - TG Interface 2. Type: string
360 | | ... | - tx_dst_mac - Destination MAC for TX interface / DUT interface 1 MAC.
361 | | ... | Type: string
362 | | ... | - rx_src_mac - Source MAC for RX interface / DUT interface 2 MAC.
363 | | ... | Type: string
364 | | ... | - crypto_alg - Encrytion algorithm. Type: enum
365 | | ... | - crypto_key - Encryption key. Type: string
366 | | ... | - integ_alg - Integrity algorithm. Type: enum
367 | | ... | - integ_key - Integrity key. Type: string
368 | | ... | - l_spi - Local SPI. Type: integer
369 | | ... | - r_spi - Remote SPI. Type: integer
370 | | ... | - src_ip - Source IP address. Type: string
371 | | ... | - dst_ip - Destination IP address. Type: string
372 | | ... | - src_tun - Source tunnel IP address. Type: string
373 | | ... | - dst_tun - Destination tunnel IP address. Type: string
374 | |
375 | | ... | *Example:*
376 | | ... | \| \${encr_alg}= \| Crypto Alg AES CBC 128 \|
377 | | ... | \| \${auth_alg}= \| Integ Alg SHA1 96 \|
378 | | ... | \| Send IPsec Packet and verify ESP encapsulation in received packet\
379 | | ... | \| \${nodes['TG']} \| eth1 \| eth2 \
380 | | ... | \| 52:54:00:d4:d8:22 \| 52:54:00:d4:d8:3e \| \${encr_alg} \
381 | | ... | \| sixteenbytes_key \| \${auth_alg} \| twentybytessecretkey \
382 | | ... | \| \${1001} \| \${1000} \| 192.168.3.3 \| 192.168.4.4 \
383 | | ... | \| 192.168.100.2 \| 192.168.100.3 \|
384 | |
385 | | [Arguments] | ${node} | ${tx_interface} | ${rx_interface} | ${tx_dst_mac}
386 | | ... | ${rx_src_mac} | ${crypto_alg} | ${crypto_key} | ${integ_alg}
387 | | ... | ${integ_key} | ${l_spi} | ${r_spi} | ${src_ip} | ${dst_ip}
388 | | ... | ${src_tun} | ${dst_tun}
389 | |
390 | | ${tx_src_mac}= | Get Interface Mac | ${node} | ${tx_interface}
391 | | ${tx_if_name}= | Get Interface Name | ${node} | ${tx_interface}
392 | | ${rx_dst_mac}= | Get Interface Mac | ${node} | ${rx_interface}
393 | | ${rx_if_name}= | Get Interface Name | ${node} | ${rx_interface}
394 | | ${crypto_alg_str}= | Get Crypto Alg Scapy Name | ${crypto_alg}
395 | | ${integ_alg_str}= | Get Integ Alg Scapy Name | ${integ_alg}
396 | | ${args}= | Catenate | --rx_if ${rx_if_name} | --tx_if ${tx_if_name}
397 | | ... | --tx_src_mac ${tx_src_mac} | --tx_dst_mac ${tx_dst_mac}
398 | | ... | --rx_src_mac ${rx_src_mac} | --rx_dst_mac ${rx_dst_mac}
399 | | ... | --src_ip ${src_ip} | --dst_ip ${dst_ip}
400 | | ... | --crypto_alg ${crypto_alg_str} | --crypto_key ${crypto_key}
401 | | ... | --integ_alg ${integ_alg_str} | --integ_key ${integ_key}
402 | | ... | --l_spi ${l_spi} | --r_spi ${r_spi} | --src_tun ${src_tun}
403 | | ... | --dst_tun ${dst_tun}
404 | | Run Traffic Script On Node | ipsec_interface.py | ${node} | ${args}
405
406 | Send packet and verify LISP GPE encap
407 | | [Documentation] | Send ICMP packet to DUT out one interface and receive\
408 | | ... | a LISP-GPE encapsulated packet on the other interface.
409 | |
410 | | ... | *Arguments:*
411 | |
412 | | ... | _NOTE:_ Arguments are based on topology:
413 | | ... | TG(if1)->(if1)DUT(if2)->TG(if2)
414 | |
415 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
416 | | ... | - src_ip - IP of source interface (TG-if1). Type: string
417 | | ... | - dst_ip - IP of destination interface (TG-if2). Type: string
418 | | ... | - tx_src_port - Interface of TG-if1. Type: string
419 | | ... | - tx_src_mac - MAC address of TG-if1. Type: string
420 | | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string
421 | | ... | - rx_port - Interface of TG-if1. Type: string
422 | | ... | - rx_src_mac - MAC address of DUT1-if2. Type: string
423 | | ... | - rx_dst_mac - MAC address of TG-if2. Type: string
424 | | ... | - src_rloc - configured RLOC source address. Type: string
425 | | ... | - dst_rloc - configured RLOC destination address. Type: string
426 | |
427 | | ... | *Return:*
428 | | ... | - No value returned
429 | |
430 | | ... | *Example:*
431 | |
432 | | ... | \| Send packet and verify LISP GPE encap \| \${nodes['TG']} \
433 | | ... | \| 10.0.0.1 \| 32.0.0.1 \
434 | | ... | \| eth2 \| 08:00:27:ee:fd:b3 \| 08:00:27:a2:52:5b \
435 | | ... | \| eth3 \| 08:00:27:4d:ca:7a \| 08:00:27:7d:fd:10 \
436 | | ... | \| 10.0.1.1 \| 10.0.1.2 \|
437 | |
438 | | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_src_port} |
439 | | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac}
440 | | ... | ${rx_dst_mac} | ${src_rloc} | ${dst_rloc}
441 | |
442 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port}
443 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
444 | | ${args}= | Catenate | --tg_src_mac | ${tx_src_mac} | --tg_dst_mac
445 | | ... | ${rx_dst_mac} | --dut_if1_mac | ${tx_dst_mac} | --dut_if2_mac
446 | | ... | ${rx_src_mac} | --src_ip | ${src_ip} | --dst_ip | ${dst_ip}
447 | | ... | --tx_if | ${tx_port_name} | --rx_if | ${rx_port_name}
448 | | ... | --src_rloc | ${src_rloc} | --dst_rloc | ${dst_rloc}
449 | | Run Traffic Script On Node | lisp/lispgpe_check.py | ${tg_node}
450 | | ... | ${args}
451
452 | Send packet and verify LISPoTunnel encap
453 | | [Documentation] | Send ICMP packet to DUT out one interface and receive\
454 | | ... | a LISP encapsulated packet on the other interface.
455 | |
456 | | ... | *Arguments:*
457 | |
458 | | ... | _NOTE:_ Arguments are based on topology:
459 | | ... | TG(if1)->(if1)DUT(if2)->TG(if2)
460 | |
461 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
462 | | ... | - src_ip - IP of source interface (TG-if1). Type: string
463 | | ... | - dst_ip - IP of destination interface (TG-if2). Type: string
464 | | ... | - tx_src_port - Interface of TG-if1. Type: string
465 | | ... | - tx_src_mac - MAC address of TG-if1. Type: string
466 | | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string
467 | | ... | - rx_port - Interface of TG-if1. Type: string
468 | | ... | - rx_src_mac - MAC address of DUT1-if2. Type: string
469 | | ... | - rx_dst_mac - MAC address of TG-if2. Type: string
470 | | ... | - src_rloc - configured RLOC source address. Type: string
471 | | ... | - dst_rloc - configured RLOC destination address. Type: string
472 | | ... | - ot_mode - overlay tunnel mode. Type: string
473 | |
474 | | ... | *Return:*
475 | | ... | - No value returned
476 | |
477 | | ... | *Example:*
478 | |
479 | | ... | \| Send packet and verify LISP encap \| \${nodes['TG']} \| 10.0.0.1 \
480 | | ... | \| 32.0.0.1 \| eth2 \| 08:00:27:ee:fd:b3 \| 08:00:27:a2:52:5b \
481 | | ... | \| eth3 \| 08:00:27:4d:ca:7a \| 08:00:27:7d:fd:10 \| 10.0.1.1 \
482 | | ... | \| 10.0.1.2 \|
483 | |
484 | | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_src_port}
485 | | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac}
486 | | ... | ${rx_dst_mac} | ${src_rloc} | ${dst_rloc} | ${ot_mode}
487 | |
488 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port}
489 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
490 | | ${args}= | Catenate | --tg_src_mac | ${tx_src_mac} | --tg_dst_mac
491 | | ... | ${rx_dst_mac} | --dut_if1_mac | ${tx_dst_mac} | --dut_if2_mac
492 | | ... | ${rx_src_mac} | --src_ip | ${src_ip} | --dst_ip | ${dst_ip}
493 | | ... | --tx_if | ${tx_port_name} | --rx_if | ${rx_port_name}
494 | | ... | --src_rloc | ${src_rloc} | --dst_rloc | ${dst_rloc}
495 | | ... | --ot_mode | ${ot_mode}
496 | | Run Traffic Script On Node | lisp/lispgpe_check.py | ${tg_node}
497 | | ... | ${args}
498
499 | Send IPv6 Packet and verify SRv6 encapsulation in received packet
500 | | [Documentation] | Send IP packet from TG to DUT. Receive IPv6 packet with\
501 | | ... | SRv6 extension header from DUT on TG and verify SRv6 encapsulation.\
502 | | ... | Send IPv6 packet with SRv6 extension header in opposite direction and\
503 | | ... | verify received IP packet.
504 | |
505 | | ... | *Arguments:*
506 | | ... | - node - TG node. Type: dictionary
507 | | ... | - tx_interface - TG Interface 1. Type: string
508 | | ... | - rx_interface - TG Interface 2. Type: string
509 | | ... | - tx_dst_mac - Destination MAC for TX interface / DUT interface 1 MAC.
510 | | ... | Type: string
511 | | ... | - rx_src_mac - Source MAC for RX interface / DUT interface 2 MAC.
512 | | ... | Type: string
513 | | ... | - src_ip - Source IP address. Type: string
514 | | ... | - dst_ip - Destination IP address. Type: string
515 | | ... | - dut_srcsid - Source SID on DUT (dir0). Type: string
516 | | ... | - dut_dstsid1 - The first destination SID on DUT (dir1). Type: string
517 | | ... | - tg_srcsid - Source SID on TG (dir1). Type: string
518 | | ... | - tg_dstsid1 - The first destination SID on TG (dir0). Type: string
519 | | ... | - dut_dstsid2 - The second destination SID on DUT (dir1). Type: string
520 | | ... | - tg_dstsid2 - The second destination SID on TG (dir0). Type: string
521 | | ... | - decap - True if decapsulation expected, false if encapsulated packet
522 | | ... | expected on receiving interface (Optional). Type: boolean
523 | | ... | - tg_dstsid3 - The third destination SID on TG (dir0) (Optional).
524 | | ... | Type: string
525 | | ... | - dut_dstsid3 - The third destination SID on DUT (dir1) (Optional).
526 | | ... | Type: string
527 | | ... | - static_proxy - Switch for SRv6 with endpoint to SR-unaware Service
528 | | ... | Function via static proxy (Optional). Type: boolean
529 | |
530 | | ... | *Example:*
531 | | ... | \| Send IPv6 Packet and verify SRv6 encapsulation in received packet\
532 | | ... | \| \${nodes['TG']} \| eth1 \| eth2 \
533 | | ... | \| 52:54:00:d4:d8:22 \| 52:54:00:d4:d8:3e \| 2002:1:: \
534 | | ... | \| 2003:2:: \| 2003:1:: \| 2002:2:: \| decap=${False} \
535 | | ... | \| tg_dstsid3=2002:4:: \| dut_dstsid3=2003:4:: \
536 | | ... | \| static_proxy=${True} \|
537 | |
538 | | [Arguments] | ${node} | ${tx_interface} | ${rx_interface} | ${tx_dst_mac}
539 | | ... | ${rx_src_mac} | ${src_ip} | ${dst_ip} | ${dut_srcsid}
540 | | ... | ${dut_dstsid1} | ${tg_srcsid} | ${tg_dstsid1}
541 | | ... | ${dut_dstsid2}=${None} | ${tg_dstsid2}=${None} | ${decap}=${True}
542 | | ... | ${tg_dstsid3}=${None} | ${dut_dstsid3}=${None}
543 | | ... | ${static_proxy}=${False}
544 | |
545 | | ${tx_src_mac}= | Get Interface Mac | ${node} | ${tx_interface}
546 | | ${tx_if_name}= | Get Interface Name | ${node} | ${tx_interface}
547 | | ${rx_dst_mac}= | Get Interface Mac | ${node} | ${rx_interface}
548 | | ${rx_if_name}= | Get Interface Name | ${node} | ${rx_interface}
549 | | ${args}= | Catenate | --rx_if ${rx_if_name} | --tx_if ${tx_if_name}
550 | | ... | --tx_src_mac ${tx_src_mac} | --tx_dst_mac ${tx_dst_mac}
551 | | ... | --rx_src_mac ${rx_src_mac} | --rx_dst_mac ${rx_dst_mac}
552 | | ... | --src_ip ${src_ip} | --dst_ip ${dst_ip} | --dir0_srcsid ${dut_srcsid}
553 | | ... | --dir0_dstsid1 ${tg_dstsid1} | --dir0_dstsid2 ${tg_dstsid2}
554 | | ... | --dir1_srcsid ${tg_srcsid} | --dir1_dstsid1 ${dut_dstsid1}
555 | | ... | --dir1_dstsid2 ${dut_dstsid2} | --decap ${decap}
556 | | ... | --dir0_dstsid3 ${tg_dstsid3} | --dir1_dstsid3 ${dut_dstsid3}
557 | | ... | --static_proxy ${static_proxy}
558 | | Run Traffic Script On Node | srv6_encap.py | ${node} | ${args}
559
560 | Send TCP or UDP packet and verify network address translations
561 | | [Documentation] | Send TCP or UDP packet from TG-if1 to TG-if2 and response\
562 | | ... | in opposite direction via DUT with configured NAT. Check packet\
563 | | ... | headers on both sides.
564 | |
565 | | ... | *Arguments:*
566 | |
567 | | ... | _NOTE:_ Arguments are based on topology:
568 | | ... | TG(if1)->(if1)DUT(if2)->TG(if2)
569 | |
570 | | ... | - tg_node - Node where to run traffic script. Type: dictionary
571 | | ... | - tx_interface - TG Interface 1. Type: string
572 | | ... | - rx_interface - TG Interface 2. Type: string
573 | | ... | - tx_dst_mac - Destination MAC for TX interface / DUT interface 1 MAC.
574 | | ... | Type: string
575 | | ... | - rx_src_mac - Source MAC for RX interface / DUT interface 2 MAC.
576 | | ... | Type: string
577 | | ... | - src_ip_in - Internal source IP address. Type: string
578 | | ... | - src_ip_out - External source IP address. Type: string
579 | | ... | - dst_ip - Destination IP address. Type: string
580 | | ... | - protocol - TCP or UDP protocol. Type: string
581 | | ... | - src_port_in - Internal source TCP/UDP port. Type: string or integer
582 | | ... | - src_port_out - External source TCP/UDP port; default value: unknown.
583 | | ... | Type: string or integer
584 | | ... | - dst_port - Destination TCP/UDP port. Type: string or integer
585 | |
586 | | ... | *Return:*
587 | | ... | - No value returned
588 | |
589 | | ... | *Example:*
590 | |
591 | | ... | \| Send TCP or UDP packet and verify network address translations \
592 | | ... | \| \${nodes['TG']} \| port1 \| port2 \| 08:00:27:cc:4f:54 \
593 | | ... | \| 08:00:27:c9:6a:d5 \| 192.168.0.0 \| 68.142.68.0 \| 20.0.0.0 \
594 | | ... | \| TCP \| 1024 \| 8080 \|
595 | |
596 | | [Arguments] | ${tg_node} | ${tx_interface} | ${rx_interface} | ${tx_dst_mac}
597 | | ... | ${rx_src_mac} | ${src_ip_in} | ${src_ip_out} | ${dst_ip}
598 | | ... | ${protocol} | ${src_port_in} | ${dst_port} | ${src_port_out}=unknown
599 | |
600 | | ${tx_src_mac}= | Get Interface Mac | ${tg_node} | ${tx_interface}
601 | | ${tx_if_name}= | Get Interface Name | ${tg_node} | ${tx_interface}
602 | | ${rx_dst_mac}= | Get Interface Mac | ${tg_node} | ${rx_interface}
603 | | ${rx_if_name}= | Get Interface Name | ${tg_node} | ${rx_interface}
604 | | ${args}= | Catenate | --rx_if ${rx_if_name} | --tx_if ${tx_if_name}
605 | | ... | --tx_src_mac ${tx_src_mac} | --tx_dst_mac ${tx_dst_mac}
606 | | ... | --rx_src_mac ${rx_src_mac} | --rx_dst_mac ${rx_dst_mac}
607 | | ... | --src_ip_in ${src_ip_in} | --src_ip_out ${src_ip_out}
608 | | ... | --dst_ip ${dst_ip} | --protocol ${protocol}
609 | | ... | --src_port_in ${src_port_in} | --src_port_out ${src_port_out}
610 | | ... | --dst_port ${dst_port}
611 | | Run Traffic Script On Node | nat.py | ${tg_node} | ${args}
612
613 | Send IP packet and verify GENEVE encapsulation in received packets
614 | | [Documentation] | Send IP packet from TG to DUT. Receive GENEVE packet\
615 | | ... | from DUT on TG and verify GENEVE encapsulation. Send GENEVE packet in\
616 | | ... | opposite direction and verify received IP packet.
617 | |
618 | | ... | *Arguments:*
619 | | ... | - node - TG node. Type: dictionary
620 | | ... | - tx_interface - TG Interface 1. Type: string
621 | | ... | - rx_interface - TG Interface 2. Type: string
622 | | ... | - tx_dst_mac - Destination MAC for TX interface / DUT interface 1 MAC.
623 | | ... | Type: string
624 | | ... | - rx_src_mac - Source MAC for RX interface / DUT interface 2 MAC.
625 | | ... | Type: string
626 | | ... | - tun_local_ip - GENEVE tunnel source IP address. Type: string
627 | | ... | - tun_remote_ip - GENEVE tunnel destination IP address. Type: string
628 | | ... | - tun_vni - GENEVE tunnel VNI. Type: integer
629 | | ... | - tun_src_ip - Source IP address of original IP packet / inner source
630 | | ... | IP address of GENEVE packet. Type: string
631 | | ... | - tun_dst_ip - Destination IP address of original IP packet / inner
632 | | ... | destination IP address of GENEVE packet. Type: string
633 | |
634 | | ... | *Example:*
635 | | ... | \| Send IP packet and verify GENEVE encapsulation in received packets\
636 | | ... | \| \${nodes['TG']} \| eth1 \| eth2 \
637 | | ... | \| 52:54:00:d4:d8:22 \| 52:54:00:d4:d8:3e \| 1.1.1.2 \| 1.1.1.1 \
638 | | ... | \| 1 \| 10.128.1.0 \| 10.0.1.0 \| 24 \|11.0.1.2\|
639 | |
640 | | [Arguments] | ${node} | ${tx_interface} | ${rx_interface}
641 | | ... | ${tx_dst_mac} | ${rx_src_mac} | ${tun_local_ip} | ${tun_remote_ip}
642 | | ... | ${tun_vni} | ${tun_src_ip} | ${tun_dst_ip}
643 | |
644 | | ${tx_src_mac}= | Get Interface Mac | ${node} | ${tx_interface}
645 | | ${tx_if_name}= | Get Interface Name | ${node} | ${tx_interface}
646 | | ${rx_dst_mac}= | Get Interface Mac | ${node} | ${rx_interface}
647 | | ${rx_if_name}= | Get Interface Name | ${node} | ${rx_interface}
648 | | ${args}= | Catenate | --rx_if ${rx_if_name} | --tx_if ${tx_if_name}
649 | | ... | --tx_src_mac ${tx_src_mac} | --tx_dst_mac ${tx_dst_mac}
650 | | ... | --rx_src_mac ${rx_src_mac} | --rx_dst_mac ${rx_dst_mac}
651 | | ... | --tun_local_ip ${tun_local_ip} | --tun_remote_ip ${tun_remote_ip}
652 | | ... | --tun_vni ${tun_vni} | --tun_src_ip ${tun_src_ip}
653 | | ... | --tun_dst_ip ${tun_dst_ip}
654 | | Run Traffic Script On Node | geneve_tunnel.py | ${node} | ${args}
655
656 | Send flow packet and verify action
657 | | [Documentation] | Send packet and verify the correctness of flow action.
658 | |
659 | | ... | *Arguments:*
660 | |
661 | | ... | _NOTE:_ Arguments are based on topology:
662 | | ... | TG(if1)->(if1)DUT
663 | |
664 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
665 | | ... | - tx_interface - TG Interface 1. Type: string
666 | | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string
667 | | ... | - flow_type - Flow packet type. Type: string
668 | | ... | - proto - Flow packet protocol. Type: string
669 | | ... | - src_ip - Source ip address. Type: string
670 | | ... | - dst_ip - Destination IP address. Type: string
671 | | ... | - src_port - Source port. Type: int
672 | | ... | - dst_port - Destination port. Type: int
673 | | ... | - value - Additional packet value. Type: integer
674 | | ... | - traffic_script - Traffic script that send packet. Type: string
675 | | ... | - action - drop, mark or redirect-to-queue. Type: string
676 | | ... | - action_value - action value. Type: integer
677 | |
678 | | ... | *Return:*
679 | | ... | - No value returned
680 | |
681 | | ... | *Example:*
682 | | ... | \| Send flow packet and verify actions \| ${nodes['TG']} \| eth2 \
683 | | ... | \| 08:00:27:a2:52:5b \| IP4 \| UDP \
684 | | ... | \| src_ip=1.1.1.1 \| dst_ip=2.2.2.2 \
685 | | ... | \| src_port=${100} \| dst_port=${200} \
686 | | ... | \| traffic_script=send_flow_packet \
687 | | ... | \|action=mark \| action_value=${3} \|
688 | |
689 | | [Arguments] | ${tg_node} | ${tx_interface} | ${tx_dst_mac}
690 | | ... | ${flow_type} | ${proto}
691 | | ... | ${src_ip}=${None} | ${dst_ip}=${None}
692 | | ... | ${src_port}=${None} | ${dst_port}=${None}
693 | | ... | ${value}=${None}
694 | | ... | ${traffic_script}=send_flow_packet
695 | | ... | ${action}=redirect-to-queue
696 | | ... | ${action_value}=${3}
697 | |
698 | | ${tx_src_mac}= | Get Interface Mac | ${tg_node} | ${tx_interface}
699 | | ${tx_if_name}= | Get interface name | ${tg_node} | ${tx_interface}
700 | | ${args}= | Catenate
701 | | ... | --tg_if1_mac ${tx_src_mac} | --dut_if1_mac ${tx_dst_mac}
702 | | ... | --tx_if ${tx_if_name} | --flow_type ${flow_type} | --proto ${proto}
703 | | ... | --src_ip ${src_ip} | --dst_ip ${dst_ip}
704 | | ... | --src_port ${src_port} | --dst_port ${dst_port}
705 | | ... | --value ${value}
706 | | Run Traffic Script On Node | ${traffic_script}.py | ${tg_node} | ${args}
707 | | Vpp Verify Flow action | ${dut1} | ${action} | ${action_value}
708 | | ... | ${tx_src_mac} | ${tx_dst_mac}
709 | | ... | ${src_ip} | ${dst_ip}