aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/robot/overlay/srv6.robot
blob: 83ec8949a4c6bbd535d5429069dabd7fc055e877 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
# Copyright (c) 2023 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

*** Settings ***
| Library | resources.libraries.python.SRv6
| Documentation | Keywords for SRv6 feature in VPP.

*** Keywords ***
| Configure SR LocalSID on DUT
| | [Documentation] | Create SRv6 LocalSID and binds it to a particular\
| | ... | behavior on the given DUT node.
| |
| | ... | *Arguments:*
| | ... | - dut_node - DUT node where to create localSID on. Type: dictionary
| | ... | - local_sid - LocalSID IPv6 address. Type: string
| | ... | - behavior - SRv6 LocalSID function. Type: string
| | ... | - interface - Interface name (Optional, default value: None; required
| | ... | for L2/L3 xconnects). Type: string
| | ... | - next_hop - Next hop IPv4/IPv6 address (Optional, default value:
| | ... | None; required for L3 xconnects). Type: string
| | ... | - fib_table - FIB table for IPv4/IPv6 lookup (Optional, default value:
| | ... | None; required for L3 routing). Type: string
| | ... | - out_if - Interface name of local interface for sending traffic
| | ... | towards the Service Function (Optional, default value: None;
| | ... | required for SRv6 endpoint to SR-unaware appliance). Type: string
| | ... | - in_if - Interface name of local interface receiving the traffic
| | ... | coming back from the Service Function (Optional, default value:
| | ... | None; required for SRv6 endpoint to SR-unaware appliance).
| | ... | Type: string
| | ... | - src_addr - Source address on the packets coming back on in_if
| | ... | interface (Optional, default value: None; required for SRv6 endpoint
| | ... | to SR-unaware appliance via static proxy). Type: string
| | ... | - sid_list - SID list (Optional, default value: []; required for SRv6
| | ... | endpoint to SR-unaware appliance via static proxy). Type: list
| |
| | ... | *Example:*
| |
| | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT1']} \| B:: \| end \|
| | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT1']} \| C:: \
| | ... | \| end.dx2 \| interface=GigabitEthernet0/10/0 \|
| | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT1']} \| D:: \
| | ... | \| end.dx4 \| interface=GigabitEthernet0/8/0 \| next_hop=10.0.0.1 \|
| | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT2']} \| E:: \
| | ... | \| end.dt6 \| fib_table=2 \|
| | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT2']} \| E:: \
| | ... | \| end.ad \| next_hop=10.0.0.1 \| out_if=DUT2_VHOST1 \
| | ... | \| in_if=DUT2_VHOST2 \|
| | ... | \| Configure SR LocalSID on DUT \| ${nodes['DUT2']} \| E:: \
| | ... | \| end.as \| next_hop=10.0.0.1 \| out_if=DUT2_VHOST1 \
| | ... | \| in_if=DUT2_VHOST2 \| src_addr=B:: \| sid_list=['C::', 'D::'] \|
| |
| | [Arguments] | ${dut_node} | ${local_sid} | ${behavior}
| | ... | ${interface}=${None} | ${next_hop}=${None} | ${fib_table}=${None}
| | ... | ${out_if}=${None} | ${in_if}=${None} | ${src_addr}=${None}
| | ... | @{sid_list}
| |
| | Configure SR LocalSID | ${dut_node} | ${local_sid} | ${behavior}
| | ... | interface=${interface} | next_hop=${next_hop} | fib_table=${fib_table}
| | ... | out_if=${out_if} | in_if=${in_if} | src_addr=${src_addr}
| | ... | sid_list=${sid_list}

| Show SR LocalSIDs on DUT
| | [Documentation] | Show SRv6 LocalSIDs on the given DUT node.
| |
| | ... | *Arguments:*
| | ... | - dut_node - DUT node where to show SR localSIDs on. Type: dictionary
| |
| | ... | *Example:*
| |
| | ... | \| Show SR LocalSIDs on DUT \| ${nodes['DUT1']} \|
| |
| | [Arguments] | ${dut_node}
| |
| | Show SR LocalSIDs | ${dut_node}

| Configure SR Policy on DUT
| | [Documentation] | Create SRv6 policy on the given DUT node.
| |
| | ... | *Arguments:*
| | ... | - dut_node - DUT node where to create SRv6 policy on. Type: dictionary
| | ... | - bsid - BindingSID - local SID IPv6 address. Type: string
| | ... | - mode - Encapsulation / insertion mode. Type: string
| | ... | - sid_list - SID list. Type: list
| |
| | ... | *Example:*
| |
| | ... | \| Configure SR Policy on DUT \| ${nodes['DUT2']} \| A:: \| encap \
| | ... | \| B::\| C:: \|
| | ... | \| Configure SR Policy on DUT \| ${nodes['DUT2']} \| D:: \| insert \
| | ... | \| E::\| F:: \|
| |
| | [Arguments] | ${dut_node} | ${bsid} | ${mode} | @{sid_list}
| |
| | Configure SR Policy | ${dut_node} | ${bsid} | ${sid_list} | mode=${mode}

| Show SR Policies on DUT
| | [Documentation] | Show SRv6 policies on the given DUT node.
| |
| | ... | *Arguments:*
| | ... | - dut_node - DUT node where to show SR policies on. Type: dictionary
| |
| | ... | *Example:*
| |
| | ... | \| Show SR Policies on DUT \| ${nodes['DUT1']} \|
| |
| | [Arguments] | ${dut_node}
| |
| | Show SR Policies | ${dut_node}

| Configure SR Steer on DUT
| | [Documentation] | Create SRv6 steering policy on the given DUT node.
| |
| | ... | *Arguments:*
| | ... | - dut_node - DUT node where to create SR steering policy on.
| | ... | Type: dictionary
| | ... | - mode - Mode of operation - L2 or L3. Type: string
| | ... | - bsid - BindingSID - local SID IPv6 address. Type: string
| | ... | - interface - Interface name (Optional, default value: None; required
| | ... | in case of L2 mode). Type: string
| | ... | - ip_addr - IPv4/IPv6 address (Optional, default value: None; required
| | ... | in case of L3 mode). Type: string
| | ... | - prefix - IP address prefix (Optional, default value: None; required
| | ... | for L3 mode). Type: integer
| |
| | ... | *Example:*
| |
| | ... | \| Configure SR Steer on DUT \| ${nodes['DUT1']} \| L2 \| B:: \
| | ... | \| interface=GigabitEthernet0/10/0 \|
| | ... | \| Configure SR Steer on DUT \| ${nodes['DUT1']} \| L3 \| C:: \
| | ... | \| ip_address=2001::1 \| prefix=64 \|
| |
| | [Arguments] | ${dut_node} | ${mode} | ${bsid}
| | ... | ${interface}=${None} | ${ip_addr}=${None} | ${prefix}=${None}
| |
| | Configure SR Steer | ${dut_node} | ${mode} | ${bsid}
| | ... | interface=${interface} | ip_addr=${ip_addr} | prefix=${prefix}

| Show SR Steering Policies on DUT
| | [Documentation] | Show SRv6 steering policies on the given DUT node.
| |
| | ... | *Arguments:*
| | ... | - dut_node - DUT node where to show SR steering policies on.
| | ... | Type: dictionary
| |
| | ... | *Example:*
| |
| | ... | \| Show SR Steering Policies on DUT \| ${nodes['DUT1']} \|
| |
| | [Arguments] | ${dut_node}
| |
| | Show SR Steering Policies | ${dut_node}

| Set SR Encaps Source Address on DUT
| | [Documentation] | Set SRv6 encapsulation source address on the given DUT
| | ... | node.
| |
| | ... | *Arguments:*
| | ... | - dut_node - DUT node where to set SRv6 encapsulation source address
| | ... | on. Type: dictionary
| | ... | - ip6_addr - Local SID IPv6 address. Type: string
| |
| | ... | *Example:*
| |
| | ... | \| Set SR Encaps Source Address on DUT \| ${nodes['DUT1']} \| B:: \|
| |
| | [Arguments] | ${dut_node} | ${ip6_addr}
| |
| | Set SR Encaps Source Address | ${dut_node} | ip6_addr=${ip6_addr}

| Show SR Policies on all DUTs
| | [Documentation] | Show SRv6 policies on all DUT nodes in topology.
| |
| | ... | *Arguments:*
| | ... | - nodes - Topology. Type: dictionary
| |
| | ... | *Example:*
| |
| | ... | \| Show SR Policies on all DUTs \| ${nodes} \|
| |
| | [Arguments] | ${nodes}
| |
| | FOR | ${dut} | IN | @{duts}
| | | Show SR Policies | ${nodes['${dut}']}
| | END

| Show SR Steering Policies on all DUTs
| | [Documentation] | Show SRv6 steering policies on all DUT nodes in topology.
| |
| | ... | *Arguments:*
| | ... | - nodes - Topology. Type: dictionary
| |
| | ... | *Example:*
| |
| | ... | \| Show SR Steering Policies on all DUTs \| ${nodes} \|
| |
| | [Arguments] | ${nodes}
| |
| | FOR | ${dut} | IN | @{duts}
| | | Show SR Steering Policies | ${nodes['${dut}']}
| | END

| Show SR LocalSIDs on all DUTs
| | [Documentation] | Show SRv6 LocalSIDs on all DUT nodes in topology.
| |
| | ... | *Arguments:*
| | ... | - nodes - Topology. Type: dictionary
| |
| | ... | *Example:*
| |
| | ... | \| Show SR LocalSIDs on all DUTs \| ${nodes} \|
| |
| | [Arguments] | ${nodes}
| |
| | FOR | ${dut} | IN | @{duts}
| | | Show SR LocalSIDs | ${nodes['${dut}']}
| | END

| Initialize SRv6 encapsulation with '${n}' x SID '${prepos}' decapsulation
| | [Documentation]
| | ... | Set UP state on VPP interfaces in path on node(s) in circular
| | ... | topology. Get the interface MAC addresses and setup neighbours on all
| | ... | VPP interfaces. Setup IPv6 addresses on all interfaces. Set segment
| | ... | routing for IPv6 for required number of SIDs and configure IPv6 routes
| | ... | on DUT node(s).
| |
| | ${status} | ${value}= | Run Keyword And Ignore Error
| | ... | Variable Should Exist | ${dut2}
| | ${dut2_status}= | Set Variable If | '${status}' == 'PASS' | ${True}
| | ... | ${False}
| |
| | VPP Interface Set IP Address
| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${dut1_if1_ip6} | ${prefix}
| | VPP Interface Set IP Address
| | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut1_if2_ip6} | ${prefix}
| | Run Keyword If | ${dut2_status}
| | ... | VPP Interface Set IP Address
| | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut2_if1_ip6} | ${prefix}
| | Run Keyword If | ${dut2_status}
| | ... | VPP Interface Set IP Address
| | ... | ${dut2} | ${DUT2_${int}2}[0] | ${dut2_if2_ip6} | ${prefix}
| | Vpp Interfaces RA Suppress On All Nodes | ${nodes}
| | FOR | ${number} | IN RANGE | 2 | ${dst_addr_nr}+2
| | | ${hexa_nr}= | Convert To Hex | ${number}
| | | VPP Add IP Neighbor
| | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${tg_if1_ip6_subnet}${hexa_nr}
| | | ... | ${TG_pf1_mac}[0]
| | | Run Keyword If | ${dut2_status}
| | | ... | VPP Add IP Neighbor
| | | ... | ${dut2} | ${DUT2_${int}2}[0] | ${tg_if2_ip6_subnet}${hexa_nr}
| | | ... | ${TG_pf2_mac}[0]
| | END
| | Run Keyword If | ${dut2_status}
| | ... | VPP Add IP Neighbor
| | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut2_if1_ip6}
| | ... | ${DUT2_${int}1_mac}[0]
| | Run Keyword If | not ${dut2_status}
| | ... | VPP Add IP Neighbor
| | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut2_if1_ip6} | ${TG_pf2_mac}[0]
| | Run Keyword If | ${dut2_status}
| | ... | VPP Add IP Neighbor
| | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut1_if2_ip6}
| | ... | ${DUT1_${int}2_mac}[0]
| | ${sid1}= | Set Variable If
| | ... | "${n}" == "1" | ${dut2_sid1}
| | ... | "${n}" == "2" | ${dut2_sid1_1}
| | ${sid2}= | Set Variable If
| | ... | "${n}" == "1" | ${dut1_sid2}
| | ... | "${n}" == "2" | ${dut1_sid2_1}
| | Vpp Route Add
| | ... | ${dut1} | ${sid1} | ${sid_prefix} | gateway=${dut2_if1_ip6}
| | ... | interface=${DUT1_${int}2}[0]
| | Run Keyword If | ${dut2_status}
| | ... | Vpp Route Add
| | ... | ${dut2} | ${sid2} | ${sid_prefix} | gateway=${dut1_if2_ip6}
| | ... | interface=${DUT2_${int}1}[0]
# Configure SRv6 for direction0
| | Set SR Encaps Source Address on DUT
| | ... | ${dut1} | ${dut1_sid1}
| | @{sid_list_dir0}= | Run Keyword If | '${n}' == '1'
| | ... | Create List | ${dut2_sid1}
| | ... | ELSE IF | '${n}' == '2'
| | ... | Create List | ${dut2_sid1_1} | ${dut2_sid1_2}
| | Configure SR Policy on DUT
| | ... | ${dut1} | ${dut1_bsid} | encap | @{sid_list_dir0}
| | Configure SR Steer on DUT
| | ... | ${dut1} | L3 | ${dut1_bsid} | ip_addr=${tg_if2_ip6_subnet}
| | ... | prefix=${sid_prefix}
| | Run Keyword If | ${dut2_status} and '${n}' == '1'
| | ... | Configure SR LocalSID on DUT
| | ... | ${dut2} | ${dut2_sid1} | end.dx6 | interface=${DUT2_${int}2}[0]
| | ... | next_hop=${tg_if2_ip6_subnet}2
| | Run Keyword If | ${dut2_status} and '${n}' == '2'
| | ... | Configure SR LocalSID on DUT
| | ... | ${dut2} | ${dut2_sid1_1} | end
| | Run Keyword If
| | ... | ${dut2_status} and '${n}' == '2' and '${prepos}' != 'without'
| | ... | Configure SR LocalSID on DUT
| | ... | ${dut2} | ${dut2_sid1_2} | end.dx6
| | ... | interface=${DUT2_${int}2}[0] | next_hop=${tg_if2_ip6_subnet}2
| | Run Keyword If
| | ... | ${dut2_status} and '${n}' == '2' and '${prepos}' == 'without'
| | ... | Vpp Route Add
| | ... | ${dut2} | ${dut2_sid1_2} | ${sid_prefix}
| | ... | gateway=${tg_if2_ip6_subnet}2 | interface=${DUT2_${int}2}[0]
# Configure SRv6 for direction1
| | Run Keyword If | ${dut2_status}
| | ... | Set SR Encaps Source Address on DUT
| | ... | ${dut2} | ${dut2_sid2}
| | @{sid_list_dir1}= | Run Keyword If | '${n}' == '1'
| | ... | Create List | ${dut1_sid2}
| | ... | ELSE IF | '${n}' == '2'
| | ... | Create List | ${dut1_sid2_1} | ${dut1_sid2_2}
| | Run Keyword If | ${dut2_status}
| | ... | Configure SR Policy on DUT
| | ... | ${dut2} | ${dut2_bsid} | encap | @{sid_list_dir1}
| | Run Keyword If | ${dut2_status}
| | ... | Configure SR Steer on DUT
| | ... | ${dut2} | L3 | ${dut2_bsid} | ip_addr=${tg_if1_ip6_subnet}
| | ... | prefix=${sid_prefix}
| | Run Keyword If | '${n}' == '1'
| | ... | Configure SR LocalSID on DUT
| | ... | ${dut1} | ${dut1_sid2} | end.dx6 | interface=${DUT1_${int}1}[0]
| | ... | next_hop=${tg_if1_ip6_subnet}2
| | Run Keyword If | '${n}' == '2'
| | ... | Configure SR LocalSID on DUT
| | ... | ${dut1} | ${dut1_sid2_1} | end
| | Run Keyword If | '${n}' == '2' and '${prepos}' != 'without'
| | ... | Configure SR LocalSID on DUT
| | ... | ${dut1} | ${dut1_sid2_2} | end.dx6 | interface=${DUT1_${int}1}[0]
| | ... | next_hop=${tg_if1_ip6_subnet}2
| | Run Keyword If | '${n}' == '2' and '${prepos}' == 'without'
| | ... | Vpp Route Add
| | ... | ${dut1} | ${dut1_sid2_2} | ${sid_prefix}
| | ... | gateway=${tg_if1_ip6_subnet}2 | interface=${DUT1_${int}1}[0]
| | Set interfaces in path up

| Initialize SRv6 with '${behavior}' SR-unaware Service Function
| | [Documentation]
| | ... | Create pair of Memif interfaces on all defined VPP nodes. Set UP
| | ... | state on VPP interfaces in path on node(s) in circular topology.
| | ... | Get the interface MAC addresses and setup neighbours on all VPP
| | ... | interfaces. Setup IPv6 addresses on all interfaces. Set segment
| | ... | routing for IPv6 with defined behaviour function and configure IPv6
| | ... | routes on DUT node(s).
| |
| | ... | *Note:*
| | ... | KW uses test variable rxq_count_int set by KW Add worker threads
| | ... | and rxqueues to all DUTs
| |
| | ${status} | ${value}= | Run Keyword And Ignore Error
| | ... | Variable Should Exist | ${dut2}
| | ${dut2_status}= | Set Variable If | '${status}' == 'PASS' | ${True}
| | ... | ${False}
| |
| | ${sock1}= | Set Variable | memif-DUT1_CNF
| | ${sock2}= | Set Variable | memif-DUT2_CNF
| | Set up memif interfaces on DUT node | ${dut1} | ${sock1} | ${sock1}
| | ... | ${1} | dut1-memif-1-if1 | dut1-memif-1-if2 | ${rxq_count_int}
| | ... | ${rxq_count_int}
| | Run Keyword If | ${dut2_status}
| | ... | Set up memif interfaces on DUT node | ${dut2} | ${sock2} | ${sock2}
| | ... | ${1} | dut2-memif-1-if1 | dut2-memif-1-if2 | ${rxq_count_int}
| | ... | ${rxq_count_int}
| | FOR | ${dut} | IN | @{duts}
| | | Show Memif | ${nodes['${dut}']}
| | END
| | VPP Interface Set IP Address
| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${dut1_if1_ip6} | ${prefix}
| | VPP Interface Set IP Address
| | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut1_if2_ip6} | ${prefix}
| | VPP Interface Set IP Address | ${dut1} | ${dut1-memif-1-if1}
| | ... | ${dut1-memif-1-if1_ip6} | ${mem_prefix}
| | VPP Interface Set IP Address | ${dut1} | ${dut1-memif-1-if2}
| | ... | ${dut1-memif-1-if2_ip6} | ${mem_prefix}
| | Run Keyword If | ${dut2_status}
| | ... | VPP Interface Set IP Address
| | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut2_if1_ip6} | ${prefix}
| | Run Keyword If | ${dut2_status}
| | ... | VPP Interface Set IP Address
| | ... | ${dut2} | ${DUT2_${int}2}[0] | ${dut2_if2_ip6} | ${prefix}
| | Run Keyword If | ${dut2_status}
| | ... | VPP Interface Set IP Address | ${dut2} | ${dut2-memif-1-if1}
| | ... | ${dut2-memif-1-if1_ip6} | ${mem_prefix}
| | Run Keyword If | ${dut2_status}
| | ... | VPP Interface Set IP Address | ${dut2} | ${dut2-memif-1-if2}
| | ... | ${dut2-memif-1-if2_ip6} | ${mem_prefix}
| | Vpp Interfaces RA Suppress On All Nodes | ${nodes}
| | Run Keyword If | ${dut2_status}
| | ... | VPP Add IP Neighbor
| | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut2_if1_ip6}
| | ... | ${DUT2_${int}1_mac}[0]
| | Run Keyword If | not ${dut2_status}
| | ... | VPP Add IP Neighbor
| | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut2_if1_ip6} | ${TG_pf2_mac}[0]
| | Run Keyword If | ${dut2_status}
| | ... | VPP Add IP Neighbor
| | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut1_if2_ip6}
| | ... | ${DUT1_${int}2_mac}[0]
| | VPP Add IP Neighbor
| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${tg_if1_ip6_subnet}2
| | ... | ${TG_pf1_mac}[0]
| | Run Keyword If | ${dut2_status}
| | ... | VPP Add IP Neighbor
| | ... | ${dut2} | ${DUT2_${int}2}[0] | ${tg_if2_ip6_subnet}2
| | ... | ${TG_pf2_mac}[0]
| | ${dut1-memif-1-if2_mac}= | Get Interface MAC | ${dut1} | memif2
| | ${dut2-memif-1-if2_mac}= | Run Keyword If | ${dut2_status}
| | ... | Get Interface MAC | ${dut2} | memif2
| | VPP Add IP Neighbor | ${dut1}
| | ... | ${dut1-memif-1-if1} | ${dut1_nh} | ${dut1-memif-1-if2_mac}
| | Run Keyword If | ${dut2_status}
| | ... | VPP Add IP Neighbor | ${dut2}
| | ... | ${dut2-memif-1-if1} | ${dut2_nh} | ${dut2-memif-1-if2_mac}
| | Vpp Route Add | ${dut1} | ${dut2_sid1} | ${sid_prefix}
| | ... | gateway=${dut2_if1_ip6} | interface=${DUT1_${int}2}[0]
| | Vpp Route Add | ${dut1} | ${out_sid2_1} | ${sid_prefix}
| | ... | gateway=${tg_if1_ip6_subnet}2 | interface=${DUT1_${int}1}[0]
| | Run Keyword If | ${dut2_status}
| | ... | Vpp Route Add | ${dut2} | ${dut1_sid2} | ${sid_prefix}
| | ... | gateway=${dut1_if2_ip6} | interface=${DUT2_${int}1}[0]
| | Run Keyword If | ${dut2_status}
| | ... | Vpp Route Add | ${dut2} | ${out_sid1_1} | ${sid_prefix}
| | ... | gateway=${tg_if2_ip6_subnet}2 | interface=${DUT2_${int}2}[0]
# Configure SRv6 for direction0 on DUT1
| | Set SR Encaps Source Address on DUT | ${dut1} | ${dut1_sid1}
| | @{sid_list_dir0}= | Create List | ${dut2_sid1} | ${out_sid1_1}
| | ... | ${out_sid1_2}
| | Configure SR Policy on DUT | ${dut1} | ${dut1_bsid} | encap
| | ... | @{sid_list_dir0}
| | Configure SR Steer on DUT | ${dut1} | L3 | ${dut1_bsid}
| | ... | ip_addr=${tg_if2_ip6_subnet} | prefix=${sid_prefix}
# Configure SRv6 for direction1 on DUT2
| | Run Keyword If | ${dut2_status}
| | ... | Set SR Encaps Source Address on DUT | ${dut2} | ${dut2_sid2}
| | @{sid_list_dir1}= | Create List | ${dut1_sid2} | ${out_sid2_1}
| | ... | ${out_sid2_2}
| | Run Keyword If | ${dut2_status}
| | ... | Configure SR Policy on DUT | ${dut2} | ${dut2_bsid} | encap
| | ... | @{sid_list_dir1}
| | Run Keyword If | ${dut2_status}
| | ... | Configure SR Steer on DUT | ${dut2} | L3 | ${dut2_bsid}
| | ... | ip_addr=${tg_if1_ip6_subnet} | prefix=${sid_prefix}
# Configure SRv6 for direction0 on DUT2
| | ${dut2_out_if}= | Run Keyword If | ${dut2_status}
| | ... | Get Interface Name | ${dut2} | memif1
| | ${dut2_in_if}= | Run Keyword If | ${dut2_status}
| | ... | Get Interface Name | ${dut2} | memif2
| | Remove Values From List | ${sid_list_dir0} | ${dut2_sid1}
| | Run Keyword If | ${dut2_status} and '${behavior}' == 'static_proxy'
| | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.as
| | ... | ${NONE} | ${dut2_nh} | ${NONE} | ${dut2_out_if} | ${dut2_in_if}
| | ... | ${dut1_sid1} | @{sid_list_dir0}
| | ... | ELSE IF | ${dut2_status} and '${behavior}' == 'dynamic_proxy'
| | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.ad
| | ... | next_hop=${dut2_nh} | out_if=${dut2_out_if} | in_if=${dut2_in_if}
| | ... | ELSE IF | ${dut2_status} and '${behavior}' == 'masquerading'
| | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.am
| | ... | next_hop=${dut2_nh} | out_if=${dut2_out_if} | in_if=${dut2_in_if}
| | ... | ELSE IF | ${dut2_status}
| | ... | Fail | Unsupported behaviour: ${behavior}
# Configure SRv6 for direction1 on DUT1
| | ${dut1_out_if}= | Get Interface Name | ${dut1} | memif1
| | ${dut1_in_if}= | Get Interface Name | ${dut1} | memif2
| | Remove Values From List | ${sid_list_dir1} | ${dut1_sid2}
| | Run Keyword If | '${behavior}' == 'static_proxy'
| | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.as
| | ... | ${NONE} | ${dut1_nh} | ${NONE} | ${dut1_out_if} | ${dut1_in_if}
| | ... | ${dut2_sid2} | @{sid_list_dir1}
| | ... | ELSE IF | '${behavior}' == 'dynamic_proxy'
| | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.ad
| | ... | next_hop=${dut1_nh} | out_if=${dut1_out_if} | in_if=${dut1_in_if}
| | ... | ELSE IF | '${behavior}' == 'masquerading'
| | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.am
| | ... | next_hop=${dut1_nh} | out_if=${dut1_out_if} | in_if=${dut1_in_if}
| | ... | ELSE | Fail | Unsupported behaviour: ${behavior}
| | Set interfaces in path up