CSIT-32: Add lightweight hairpinning test
[csit.git] / resources / libraries / robot / map.robot
1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Variables | resources/libraries/python/topology.py
16 | Library | resources.libraries.python.topology.Topology
17 | Library | resources.libraries.python.DUTSetup
18 | Library | resources.libraries.python.TGSetup
19 | Library | resources.libraries.python.Map
20 | Documentation | Keywords for MAP feature in VPP.
21
22 *** Keywords ***
23 | Send IPv4 UDP and check headers for lightweight 4over6
24 | | [Documentation]
25 | | ... | Send empty UDP to given IPv4 dst and UDP port and check received \
26 | | ... | packets headers (Ethernet, IPv6, IPv4, UDP).
27 | | ...
28 | | ... | *Arguments:*
29 | | ... | - tg_node - Node where to run traffic script. Type: string
30 | | ... | - tx_if - Interface from where to send ICPMv4 packet. Type: string
31 | | ... | - rx_if - Interface where to receive IPinIP packet. Type: string
32 | | ... | - tx_dst_mac - Destination MAC address of IPv4 packet. Type: string
33 | | ... | - tx_dst_ipv4 - Destination IPv4 address. Type: string
34 | | ... | - tx_src_ipv4 - Source IPv4 address. Type: string
35 | | ... | - tx_dst_udp_port - Destination UDP port. Type: integer
36 | | ... | - rx_dst_mac - Expected destination MAC address. Type: string
37 | | ... | - rx_src_mac - Expected source MAC address. Type: string
38 | | ... | - dst_ipv6 - Expected destination IPv6 address. Type: string
39 | | ... | - src_ipv6 - Expected source IPv6 address. Type: string
40 | | ...
41 | | ... | *Return:*
42 | | ... | - No value returned
43 | | ...
44 | | ... | *Example:*
45 | | ...
46 | | ... | \| Send IPv4 UDP and check headers for lightweight 4over6 \
47 | | ... | \| ${tg_node} \| eth3 \| eth2 \| 08:00:27:66:b8:57 \| 20.0.0.1 \
48 | | ... | \| 20.0.0.2 \| 1232 \| 08:00:27:46:2b:4c \| 08:00:27:f3:be:f0 \
49 | | ... | \| 2001:1::2 \| 2001:1::1 \|
50 | | ...
51 | | [Arguments]
52 | | ... | ${tg_node} | ${tx_if} | ${rx_if} | ${tx_dst_mac} | ${tx_dst_ipv4}
53 | | ... | ${tx_src_ipv4} | ${tx_dst_udp_port} | ${rx_dst_mac} | ${rx_src_mac}
54 | | ... | ${dst_ipv6} | ${src_ipv6}
55 | | ...
56 | | ${tx_name}= | Get interface name | ${tg_node} | ${tx_if}
57 | | ${rx_name}= | Get interface name | ${tg_node} | ${rx_if}
58 | | ${args}= | Catenate
59 | | ... | --tx_if | ${tx_name} | --rx_if | ${rx_name}
60 | | ... | --tx_dst_mac | ${tx_dst_mac} | --tx_src_ipv4 | ${tx_src_ipv4}
61 | | ... | --tx_dst_ipv4 | ${tx_dst_ipv4}
62 | | ... | --tx_dst_udp_port | ${tx_dst_udp_port}
63 | | ... | --rx_dst_mac | ${rx_dst_mac} | --rx_src_mac | ${rx_src_mac}
64 | | ... | --src_ipv6 | ${src_ipv6} | --dst_ipv6 | ${dst_ipv6}
65 | | ...
66 | | Run Traffic Script On Node
67 | | ... | send_ipv4_udp_check_lw_4o6.py | ${tg_node} | ${args}
68
69 | Send IPv4 ICMP and check headers for lightweight 4over6
70 | | [Documentation]
71 | | ... | Send ICMP request with ID to given IPv4 destination and \
72 | | ... | check received packets headers (Ethernet, IPv6, IPv4, ICMP).
73 | | ...
74 | | ... | *Arguments:*
75 | | ... | - tg_node - Node where to run traffic script. Type: string
76 | | ... | - tx_if - Interface from where to send ICPMv4 packet. Type: string
77 | | ... | - rx_if - Interface where to receive IPinIP packet. Type: string
78 | | ... | - tx_dst_mac - Destination MAC address of IPv4 packet. Type: string
79 | | ... | - tx_dst_ipv4 - Destination IPv4 address. Type: string
80 | | ... | - tx_src_ipv4 - Source IPv4 address. Type: string
81 | | ... | - tx_icmp_id - ICMP ID. Type: integer
82 | | ... | - rx_dst_mac - Expected destination MAC address. Type: string
83 | | ... | - rx_src_mac - Expected source MAC address. Type: string
84 | | ... | - dst_ipv6 - Expected destination IPv6 address. Type: string
85 | | ... | - src_ipv6 - Expected source IPv6 address. Type: string
86 | | ...
87 | | ... | *Return:*
88 | | ... | - No value returned
89 | | ...
90 | | ... | *Example:*
91 | | ...
92 | | ... | \| Send IPv4 ICMP and check headers for lightweight 4over6 \
93 | | ... | \| ${tg_node} \| eth3 \| eth2 \| 08:00:27:66:b8:57 \| 20.0.0.1 \
94 | | ... | \| 20.0.0.2 \| 1232 \| 08:00:27:46:2b:4c \| 08:00:27:f3:be:f0 \
95 | | ... | \| 2001:1::2 \| 2001:1::1 \|
96 | | ...
97 | | [Arguments]
98 | | ... | ${tg_node} | ${tx_if} | ${rx_if} | ${tx_dst_mac} | ${tx_dst_ipv4}
99 | | ... | ${tx_src_ipv4} | ${tx_icmp_id} | ${rx_dst_mac} | ${rx_src_mac}
100 | | ... | ${dst_ipv6} | ${src_ipv6}
101 | | ...
102 | | ${tx_name}= | Get interface name | ${tg_node} | ${tx_if}
103 | | ${rx_name}= | Get interface name | ${tg_node} | ${rx_if}
104 | | ${args}= | Catenate
105 | | ... | --tx_if | ${tx_name} | --rx_if | ${rx_name}
106 | | ... | --tx_dst_mac | ${tx_dst_mac} | --tx_src_ipv4 | ${tx_src_ipv4}
107 | | ... | --tx_dst_ipv4 | ${tx_dst_ipv4} | --tx_icmp_id | ${tx_icmp_id}
108 | | ... | --rx_dst_mac | ${rx_dst_mac} | --rx_src_mac | ${rx_src_mac}
109 | | ... | --src_ipv6 | ${src_ipv6} | --dst_ipv6 | ${dst_ipv6}
110 | | ...
111 | | Run Traffic Script On Node
112 | | ... | send_ipv4_icmp_check_lw_4o6.py | ${tg_node} | ${args}
113
114 | Send IPv4 UDP in IPv6 and check headers for lightweight 4over6
115 | | [Documentation]
116 | | ... | Send empty UDP in IPv4 in IPv6 and check if IPv4 packet is correctly \
117 | | ... | decapsulated from IPv6.
118 | | ...
119 | | ... | *Arguments:*
120 | | ... | - tg_node - Node where to run traffic script. Type: string
121 | | ... | - tx_if - Interface from where to send ICPMv4 packet. Type: string
122 | | ... | - rx_if - Interface where to receive IPinIP packet. Type: string
123 | | ... | - tx_dst_mac - Destination MAC address of IPv4 packet. Type: string
124 | | ... | - tx_src_mac - Source MAC address of IPv4 packet. Type: string
125 | | ... | - tx_dst_ipv6 - Destination IPv6 address. Type: string
126 | | ... | - tx_src_ipv6 - Source IPv6 address. Type: string
127 | | ... | - tx_dst_ipv4 - Destination IPv4 address. Type: string
128 | | ... | - tx_src_ipv4 - Source IPv4 address. Type: string
129 | | ... | - tx_src_udp_port - Source UDP port. Type: integer
130 | | ... | - rx_dst_mac - Expected destination MAC address. Type: string
131 | | ... | - rx_src_mac - Expected source MAC address. Type: string
132 | | ...
133 | | ... | *Return:*
134 | | ... | - No value returned
135 | | ...
136 | | ... | *Example:*
137 | | ...
138 | | ... | \| Send IPv4 UDP in IPv6 and check headers for lightweight 4over6 \
139 | | ... | \| ${tg_node} \| eth3 \| eth2 \
140 | | ... | \| 08:00:27:66:b8:57 \| 08:00:27:33:54:21 \
141 | | ... | \| 2001:1::2 \| 2001:1::1 \| 20.0.0.1 \| 20.0.0.2 \
142 | | ... | \| 1232 \| 08:00:27:46:2b:4c \| 08:00:27:f3:be:f0 \|
143 | | ...
144 | | [Arguments]
145 | | ... | ${tg_node} | ${tx_if} | ${rx_if} | ${tx_dst_mac} | ${tx_src_mac}
146 | | ... | ${tx_dst_ipv6} | ${tx_src_ipv6} | ${tx_dst_ipv4} | ${tx_src_ipv4}
147 | | ... | ${tx_src_udp_port} | ${rx_dst_mac} | ${rx_src_mac}
148 | | ...
149 | | ${tx_name}= | Get interface name | ${tg_node} | ${tx_if}
150 | | ${rx_name}= | Get interface name | ${tg_node} | ${rx_if}
151 | | ${args}= | Catenate
152 | | ... | --tx_if | ${tx_name} | --rx_if | ${rx_name}
153 | | ... | --tx_dst_mac | ${tx_dst_mac} | --tx_src_mac | ${tx_src_mac}
154 | | ... | --tx_dst_ipv6 | ${tx_dst_ipv6} | --tx_src_ipv6 | ${tx_src_ipv6}
155 | | ... | --tx_dst_ipv4 | ${tx_dst_ipv4} | --tx_src_ipv4 | ${tx_src_ipv4}
156 | | ... | --tx_src_udp_port | ${tx_src_udp_port}
157 | | ... | --rx_dst_mac | ${rx_dst_mac} | --rx_src_mac | ${rx_src_mac}
158 | | ...
159 | | Run Traffic Script On Node
160 | | ... | send_lw_4o6_check_ipv4_udp.py | ${tg_node} | ${args}
161
162 | Send IPv4 UDP in IPv6 and check headers for lightweight hairpinning
163 | | [Documentation]
164 | | ... | Send empty UDP in IPv4 in IPv6 and check if IPv4 packet is correctly \
165 | | ... | decapsulated and re-encapsulated to another lwB4.
166 | | ...
167 | | ... | *Arguments:*
168 | | ... | - tg_node - Node where to run traffic script. Type: string
169 | | ... | - tx_if - Interface from where to send ICPMv4 packet. Type: string
170 | | ... | - rx_if - Interface where to receive IPinIP packet. Type: string
171 | | ... | - tx_dst_mac - Destination MAC address of send IPv6 packet. \
172 | | ... |   Type: string
173 | | ... | - tx_dst_ipv6 - Destination IPv6 address (lwAFTR). Type: string
174 | | ... | - tx_src_ipv6 - Source IPv6 address (lwB4_1). Type: string
175 | | ... | - tx_dst_ipv4 - Destination IPv4 address. Type: string
176 | | ... | - tx_src_ipv4 - Source IPv4 address. Type: string
177 | | ... | - tx_dst_udp_port - Destination UDP port (PSID_2 related). \
178 | | ... |   Type: integer
179 | | ... | - tx_src_udp_port - Source UDP port (PSID_1 related). Type: integer
180 | | ... | - rx_dst_mac - Expected destination MAC address. Type: string
181 | | ... | - rx_src_mac - Expected source MAC address. Type: string
182 | | ... | - rx_dst_ipv6 - Expected destination IPv6 address (lwB4_2). \
183 | | ... |   Type: string
184 | | ... | - rx_src_ipv6 - Expected source IPv6 address (lwAFTR). Type: string
185 | | ...
186 | | ... | *Return:*
187 | | ... | - No value returned
188 | | ...
189 | | ... | *Example:*
190 | | ...
191 | | ... | \| Send IPv4 UDP in IPv6 and check headers for lightweight hairpinning \
192 | | ... | \| ${tg_node} \| port3 \| port3 \| 08:00:27:f3:be:f0 \| 2001:1::1 \
193 | | ... | \| 2001:1::2 \| 20.0.0.1 \| 20.0.0.1 \| ${6232} \| ${1232} \
194 | | ... | \| 08:00:27:46:2b:4c \| 08:00:27:f3:be:f0 \| 2001:1::3 \| 2001:1::1 \|
195 | | ...
196 | | [Arguments]
197 | | ... | ${tg_node} | ${tx_if} | ${rx_if}
198 | | ... | ${tx_dst_mac}
199 | | ... | ${tx_dst_ipv6} | ${tx_src_ipv6}
200 | | ... | ${tx_dst_ipv4} | ${tx_src_ipv4}
201 | | ... | ${tx_dst_udp_port} | ${tx_src_udp_port}
202 | | ... | ${rx_dst_mac} | ${rx_src_mac}
203 | | ... | ${rx_dst_ipv6} | ${rx_src_ipv6}
204 | | ...
205 | | ${tx_name}= | Get interface name | ${tg_node} | ${tx_if}
206 | | ${rx_name}= | Get interface name | ${tg_node} | ${rx_if}
207 | | ${args}= | Catenate
208 | | ... | --tx_if | ${tx_name} | --rx_if | ${rx_name}
209 | | ... | --tx_dst_mac | ${tx_dst_mac}
210 | | ... | --tx_dst_ipv6 | ${tx_dst_ipv6} | --tx_src_ipv6 | ${tx_src_ipv6}
211 | | ... | --tx_dst_ipv4 | ${tx_dst_ipv4} | --tx_src_ipv4 | ${tx_src_ipv4}
212 | | ... | --tx_dst_udp_port | ${tx_dst_udp_port}
213 | | ... | --tx_src_udp_port | ${tx_src_udp_port}
214 | | ... | --rx_dst_mac | ${rx_dst_mac} | --rx_src_mac | ${rx_src_mac}
215 | | ... | --rx_dst_ipv6 | ${rx_dst_ipv6} | --rx_src_ipv6 | ${rx_src_ipv6}
216 | | ...
217 | | Run Traffic Script On Node
218 | | ... | send_lw_4o6_check_hairpinning_udp.py | ${tg_node} | ${args}