Improve pf layer
[csit.git] / resources / libraries / robot / overlay / lisp.robot
1 # Copyright (c) 2020 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Library  | resources.libraries.python.LispSetup.LispAdjacency
16 | Library  | resources.libraries.python.LispSetup.LispEidTableMap
17 | Library  | resources.libraries.python.LispSetup.LispLocalEid
18 | Library  | resources.libraries.python.LispSetup.LispLocator
19 | Library  | resources.libraries.python.LispSetup.LispLocatorSet
20 | Library  | resources.libraries.python.LispSetup.LispRemoteMapping
21 | Resource | resources/libraries/robot/shared/default.robot
22
23 *** Keywords ***
24 | Configure topology for IPv4 LISP testing
25 | | [Documentation] | Setup topology for IPv4 LISP testing.
26 | |
27 | | ... | *Example:*
28 | | ... | \| Configure topology for IPv4 LISP testing \|
29 | |
30 | | Set interfaces in path up
31 | | VPP Interface Set IP Address
32 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${dut_if1_ip4} | ${ip4_plen}
33 | | VPP Interface Set IP Address
34 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut_if2_ip4} | ${ip4_plen}
35 | | VPP Add IP Neighbor
36 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${src_ip4} | ${TG_pf1_mac}[0]
37 | | VPP Add IP Neighbor
38 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dst_ip4} | ${TG_pf2_mac}[0]
39 | | VPP Add IP Neighbor
40 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${tg_if2_ip4} | ${TG_pf2_mac}[0]
41
42 | Configure topology for IPv6 LISP testing
43 | | [Documentation] | Setup topology fo IPv6 LISP testing.
44 | |
45 | | ... | *Example:*
46 | | ... | \| Configure topology for IPv6 LISP testing \|
47 | |
48 | | Set interfaces in path up
49 | | VPP Interface Set IP Address
50 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${dut_if1_ip6} | ${ip6_plen}
51 | | VPP Interface Set IP Address
52 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut_if2_ip6} | ${ip6_plen}
53 | | VPP Add IP Neighbor
54 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${src_ip6} | ${TG_pf1_mac}[0]
55 | | VPP Add IP Neighbor
56 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dst_ip6} | ${TG_pf2_mac}[0]
57 | | VPP Add IP Neighbor
58 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${tg_if2_ip6} | ${TG_pf2_mac}[0]
59
60 | Configure LISP in 2-node circular topology
61 | | [Documentation] | Configure LISP topology in 2-node circular topology.
62 | |
63 | | ... | *Arguments:*
64 | | ... | - dut1 - DUT1 node. Type: dictionary
65 | | ... | - dut1_if - DUT1 node interface. Type: string
66 | | ... | - dut1_int_index - DUT1 node interface index. Type: integer
67 | | ... | - locator_set - Locator set values. Type: dictionary
68 | | ... | - dut1_eid - DUT1 node eid address. Type: dictionary
69 | | ... | - dut1_static_adjacency - DUT1 static adjacency. Type: dictionary
70 | | ... | - is_gpe - To enable GPE. Other than zero to enable Type: integer
71 | | ... | - vni_table - vni table Eid Table Mapping Type: integer
72 | | ... | - vrf_table - vrf table Eid Table Mapping Type: integer
73 | |
74 | | ... | *Return:*
75 | | ... | - No value returned
76 | |
77 | | ... | *Example:*
78 | | ... | \| Configure LISP in 2-node circular topology \
79 | | ... | \| ${dut1} \| ${interface_name} \
80 | | ... | \| None \| ${locator_set} \| ${dut1_eid} \
81 | | ... | \| ${dut1_static_adjacency} \|
82 | |
83 | | [Arguments]
84 | | ... | ${dut1} | ${dut1_if} | ${dut1_int_index}
85 | | ... | ${locator_set} | ${dut1_eid}
86 | | ... | ${dut1_static_adjacency}
87 | | ... | ${is_gpe}=0
88 | | ... | ${vni_table}=0 | ${vrf_table}=0
89 | |
90 | | # DUT1 settings:
91 | | ${dut1_int_index}= | Run Keyword If | ${dut1_int_index} is None
92 | | ... | Get Interface Sw Index | ${dut1} | ${dut1_if}
93 | | ... | ELSE | Set Variable | ${dut1_int_index}
94 | | Enable Lisp | ${dut1}
95 | | Run keyword if | ${is_gpe} != 0
96 | | ... | Enable Lisp GPE | ${dut1}
97 | | Vpp Add Lisp Locator Set | ${dut1} | ${locator_set['locator_name']}
98 | | Vpp Add Lisp Locator | ${dut1} | ${locator_set['locator_name']}
99 | | ... | ${dut1_int_index} | ${locator_set['priority']}
100 | | ... | ${locator_set['weight']}
101 | | Run keyword if | ${is_gpe} != 0
102 | | ... | Vpp Lisp Eid Table Mapping | ${dut1}
103 | | ... | ${vni_table}
104 | | ... | vrf=${vrf_table}
105 | | Vpp Add Lisp Local Eid | ${dut1} | ${dut1_eid['locator_name']}
106 | | ... | ${dut1_eid['vni']} | ${dut1_eid['eid']} | ${dut1_eid['prefix']}
107 | | Vpp Add Lisp Remote Mapping | ${dut1} | ${dut1_static_adjacency['vni']}
108 | | ... | ${dut1_static_adjacency['deid']}
109 | | ... | ${dut1_static_adjacency['prefix']}
110 | | ... | ${dut1_static_adjacency['seid']}
111 | | ... | ${dut1_static_adjacency['prefix']}
112 | | ... | ${dut1_static_adjacency['rloc']}
113 | | Vpp Add Lisp Adjacency | ${dut1} | ${dut1_static_adjacency['vni']}
114 | | ... | ${dut1_static_adjacency['deid']}
115 | | ... | ${dut1_static_adjacency['prefix']}
116 | | ... | ${dut1_static_adjacency['seid']}
117 | | ... | ${dut1_static_adjacency['prefix']}
118
119 | Configure topology for IPv6 LISPoIP4 testing
120 | | [Documentation] | Setup topology fo IPv6 LISPoIPV4 testing.
121 | |
122 | | ... | *Example:*
123 | | ... | \| Configure topology for IPv6 LISPoIP4 testing \|
124 | |
125 | | Set interfaces in path up
126 | | VPP Interface Set IP Address
127 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${dut_if1_ip6} | ${ip6_plen}
128 | | VPP Interface Set IP Address
129 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut_if2_ip4} | ${ip4_plen}
130 | | VPP Add IP Neighbor
131 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${src_ip6} | ${TG_pf1_mac}[0]
132 | | VPP Add IP Neighbor
133 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dst_ip6} | ${TG_pf2_mac}[0]
134 | | VPP Add IP Neighbor
135 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${tg_if2_ip4} | ${TG_pf2_mac}[0]
136
137 | Configure topology for IPv4 LISPoIP6 testing
138 | | [Documentation] | Setup topology fo IPv4 LISPoIPV6 testing.
139 | |
140 | | ... | *Example:*
141 | | ... | \| Configure topology for IPv4 LISPoIP6 testing \|
142 | |
143 | | Set interfaces in path up
144 | | VPP Interface Set IP Address
145 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${dut_if1_ip4} | ${ip4_plen}
146 | | VPP Interface Set IP Address
147 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut_if2_ip6} | ${ip6_plen}
148 | | VPP Add IP Neighbor
149 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${src_ip4} | ${TG_pf1_mac}[0]
150 | | VPP Add IP Neighbor
151 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dst_ip4} | ${TG_pf2_mac}[0]
152 | | VPP Add IP Neighbor
153 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${tg_if2_ip6} | ${TG_pf2_mac}[0]
154
155 | Initialize LISP IPv4 forwarding in 3-node circular topology
156 | | [Documentation] | Custom setup of IPv4 addresses on all DUT nodes and TG \
157 | | ... | Don`t set route.
158 | |
159 | | ... | *Arguments:*
160 | | ... | - dut1_dut2_address - Ip address from DUT1 to DUT2. Type: string
161 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
162 | | ... | - dut2_dut1_address - Ip address from DUT2 to DUT1. Type: string
163 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
164 | | ... | - duts_prefix - ip prefix. Type: int
165 | |
166 | | ... | *Return:*
167 | | ... | - No value returned
168 | |
169 | | ... | *Example:*
170 | | ... | \| Initialize LISP IPv4 forwarding in 3-node circular topology \
171 | | ... | \| ${dut1_dut2_address} \| ${dut1_tg_address} \
172 | | ... | \| ${dut2_dut1_address} \| ${dut2_tg_address} \| ${duts_prefix} \|
173 | |
174 | | [Arguments] | ${dut1_dut2_address} | ${dut1_tg_address}
175 | | ... | ${dut2_dut1_address} | ${dut2_tg_address} | ${duts_prefix}
176 | |
177 | | Set interfaces in path up
178 | | VPP Add IP Neighbor
179 | | ... | ${dut1} | ${DUT1_${int}1}[0] | 10.10.10.2 | ${TG_pf1_mac}[0]
180 | | VPP Add IP Neighbor
181 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut2_dut1_address}
182 | | ... | ${DUT2_${int}1_mac}[0]
183 | | VPP Add IP Neighbor
184 | | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut1_dut2_address}
185 | | ... | ${DUT1_${int}2_mac}[0]
186 | | VPP Add IP Neighbor
187 | | ... | ${dut2} | ${DUT2_${int}2}[0] | 20.20.20.2 | ${TG_pf2_mac}[0]
188 | | VPP Interface Set IP Address
189 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${dut1_tg_address} | ${duts_prefix}
190 | | VPP Interface Set IP Address
191 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut1_dut2_address} | ${duts_prefix}
192 | | VPP Interface Set IP Address
193 | | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut2_dut1_address} | ${duts_prefix}
194 | | VPP Interface Set IP Address
195 | | ... | ${dut2} | ${DUT2_${int}2}[0] | ${dut2_tg_address} | ${duts_prefix}
196
197 | Initialize LISP GPE IPv4 over IPsec in 3-node circular topology
198 | | [Documentation] | Setup Lisp GPE IPv4 forwarding over IPsec.
199 | |
200 | | ... | *Arguments:*
201 | | ... | - encr_alg - Encryption algorithm. Type: string
202 | | ... | - auth_alg - Authentication algorithm. Type: string
203 | |
204 | | ... | *Return:*
205 | | ... | - No value returned
206 | |
207 | | ... | *Example:*
208 | | ... | \| Initialize LISP GPE IPv4 over IPsec in 3-node circular topology\
209 | | ... | \| ${encr_alg} \| ${auth_alg}
210 | |
211 | | [Arguments] | ${encr_alg} | ${auth_alg}
212 | |
213 | | Generate keys for IPSec | ${encr_alg} | ${auth_alg}
214 | | Initialize LISP IPv4 forwarding in 3-node circular topology
215 | | ... | ${dut1_to_dut2_ip4} | ${dut1_to_tg_ip4} | ${dut2_to_dut1_ip4}
216 | | ... | ${dut2_to_tg_ip4} | ${prefix4}
217 | | Configure LISP GPE topology in 3-node circular topology
218 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${NONE}
219 | | ... | ${dut2} | ${DUT2_${int}1}[0] | ${NONE}
220 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
221 | | ... | ${dut1_ip4_static_adjacency} | ${dut2_ip4_static_adjacency}
222 | | Configure manual keyed connection for IPSec
223 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${encr_alg} | ${encr_key}
224 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
225 | | ... | ${dut1_to_dut2_ip4} | ${dut2_to_dut1_ip4}
226 | | Configure manual keyed connection for IPSec
227 | | ... | ${dut2} | ${DUT2_${int}1}[0] | ${encr_alg} | ${encr_key}
228 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
229 | | ... | ${dut2_to_dut1_ip4} | ${dut1_to_dut2_ip4}
230
231 | Initialize LISP IPv6 forwarding in 3-node circular topology
232 | | [Documentation] | Custom setup of IPv6 topology on all DUT nodes \
233 | | ... | Don`t set route.
234 | |
235 | | ... | *Arguments:*
236 | | ... | - dut1_dut2_address - Ip address from DUT1 to DUT2. Type: string
237 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
238 | | ... | - dut2_dut1_address - Ip address from DUT2 to DUT1. Type: string
239 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
240 | | ... | - duts_prefix - ip prefix. Type: int
241 | |
242 | | ... | *Return:*
243 | | ... | - No value returned
244 | |
245 | | ... | *Example:*
246 | | ... | \| Initialize LISP IPv6 forwarding in 3-node circular topology \
247 | | ... | \| ${dut1_dut2_address} \| ${dut1_tg_address} \
248 | | ... | \| ${dut2_dut1_address} \| ${dut2_tg_address} \| ${duts_prefix} \|
249 | |
250 | | [Arguments] | ${dut1_dut2_address} | ${dut1_tg_address}
251 | | ... | ${dut2_dut1_address} | ${dut2_tg_address} | ${prefix}
252 | |
253 | | Set interfaces in path up
254 | | VPP Interface Set IP Address
255 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${dut1_tg_address} | ${prefix}
256 | | VPP Interface Set IP Address
257 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut1_dut2_address} | ${prefix}
258 | | VPP Interface Set IP Address
259 | | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut2_dut1_address} | ${prefix}
260 | | VPP Interface Set IP Address
261 | | ... | ${dut2} | ${DUT2_${int}2}[0] | ${dut2_tg_address} | ${prefix}
262 | | Vpp All Ra Suppress Link Layer | ${nodes}
263 | | VPP Add IP Neighbor
264 | | ... | ${dut1} | ${DUT1_${int}1}[0] | 2001:1::2 | ${TG_pf1_mac}[0]
265 | | VPP Add IP Neighbor
266 | | ... | ${dut2} | ${DUT2_${int}1}[0] | 2001:2::2 | ${TG_pf2_mac}[0]
267 | | VPP Add IP Neighbor
268 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut2_dut1_address}
269 | | ... | ${DUT2_${int}1_mac}[0]
270 | | VPP Add IP Neighbor
271 | | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut1_dut2_address}
272 | | ... | ${DUT1_${int}2_mac}[0]
273
274 | Initialize LISP IPv4 over IPv6 forwarding in 3-node circular topology
275 | | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \
276 | | ... | Don`t set route.
277 | |
278 | | ... | *Arguments:*
279 | | ... | - dut1_dut2_ip6_address - IPv6 address from DUT1 to DUT2.
280 | | ... | Type: string
281 | | ... | - dut1_tg_ip4_address - IPv4 address from DUT1 to tg. Type: string
282 | | ... | - dut2_dut1_ip6_address - IPv6 address from DUT2 to DUT1.
283 | | ... | Type: string
284 | | ... | - dut1_tg_ip4_address - IPv4 address from DUT1 to tg. Type: string
285 | | ... | - prefix4 - IPv4 prefix. Type: int
286 | | ... | - prefix6 - IPv6 prefix. Type: int
287 | |
288 | | ... | *Return:*
289 | | ... | - No value returned
290 | |
291 | | ... | *Example:*
292 | | ... | \| Lisp IPv4 over IPv6 forwarding initialized in a 3-node circular \
293 | | ... | topology \| ${dut1_dut2_ip6_address} \| ${dut1_tg_ip4_address} \
294 | | ... | \| ${dut2_dut1_ip6_address} \| ${dut2_tg_ip4_address} \
295 | | ... | \| ${prefix4} \| ${prefix6} \|
296 | |
297 | | [Arguments] | ${dut1_dut2_ip6_address} | ${dut1_tg_ip4_address}
298 | | ... | ${dut2_dut1_ip6_address} | ${dut2_tg_ip4_address}
299 | | ... | ${prefix4} | ${prefix6}
300 | |
301 | | Set interfaces in path up
302 | | VPP Interface Set IP Address
303 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${dut1_tg_ip4_address} | ${prefix4}
304 | | VPP Interface Set IP Address
305 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut1_dut2_ip6_address} | ${prefix6}
306 | | VPP Interface Set IP Address
307 | | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut2_dut1_ip6_address} | ${prefix6}
308 | | VPP Interface Set IP Address
309 | | ... | ${dut2} | ${DUT2_${int}2}[0] | ${dut2_tg_ip4_address} | ${prefix4}
310 | | Vpp All Ra Suppress Link Layer | ${nodes}
311 | | VPP Add IP Neighbor
312 | | ... | ${dut1} | ${DUT1_${int}1}[0] | 10.10.10.2 | ${TG_pf1_mac}[0]
313 | | VPP Add IP Neighbor
314 | | ... | ${dut2} | ${DUT2_${int}2}[0] | 20.20.20.2 | ${TG_pf2_mac}[0]
315 | | VPP Add IP Neighbor
316 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut2_dut1_ip6_address}
317 | | ... | ${DUT2_${int}1_mac}[0]
318 | | VPP Add IP Neighbor
319 | | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut1_dut2_ip6_address}
320 | | ... | ${DUT1_${int}2_mac}[0]
321
322 | Initialize LISP IPv6 over IPv4 forwarding in 3-node circular topology
323 | | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \
324 | | ... | Don`t set route.
325 | |
326 | | ... | *Arguments:*
327 | | ... | - dut1_dut2_ip4_address - IPv4 address from DUT1 to DUT2.
328 | | ... | Type: string
329 | | ... | - dut1_tg_ip6_address - IPv6 address from DUT1 to tg. Type: string
330 | | ... | - dut2_dut1_ip4_address - IPv4 address from DUT2 to DUT1.
331 | | ... | Type: string
332 | | ... | - dut1_tg_ip6_address - IPv6 address from DUT1 to tg. Type: string
333 | | ... | - prefix4 - IPv4 prefix. Type: int
334 | | ... | - prefix6 - IPv6 prefix. Type: int
335 | |
336 | | ... | *Return:*
337 | | ... | - No value returned
338 | |
339 | | ... | *Example:*
340 | | ... | \| Lisp IPv6 over IPv4 forwarding initialized in a 3-node circular \
341 | | ... | topology \| ${dut1_dut2_ip4_address} \| ${dut1_tg_ip6_address} \
342 | | ... | \| ${dut2_dut1_ip4_address} \| ${dut2_tg_ip6_address} \
343 | | ... | \| ${prefix6} \| ${prefix4} \|
344 | |
345 | | [Arguments] | ${dut1_dut2_ip4_address} | ${dut1_tg_ip6_address}
346 | | ... | ${dut2_dut1_ip4_address} | ${dut2_tg_ip6_address}
347 | | ... | ${prefix6} | ${prefix4}
348 | |
349 | | Set interfaces in path up
350 | | VPP Interface Set IP Address
351 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${dut1_tg_ip6_address} | ${prefix6}
352 | | VPP Interface Set IP Address
353 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut1_dut2_ip4_address} | ${prefix4}
354 | | VPP Interface Set IP Address
355 | | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut2_dut1_ip4_address} | ${prefix4}
356 | | VPP Interface Set IP Address
357 | | ... | ${dut2} | ${DUT2_${int}2}[0] | ${dut2_tg_ip6_address} | ${prefix6}
358 | | Vpp All Ra Suppress Link Layer | ${nodes}
359 | | VPP Add IP Neighbor
360 | | ... | ${dut1} | ${DUT1_${int}1}[0] | 2001:1::2 | ${TG_pf1_mac}[0]
361 | | VPP Add IP Neighbor
362 | | ... | ${dut2} | ${DUT2_${int}2}[0] | 2001:2::2 | ${TG_pf2_mac}[0]
363 | | VPP Add IP Neighbor
364 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut2_dut1_ip4_address}
365 | | ... | ${DUT2_${int}1_mac}[0]
366 | | VPP Add IP Neighbor
367 | | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut1_dut2_ip4_address}
368 | | ... | ${DUT1_${int}2_mac}[0]