FIX: Pylint reduce
[csit.git] / resources / libraries / robot / overlay / srv6.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 *** Settings ***
15 | Library | resources.libraries.python.SRv6
16 | Documentation | Keywords for SRv6 feature in VPP.
17
18 *** Keywords ***
19 | Configure SR LocalSID on DUT
20 | | [Documentation] | Create SRv6 LocalSID and binds it to a particular\
21 | | ... | behavior on the given DUT node.
22 | |
23 | | ... | *Arguments:*
24 | | ... | - dut_node - DUT node where to create localSID on. Type: dictionary
25 | | ... | - local_sid - LocalSID IPv6 address. Type: string
26 | | ... | - behavior - SRv6 LocalSID function. Type: string
27 | | ... | - interface - Interface name (Optional, default value: None; required
28 | | ... | for L2/L3 xconnects). Type: string
29 | | ... | - next_hop - Next hop IPv4/IPv6 address (Optional, default value:
30 | | ... | None; required for L3 xconnects). Type: string
31 | | ... | - fib_table - FIB table for IPv4/IPv6 lookup (Optional, default value:
32 | | ... | None; required for L3 routing). Type: string
33 | | ... | - out_if - Interface name of local interface for sending traffic
34 | | ... | towards the Service Function (Optional, default value: None;
35 | | ... | required for SRv6 endpoint to SR-unaware appliance). Type: string
36 | | ... | - in_if - Interface name of local interface receiving the traffic
37 | | ... | coming back from the Service Function (Optional, default value:
38 | | ... | None; required for SRv6 endpoint to SR-unaware appliance).
39 | | ... | Type: string
40 | | ... | - src_addr - Source address on the packets coming back on in_if
41 | | ... | interface (Optional, default value: None; required for SRv6 endpoint
42 | | ... | to SR-unaware appliance via static proxy). Type: string
43 | | ... | - sid_list - SID list (Optional, default value: []; required for SRv6
44 | | ... | endpoint to SR-unaware appliance via static proxy). Type: list
45 | |
46 | | ... | *Example:*
47 | |
48 | | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT1']} \| B:: \| end \|
49 | | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT1']} \| C:: \
50 | | ... | \| end.dx2 \| interface=GigabitEthernet0/10/0 \|
51 | | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT1']} \| D:: \
52 | | ... | \| end.dx4 \| interface=GigabitEthernet0/8/0 \| next_hop=10.0.0.1 \|
53 | | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT2']} \| E:: \
54 | | ... | \| end.dt6 \| fib_table=2 \|
55 | | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT2']} \| E:: \
56 | | ... | \| end.ad \| next_hop=10.0.0.1 \| out_if=DUT2_VHOST1 \
57 | | ... | \| in_if=DUT2_VHOST2 \|
58 | | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT2']} \| E:: \
59 | | ... | \| end.as \| next_hop=10.0.0.1 \| out_if=DUT2_VHOST1 \
60 | | ... | \| in_if=DUT2_VHOST2 \| src_addr=B:: \| sid_list=['C::', 'D::'] \|
61 | |
62 | | [Arguments] | ${dut_node} | ${local_sid} | ${behavior}
63 | | ... | ${interface}=${None} | ${next_hop}=${None} | ${fib_table}=${None}
64 | | ... | ${out_if}=${None} | ${in_if}=${None} | ${src_addr}=${None}
65 | | ... | @{sid_list}
66 | |
67 | | Configure SR LocalSID | ${dut_node} | ${local_sid} | ${behavior}
68 | | ... | interface=${interface} | next_hop=${next_hop} | fib_table=${fib_table}
69 | | ... | out_if=${out_if} | in_if=${in_if} | src_addr=${src_addr}
70 | | ... | sid_list=${sid_list}
71
72 | Show SR LocalSIDs on DUT
73 | | [Documentation] | Show SRv6 LocalSIDs on the given DUT node.
74 | |
75 | | ... | *Arguments:*
76 | | ... | - dut_node - DUT node where to show SR localSIDs on. Type: dictionary
77 | |
78 | | ... | *Example:*
79 | |
80 | | ... | \| Show SR LocalSIDs on DUT \| ${nodes['DUT1']} \|
81 | |
82 | | [Arguments] | ${dut_node}
83 | |
84 | | Show SR LocalSIDs | ${dut_node}
85
86 | Configure SR Policy on DUT
87 | | [Documentation] | Create SRv6 policy on the given DUT node.
88 | |
89 | | ... | *Arguments:*
90 | | ... | - dut_node - DUT node where to create SRv6 policy on. Type: dictionary
91 | | ... | - bsid - BindingSID - local SID IPv6 address. Type: string
92 | | ... | - mode - Encapsulation / insertion mode. Type: string
93 | | ... | - sid_list - SID list. Type: list
94 | |
95 | | ... | *Example:*
96 | |
97 | | ... | \| Configure SR Policy on DUT \| ${nodes['DUT2']} \| A:: \| encap \
98 | | ... | \| B::\| C:: \|
99 | | ... | \| Configure SR Policy on DUT \| ${nodes['DUT2']} \| D:: \| insert \
100 | | ... | \| E::\| F:: \|
101 | |
102 | | [Arguments] | ${dut_node} | ${bsid} | ${mode} | @{sid_list}
103 | |
104 | | Configure SR Policy | ${dut_node} | ${bsid} | ${sid_list} | mode=${mode}
105
106 | Show SR Policies on DUT
107 | | [Documentation] | Show SRv6 policies on the given DUT node.
108 | |
109 | | ... | *Arguments:*
110 | | ... | - dut_node - DUT node where to show SR policies on. Type: dictionary
111 | |
112 | | ... | *Example:*
113 | |
114 | | ... | \| Show SR Policies on DUT \| ${nodes['DUT1']} \|
115 | |
116 | | [Arguments] | ${dut_node}
117 | |
118 | | Show SR Policies | ${dut_node}
119
120 | Configure SR Steer on DUT
121 | | [Documentation] | Create SRv6 steering policy on the given DUT node.
122 | |
123 | | ... | *Arguments:*
124 | | ... | - dut_node - DUT node where to create SR steering policy on.
125 | | ... | Type: dictionary
126 | | ... | - mode - Mode of operation - L2 or L3. Type: string
127 | | ... | - bsid - BindingSID - local SID IPv6 address. Type: string
128 | | ... | - interface - Interface name (Optional, default value: None; required
129 | | ... | in case of L2 mode). Type: string
130 | | ... | - ip_addr - IPv4/IPv6 address (Optional, default value: None; required
131 | | ... | in case of L3 mode). Type: string
132 | | ... | - prefix - IP address prefix (Optional, default value: None; required
133 | | ... | for L3 mode). Type: integer
134 | |
135 | | ... | *Example:*
136 | |
137 | | ... | \| Configure SR Steer on DUT \| ${nodes['DUT1']} \| L2 \| B:: \
138 | | ... | \| interface=GigabitEthernet0/10/0 \|
139 | | ... | \| Configure SR Steer on DUT \| ${nodes['DUT1']} \| L3 \| C:: \
140 | | ... | \| ip_address=2001::1 \| prefix=64 \|
141 | |
142 | | [Arguments] | ${dut_node} | ${mode} | ${bsid}
143 | | ... | ${interface}=${None} | ${ip_addr}=${None} | ${prefix}=${None}
144 | |
145 | | Configure SR Steer | ${dut_node} | ${mode} | ${bsid}
146 | | ... | interface=${interface} | ip_addr=${ip_addr} | prefix=${prefix}
147
148 | Show SR Steering Policies on DUT
149 | | [Documentation] | Show SRv6 steering policies on the given DUT node.
150 | |
151 | | ... | *Arguments:*
152 | | ... | - dut_node - DUT node where to show SR steering policies on.
153 | | ... | Type: dictionary
154 | |
155 | | ... | *Example:*
156 | |
157 | | ... | \| Show SR Steering Policies on DUT \| ${nodes['DUT1']} \|
158 | |
159 | | [Arguments] | ${dut_node}
160 | |
161 | | Show SR Steering Policies | ${dut_node}
162
163 | Set SR Encaps Source Address on DUT
164 | | [Documentation] | Set SRv6 encapsulation source address on the given DUT
165 | | ... | node.
166 | |
167 | | ... | *Arguments:*
168 | | ... | - dut_node - DUT node where to set SRv6 encapsulation source address
169 | | ... | on. Type: dictionary
170 | | ... | - ip6_addr - Local SID IPv6 address. Type: string
171 | |
172 | | ... | *Example:*
173 | |
174 | | ... | \| Set SR Encaps Source Address on DUT \| ${nodes['DUT1']} \| B:: \|
175 | |
176 | | [Arguments] | ${dut_node} | ${ip6_addr}
177 | |
178 | | Set SR Encaps Source Address | ${dut_node} | ip6_addr=${ip6_addr}
179
180 | Show SR Policies on all DUTs
181 | | [Documentation] | Show SRv6 policies on all DUT nodes in topology.
182 | |
183 | | ... | *Arguments:*
184 | | ... | - nodes - Topology. Type: dictionary
185 | |
186 | | ... | *Example:*
187 | |
188 | | ... | \| Show SR Policies on all DUTs \| ${nodes} \|
189 | |
190 | | [Arguments] | ${nodes}
191 | |
192 | | FOR | ${dut} | IN | @{duts}
193 | | | Show SR Policies | ${nodes['${dut}']}
194 | | END
195
196 | Show SR Steering Policies on all DUTs
197 | | [Documentation] | Show SRv6 steering policies on all DUT nodes in topology.
198 | |
199 | | ... | *Arguments:*
200 | | ... | - nodes - Topology. Type: dictionary
201 | |
202 | | ... | *Example:*
203 | |
204 | | ... | \| Show SR Steering Policies on all DUTs \| ${nodes} \|
205 | |
206 | | [Arguments] | ${nodes}
207 | |
208 | | FOR | ${dut} | IN | @{duts}
209 | | | Show SR Steering Policies | ${nodes['${dut}']}
210 | | END
211
212 | Show SR LocalSIDs on all DUTs
213 | | [Documentation] | Show SRv6 LocalSIDs on all DUT nodes in topology.
214 | |
215 | | ... | *Arguments:*
216 | | ... | - nodes - Topology. Type: dictionary
217 | |
218 | | ... | *Example:*
219 | |
220 | | ... | \| Show SR LocalSIDs on all DUTs \| ${nodes} \|
221 | |
222 | | [Arguments] | ${nodes}
223 | |
224 | | FOR | ${dut} | IN | @{duts}
225 | | | Show SR LocalSIDs | ${nodes['${dut}']}
226 | | END
227
228 | Initialize SRv6 encapsulation with '${n}' x SID '${prepos}' decapsulation
229 | | [Documentation]
230 | | ... | Set UP state on VPP interfaces in path on node(s) in circular
231 | | ... | topology. Get the interface MAC addresses and setup neighbours on all
232 | | ... | VPP interfaces. Setup IPv6 addresses on all interfaces. Set segment
233 | | ... | routing for IPv6 for required number of SIDs and configure IPv6 routes
234 | | ... | on DUT node(s).
235 | |
236 | | ${status} | ${value}= | Run Keyword And Ignore Error
237 | | ... | Variable Should Exist | ${dut2}
238 | | ${dut2_status}= | Set Variable If | '${status}' == 'PASS' | ${True}
239 | | ... | ${False}
240 | |
241 | | VPP Interface Set IP Address
242 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${dut1_if1_ip6} | ${prefix}
243 | | VPP Interface Set IP Address
244 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut1_if2_ip6} | ${prefix}
245 | | Run Keyword If | ${dut2_status}
246 | | ... | VPP Interface Set IP Address
247 | | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut2_if1_ip6} | ${prefix}
248 | | Run Keyword If | ${dut2_status}
249 | | ... | VPP Interface Set IP Address
250 | | ... | ${dut2} | ${DUT2_${int}2}[0] | ${dut2_if2_ip6} | ${prefix}
251 | | Vpp Interfaces RA Suppress On All Nodes | ${nodes}
252 | | FOR | ${number} | IN RANGE | 2 | ${dst_addr_nr}+2
253 | | | ${hexa_nr}= | Convert To Hex | ${number}
254 | | | VPP Add IP Neighbor
255 | | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${tg_if1_ip6_subnet}${hexa_nr}
256 | | | ... | ${TG_pf1_mac}[0]
257 | | | Run Keyword If | ${dut2_status}
258 | | | ... | VPP Add IP Neighbor
259 | | | ... | ${dut2} | ${DUT2_${int}2}[0] | ${tg_if2_ip6_subnet}${hexa_nr}
260 | | | ... | ${TG_pf2_mac}[0]
261 | | END
262 | | Run Keyword If | ${dut2_status}
263 | | ... | VPP Add IP Neighbor
264 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut2_if1_ip6}
265 | | ... | ${DUT2_${int}1_mac}[0]
266 | | Run Keyword Unless | ${dut2_status}
267 | | ... | VPP Add IP Neighbor
268 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut2_if1_ip6} | ${TG_pf2_mac}[0]
269 | | Run Keyword If | ${dut2_status}
270 | | ... | VPP Add IP Neighbor
271 | | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut1_if2_ip6}
272 | | ... | ${DUT1_${int}2_mac}[0]
273 | | ${sid1}= | Set Variable If
274 | | ... | "${n}" == "1" | ${dut2_sid1}
275 | | ... | "${n}" == "2" | ${dut2_sid1_1}
276 | | ${sid2}= | Set Variable If
277 | | ... | "${n}" == "1" | ${dut1_sid2}
278 | | ... | "${n}" == "2" | ${dut1_sid2_1}
279 | | Vpp Route Add
280 | | ... | ${dut1} | ${sid1} | ${sid_prefix} | gateway=${dut2_if1_ip6}
281 | | ... | interface=${DUT1_${int}2}[0]
282 | | Run Keyword If | ${dut2_status}
283 | | ... | Vpp Route Add
284 | | ... | ${dut2} | ${sid2} | ${sid_prefix} | gateway=${dut1_if2_ip6}
285 | | ... | interface=${DUT2_${int}1}[0]
286 # Configure SRv6 for direction0
287 | | Set SR Encaps Source Address on DUT
288 | | ... | ${dut1} | ${dut1_sid1}
289 | | @{sid_list_dir0}= | Run Keyword If | '${n}' == '1'
290 | | ... | Create List | ${dut2_sid1}
291 | | ... | ELSE IF | '${n}' == '2'
292 | | ... | Create List | ${dut2_sid1_1} | ${dut2_sid1_2}
293 | | Configure SR Policy on DUT
294 | | ... | ${dut1} | ${dut1_bsid} | encap | @{sid_list_dir0}
295 | | Configure SR Steer on DUT
296 | | ... | ${dut1} | L3 | ${dut1_bsid} | ip_addr=${tg_if2_ip6_subnet}
297 | | ... | prefix=${sid_prefix}
298 | | Run Keyword If | ${dut2_status} and '${n}' == '1'
299 | | ... | Configure SR LocalSID on DUT
300 | | ... | ${dut2} | ${dut2_sid1} | end.dx6 | interface=${DUT2_${int}2}[0]
301 | | ... | next_hop=${tg_if2_ip6_subnet}2
302 | | Run Keyword If | ${dut2_status} and '${n}' == '2'
303 | | ... | Configure SR LocalSID on DUT
304 | | ... | ${dut2} | ${dut2_sid1_1} | end
305 | | Run Keyword If
306 | | ... | ${dut2_status} and '${n}' == '2' and '${prepos}' != 'without'
307 | | ... | Configure SR LocalSID on DUT
308 | | ... | ${dut2} | ${dut2_sid1_2} | end.dx6
309 | | ... | interface=${DUT2_${int}2}[0] | next_hop=${tg_if2_ip6_subnet}2
310 | | Run Keyword If
311 | | ... | ${dut2_status} and '${n}' == '2' and '${prepos}' == 'without'
312 | | ... | Vpp Route Add
313 | | ... | ${dut2} | ${dut2_sid1_2} | ${sid_prefix}
314 | | ... | gateway=${tg_if2_ip6_subnet}2 | interface=${DUT2_${int}2}[0]
315 # Configure SRv6 for direction1
316 | | Run Keyword If | ${dut2_status}
317 | | ... | Set SR Encaps Source Address on DUT
318 | | ... | ${dut2} | ${dut2_sid2}
319 | | @{sid_list_dir1}= | Run Keyword If | '${n}' == '1'
320 | | ... | Create List | ${dut1_sid2}
321 | | ... | ELSE IF | '${n}' == '2'
322 | | ... | Create List | ${dut1_sid2_1} | ${dut1_sid2_2}
323 | | Run Keyword If | ${dut2_status}
324 | | ... | Configure SR Policy on DUT
325 | | ... | ${dut2} | ${dut2_bsid} | encap | @{sid_list_dir1}
326 | | Run Keyword If | ${dut2_status}
327 | | ... | Configure SR Steer on DUT
328 | | ... | ${dut2} | L3 | ${dut2_bsid} | ip_addr=${tg_if1_ip6_subnet}
329 | | ... | prefix=${sid_prefix}
330 | | Run Keyword If | '${n}' == '1'
331 | | ... | Configure SR LocalSID on DUT
332 | | ... | ${dut1} | ${dut1_sid2} | end.dx6 | interface=${DUT1_${int}1}[0]
333 | | ... | next_hop=${tg_if1_ip6_subnet}2
334 | | Run Keyword If | '${n}' == '2'
335 | | ... | Configure SR LocalSID on DUT
336 | | ... | ${dut1} | ${dut1_sid2_1} | end
337 | | Run Keyword If | '${n}' == '2' and '${prepos}' != 'without'
338 | | ... | Configure SR LocalSID on DUT
339 | | ... | ${dut1} | ${dut1_sid2_2} | end.dx6 | interface=${DUT1_${int}1}[0]
340 | | ... | next_hop=${tg_if1_ip6_subnet}2
341 | | Run Keyword If | '${n}' == '2' and '${prepos}' == 'without'
342 | | ... | Vpp Route Add
343 | | ... | ${dut1} | ${dut1_sid2_2} | ${sid_prefix}
344 | | ... | gateway=${tg_if1_ip6_subnet}2 | interface=${DUT1_${int}1}[0]
345 | | Set interfaces in path up
346
347 | Initialize SRv6 with '${behavior}' SR-unaware Service Function
348 | | [Documentation]
349 | | ... | Create pair of Memif interfaces on all defined VPP nodes. Set UP
350 | | ... | state on VPP interfaces in path on node(s) in circular topology.
351 | | ... | Get the interface MAC addresses and setup neighbours on all VPP
352 | | ... | interfaces. Setup IPv6 addresses on all interfaces. Set segment
353 | | ... | routing for IPv6 with defined behaviour function and configure IPv6
354 | | ... | routes on DUT node(s).
355 | |
356 | | ... | *Note:*
357 | | ... | KW uses test variable rxq_count_int set by KW Add worker threads
358 | | ... | and rxqueues to all DUTs
359 | |
360 | | ${status} | ${value}= | Run Keyword And Ignore Error
361 | | ... | Variable Should Exist | ${dut2}
362 | | ${dut2_status}= | Set Variable If | '${status}' == 'PASS' | ${True}
363 | | ... | ${False}
364 | |
365 | | ${sock1}= | Set Variable | memif-DUT1_CNF
366 | | ${sock2}= | Set Variable | memif-DUT2_CNF
367 | | Set up memif interfaces on DUT node | ${dut1} | ${sock1} | ${sock1}
368 | | ... | ${1} | dut1-memif-1-if1 | dut1-memif-1-if2 | ${rxq_count_int}
369 | | ... | ${rxq_count_int}
370 | | VPP Set interface MTU | ${dut1} | ${dut1-memif-1-if1}
371 | | VPP Set interface MTU | ${dut1} | ${dut1-memif-1-if2}
372 | | Run Keyword If | ${dut2_status}
373 | | ... | Set up memif interfaces on DUT node | ${dut2} | ${sock2} | ${sock2}
374 | | ... | ${1} | dut2-memif-1-if1 | dut2-memif-1-if2 | ${rxq_count_int}
375 | | ... | ${rxq_count_int}
376 | | Run Keyword If | ${dut2_status}
377 | | ... | VPP Set interface MTU | ${dut2} | ${dut2-memif-1-if1}
378 | | Run Keyword If | ${dut2_status}
379 | | ... | VPP Set interface MTU | ${dut2} | ${dut2-memif-1-if2}
380 | | FOR | ${dut} | IN | @{duts}
381 | | | Show Memif | ${nodes['${dut}']}
382 | | END
383 | | VPP Interface Set IP Address
384 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${dut1_if1_ip6} | ${prefix}
385 | | VPP Interface Set IP Address
386 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut1_if2_ip6} | ${prefix}
387 | | VPP Interface Set IP Address | ${dut1} | ${dut1-memif-1-if1}
388 | | ... | ${dut1-memif-1-if1_ip6} | ${mem_prefix}
389 | | VPP Interface Set IP Address | ${dut1} | ${dut1-memif-1-if2}
390 | | ... | ${dut1-memif-1-if2_ip6} | ${mem_prefix}
391 | | Run Keyword If | ${dut2_status}
392 | | ... | VPP Interface Set IP Address
393 | | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut2_if1_ip6} | ${prefix}
394 | | Run Keyword If | ${dut2_status}
395 | | ... | VPP Interface Set IP Address
396 | | ... | ${dut2} | ${DUT2_${int}2}[0] | ${dut2_if2_ip6} | ${prefix}
397 | | Run Keyword If | ${dut2_status}
398 | | ... | VPP Interface Set IP Address | ${dut2} | ${dut2-memif-1-if1}
399 | | ... | ${dut2-memif-1-if1_ip6} | ${mem_prefix}
400 | | Run Keyword If | ${dut2_status}
401 | | ... | VPP Interface Set IP Address | ${dut2} | ${dut2-memif-1-if2}
402 | | ... | ${dut2-memif-1-if2_ip6} | ${mem_prefix}
403 | | Vpp Interfaces RA Suppress On All Nodes | ${nodes}
404 | | Run Keyword If | ${dut2_status}
405 | | ... | VPP Add IP Neighbor
406 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut2_if1_ip6}
407 | | ... | ${DUT2_${int}1_mac}[0]
408 | | Run Keyword Unless | ${dut2_status}
409 | | ... | VPP Add IP Neighbor
410 | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut2_if1_ip6} | ${TG_pf2_mac}[0]
411 | | Run Keyword If | ${dut2_status}
412 | | ... | VPP Add IP Neighbor
413 | | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut1_if2_ip6}
414 | | ... | ${DUT1_${int}2_mac}[0]
415 | | VPP Add IP Neighbor
416 | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${tg_if1_ip6_subnet}2
417 | | ... | ${TG_pf1_mac}[0]
418 | | Run Keyword If | ${dut2_status}
419 | | ... | VPP Add IP Neighbor
420 | | ... | ${dut2} | ${DUT2_${int}2}[0] | ${tg_if2_ip6_subnet}2
421 | | ... | ${TG_pf2_mac}[0]
422 | | ${dut1-memif-1-if2_mac}= | Get Interface MAC | ${dut1} | memif2
423 | | ${dut2-memif-1-if2_mac}= | Run Keyword If | ${dut2_status}
424 | | ... | Get Interface MAC | ${dut2} | memif2
425 | | VPP Add IP Neighbor | ${dut1}
426 | | ... | ${dut1-memif-1-if1} | ${dut1_nh} | ${dut1-memif-1-if2_mac}
427 | | Run Keyword If | ${dut2_status}
428 | | ... | VPP Add IP Neighbor | ${dut2}
429 | | ... | ${dut2-memif-1-if1} | ${dut2_nh} | ${dut2-memif-1-if2_mac}
430 | | Vpp Route Add | ${dut1} | ${dut2_sid1} | ${sid_prefix}
431 | | ... | gateway=${dut2_if1_ip6} | interface=${DUT1_${int}2}[0]
432 | | Vpp Route Add | ${dut1} | ${out_sid2_1} | ${sid_prefix}
433 | | ... | gateway=${tg_if1_ip6_subnet}2 | interface=${DUT1_${int}1}[0]
434 | | Run Keyword If | ${dut2_status}
435 | | ... | Vpp Route Add | ${dut2} | ${dut1_sid2} | ${sid_prefix}
436 | | ... | gateway=${dut1_if2_ip6} | interface=${DUT2_${int}1}[0]
437 | | Run Keyword If | ${dut2_status}
438 | | ... | Vpp Route Add | ${dut2} | ${out_sid1_1} | ${sid_prefix}
439 | | ... | gateway=${tg_if2_ip6_subnet}2 | interface=${DUT2_${int}2}[0]
440 # Configure SRv6 for direction0 on DUT1
441 | | Set SR Encaps Source Address on DUT | ${dut1} | ${dut1_sid1}
442 | | @{sid_list_dir0}= | Create List | ${dut2_sid1} | ${out_sid1_1}
443 | | ... | ${out_sid1_2}
444 | | Configure SR Policy on DUT | ${dut1} | ${dut1_bsid} | encap
445 | | ... | @{sid_list_dir0}
446 | | Configure SR Steer on DUT | ${dut1} | L3 | ${dut1_bsid}
447 | | ... | ip_addr=${tg_if2_ip6_subnet} | prefix=${sid_prefix}
448 # Configure SRv6 for direction1 on DUT2
449 | | Run Keyword If | ${dut2_status}
450 | | ... | Set SR Encaps Source Address on DUT | ${dut2} | ${dut2_sid2}
451 | | @{sid_list_dir1}= | Create List | ${dut1_sid2} | ${out_sid2_1}
452 | | ... | ${out_sid2_2}
453 | | Run Keyword If | ${dut2_status}
454 | | ... | Configure SR Policy on DUT | ${dut2} | ${dut2_bsid} | encap
455 | | ... | @{sid_list_dir1}
456 | | Run Keyword If | ${dut2_status}
457 | | ... | Configure SR Steer on DUT | ${dut2} | L3 | ${dut2_bsid}
458 | | ... | ip_addr=${tg_if1_ip6_subnet} | prefix=${sid_prefix}
459 # Configure SRv6 for direction0 on DUT2
460 | | ${dut2_out_if}= | Run Keyword If | ${dut2_status}
461 | | ... | Get Interface Name | ${dut2} | memif1
462 | | ${dut2_in_if}= | Run Keyword If | ${dut2_status}
463 | | ... | Get Interface Name | ${dut2} | memif2
464 | | Remove Values From List | ${sid_list_dir0} | ${dut2_sid1}
465 | | Run Keyword If | ${dut2_status} and '${behavior}' == 'static_proxy'
466 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.as
467 | | ... | ${NONE} | ${dut2_nh} | ${NONE} | ${dut2_out_if} | ${dut2_in_if}
468 | | ... | ${dut1_sid1} | @{sid_list_dir0}
469 | | ... | ELSE IF | ${dut2_status} and '${behavior}' == 'dynamic_proxy'
470 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.ad
471 | | ... | next_hop=${dut2_nh} | out_if=${dut2_out_if} | in_if=${dut2_in_if}
472 | | ... | ELSE IF | ${dut2_status} and '${behavior}' == 'masquerading'
473 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.am
474 | | ... | next_hop=${dut2_nh} | out_if=${dut2_out_if} | in_if=${dut2_in_if}
475 | | ... | ELSE IF | ${dut2_status}
476 | | ... | Fail | Unsupported behaviour: ${behavior}
477 # Configure SRv6 for direction1 on DUT1
478 | | ${dut1_out_if}= | Get Interface Name | ${dut1} | memif1
479 | | ${dut1_in_if}= | Get Interface Name | ${dut1} | memif2
480 | | Remove Values From List | ${sid_list_dir1} | ${dut1_sid2}
481 | | Run Keyword If | '${behavior}' == 'static_proxy'
482 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.as
483 | | ... | ${NONE} | ${dut1_nh} | ${NONE} | ${dut1_out_if} | ${dut1_in_if}
484 | | ... | ${dut2_sid2} | @{sid_list_dir1}
485 | | ... | ELSE IF | '${behavior}' == 'dynamic_proxy'
486 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.ad
487 | | ... | next_hop=${dut1_nh} | out_if=${dut1_out_if} | in_if=${dut1_in_if}
488 | | ... | ELSE IF | '${behavior}' == 'masquerading'
489 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.am
490 | | ... | next_hop=${dut1_nh} | out_if=${dut1_out_if} | in_if=${dut1_in_if}
491 | | ... | ELSE | Fail | Unsupported behaviour: ${behavior}
492 | | Set interfaces in path up