5c8313b36072a1301613d4f5571793c6aedb80d8
[csit.git] / resources / libraries / robot / performance / performance_configuration.robot
1 # Copyright (c) 2019 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 | Collections
16 | Library | String
17 | Library | resources.libraries.python.Classify.Classify
18 | Library | resources.libraries.python.DpdkUtil
19 | Library | resources.libraries.python.InterfaceUtil
20 | Library | resources.libraries.python.IPUtil
21 | Library | resources.libraries.python.L2Util
22 | Library | resources.libraries.python.NodePath
23 | Library | resources.libraries.python.topology.Topology
24 | Library | resources.libraries.python.TestConfig
25 | Library | resources.libraries.python.TrafficGenerator
26 | Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl
27 | Library | resources.libraries.python.VhostUser
28 | ...
29 | Resource | resources/libraries/robot/ip/ip4.robot
30 | Resource | resources/libraries/robot/ip/ip6.robot
31 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
32 | Resource | resources/libraries/robot/l2/l2_patch.robot
33 | Resource | resources/libraries/robot/l2/l2_xconnect.robot
34 | Resource | resources/libraries/robot/l2/tagging.robot
35 | Resource | resources/libraries/robot/overlay/srv6.robot
36 | Resource | resources/libraries/robot/shared/counters.robot
37 | Resource | resources/libraries/robot/shared/default.robot
38 | Resource | resources/libraries/robot/shared/interfaces.robot
39 | ...
40 | Documentation | Performance suite keywords - configuration
41
42 *** Keywords ***
43 | Set interfaces in path up
44 | | [Documentation]
45 | | ... | *Set UP state on VPP interfaces in path on all DUT nodes and set
46 | | ... | maximal MTU.*
47 | | ...
48 # TODO: Rework KW to set all interfaces in path UP and set MTU (including
49 # software interfaces. Run KW at the start phase of VPP setup to split
50 # from other "functional" configuration. This will allow modularity of this
51 # library
52 | | :FOR | ${dut} | IN | @{duts}
53 | | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
54 | | | ... | Variable Should Exist | ${${dut}_if1}
55 | | | Run Keyword If | '${if1_status}' == 'PASS'
56 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1} | up
57 | | | ... | ELSE
58 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1_1} | up
59 | | | Run Keyword Unless | '${if1_status}' == 'PASS'
60 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1_2} | up
61 | | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
62 | | | ... | Variable Should Exist | ${${dut}_if2}
63 | | | Run Keyword If | '${if2_status}' == 'PASS'
64 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if2} | up
65 | | | ... | ELSE
66 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if2_1} | up
67 | | | Run Keyword Unless | '${if2_status}' == 'PASS'
68 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if2_2} | up
69 | | :FOR | ${dut} | IN | @{duts}
70 | | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
71 | | | ... | Variable Should Exist | ${${dut}_if1}
72 | | | Run Keyword If | '${if1_status}' == 'PASS'
73 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1}
74 | | | ... | ELSE
75 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1_1}
76 | | | Run Keyword Unless | '${if1_status}' == 'PASS'
77 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1_2}
78 | | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
79 | | | ... | Variable Should Exist | ${${dut}_if2}
80 | | | Run Keyword If | '${if2_status}' == 'PASS'
81 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if2}
82 | | | ... | ELSE
83 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if2_1}
84 | | | Run Keyword Unless | '${if2_status}' == 'PASS'
85 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if2_2}
86 | | All VPP Interfaces Ready Wait | ${nodes} | retries=${300}
87
88 | Set single interfaces in path up
89 | | [Documentation]
90 | | ... | *Set UP state on single VPP interfaces in path on all DUT nodes and set
91 | | ... | maximal MTU.*
92 | | ...
93 # TODO: Rework KW to set all interfaces in path UP and set MTU (including
94 # software interfaces. Run KW at the start phase of VPP setup to split
95 # from other "functional" configuration. This will allow modularity of this
96 # library
97 | | :FOR | ${dut} | IN | @{duts}
98 | | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
99 | | | ... | Variable Should Exist | ${${dut}_if1}
100 | | | Run Keyword If | '${if1_status}' == 'PASS'
101 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1} | up
102 | | | ... | ELSE
103 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1_1} | up
104 | | | Run Keyword Unless | '${if1_status}' == 'PASS'
105 | | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1_2} | up
106 | | :FOR | ${dut} | IN | @{duts}
107 | | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
108 | | | ... | Variable Should Exist | ${${dut}_if1}
109 | | | Run Keyword If | '${if1_status}' == 'PASS'
110 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1}
111 | | | ... | ELSE
112 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1_1}
113 | | | Run Keyword Unless | '${if1_status}' == 'PASS'
114 | | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1_2}
115 | | All VPP Interfaces Ready Wait | ${nodes}
116
117 | Initialize IPSec in 3-node circular topology
118 | | [Documentation]
119 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
120 | | ... | topology. Get the interface MAC addresses and setup ARP on all VPP
121 | | ... | interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG and
122 | | ... | DUT1-DUT2 links. Set routing for encrypted traffic on both DUT nodes
123 | | ... | with prefix /8 and next hop of neighbour DUT or TG interface IPv4
124 | | ... | address.
125 | | ...
126 | | Set interfaces in path up
127 | | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
128 | | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
129 | | ${dut1_if1_mac}= | Get Interface MAC | ${dut1} | ${dut1_if1}
130 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
131 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
132 | | ${dut2_if2_mac}= | Get Interface MAC | ${dut2} | ${dut2_if2}
133 | | Set Test Variable | ${tg_if1_mac}
134 | | Set Test Variable | ${tg_if2_mac}
135 | | Set Test Variable | ${dut1_if1_mac}
136 | | Set Test Variable | ${dut1_if2_mac}
137 | | Set Test Variable | ${dut2_if1_mac}
138 | | Set Test Variable | ${dut2_if2_mac}
139 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if1}
140 | | ... | ${dut1_if1_ip4} | 24
141 | | VPP Interface Set IP Address | ${dut2} | ${dut2_if2}
142 | | ... | ${dut2_if2_ip4} | 24
143 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | ${tg_if1_ip4} | ${tg_if1_mac}
144 | | VPP Add IP Neighbor | ${dut2} | ${dut2_if2} | ${tg_if2_ip4} | ${tg_if2_mac}
145 | | Vpp Route Add | ${dut1} | ${laddr_ip4} | 8 | gateway=${tg_if1_ip4}
146 | | ... | interface=${dut1_if1}
147 | | Vpp Route Add | ${dut2} | ${raddr_ip4} | 8 | gateway=${tg_if2_ip4}
148 | | ... | interface=${dut2_if2}
149
150 | Initialize IPv6 forwarding with VLAN dot1q sub-interfaces in circular topology
151 | | [Documentation]
152 | | ... | Set UP state on VPP interfaces in path on nodes in 2-node / 3-node
153 | | ... | circular topology. In case of 3-node topology create VLAN
154 | | ... | sub-interfaces between DUTs. In case of 2-node topology create VLAN
155 | | ... | sub-interface on dut1-if2 interface. Get the interface MAC addresses
156 | | ... | and setup ARPs. Setup IPv6 addresses with /64 prefix on DUT-TG links
157 | | ... | and set routing with prefix /64. In case of 3-node set IPv6 adresses
158 | | ... | with /64 prefix on VLAN and set routing on both DUT nodes with prefix
159 | | ... | /64. Set next hop of neighbour DUT interface IPv6 address. All
160 | | ... | interfaces are brought up.
161 | | ...
162 | | ... | *Arguments:*
163 | | ... | - tg_if1_net - TG interface 1 IPv6 subnet used by traffic generator.
164 | | ... | Type: integer
165 | | ... | - tg_if2_net - TG interface 2 IPv6 subnet used by traffic generator.
166 | | ... | Type: integer
167 | | ... | - subid - ID of the sub-interface to be created. Type: string
168 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
169 | | ...
170 | | ... | _NOTE:_ This KW uses following test case variables:
171 | | ... | - dut1 - DUT1 node.
172 | | ... | - dut2 - DUT2 node.
173 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
174 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
175 | | ...
176 | | ... | *Example:*
177 | | ...
178 | | ... | \| Initialize IPv6 forwarding with VLAN dot1q sub-interfaces\
179 | | ... | in circular topology \| 2001:1::0 \| 2001:2::0 \| 10 \| pop-1 \|
180 | | ...
181 | | [Arguments] | ${tg_if1_net} | ${tg_if2_net} | ${subid} | ${tag_rewrite}
182 | | ...
183 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
184 | | ... | Variable Should Exist | ${dut2}
185 | | ...
186 | | Set interfaces in path up
187 | | ...
188 | | Run Keyword If | '${dut2_status}' == 'PASS'
189 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
190 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
191 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
192 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
193 | | Run Keyword If | '${dut2_status}' == 'PASS'
194 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
195 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
196 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
197 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
198 | | ...
199 | | ${prefix}= | Set Variable | 64
200 | | ${host_prefix}= | Set Variable | 64
201 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
202 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
203 | | ${dut1_if2_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
204 | | ... | Get Interface MAC | ${dut1} | ${dut1_if2}
205 | | ${dut2_if1_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
206 | | ... | Get Interface MAC | ${dut2} | ${dut2_if1}
207 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | 2002:1::1 | ${tg1_if1_mac}
208 | | Run Keyword If | '${dut2_status}' == 'PASS'
209 | | ... | VPP Add Ip Neighbor
210 | | ... | ${dut1} | ${subif_index_1} | 2002:2::2 | ${dut2_if1_mac}
211 | | Run Keyword If | '${dut2_status}' == 'PASS'
212 | | ... | VPP Add Ip Neighbor
213 | | ... | ${dut2} | ${subif_index_2} | 2002:2::1 | ${dut1_if2_mac}
214 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
215 | | ... | Set Variable | ${dut2}
216 | | ... | ELSE | Set Variable | ${dut1}
217 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
218 | | ... | Set Variable | ${dut2_if2}
219 | | ... | ELSE | Set Variable | ${subif_index_1}
220 | | VPP Add IP Neighbor | ${dut} | ${dut_if2} | 2002:3::1 | ${tg1_if2_mac}
221 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if1} | 2002:1::2 | ${prefix}
222 | | Run Keyword If | '${dut2_status}' == 'PASS'
223 | | ... | VPP Interface Set IP Address | ${dut1} | ${subif_index_1} | 2002:2::1
224 | | ... | ${prefix}
225 | | Run Keyword If | '${dut2_status}' == 'PASS'
226 | | ... | VPP Interface Set IP Address | ${dut2} | ${subif_index_2} | 2002:2::2
227 | | ... | ${prefix}
228 | | VPP Interface Set IP Address | ${dut} | ${dut_if2} | 2002:3::2 | ${prefix}
229 | | Vpp All Ra Suppress Link Layer | ${nodes}
230 | | Vpp Route Add | ${dut1} | ${tg_if1_net} | ${host_prefix}
231 | | ... | gateway=2002:1::1 | interface=${dut1_if1}
232 | | Run Keyword If | '${dut2_status}' == 'PASS'
233 | | ... | Vpp Route Add | ${dut1} | ${tg_if2_net} | ${host_prefix}
234 | | ... | gateway=2002:2::2 | interface=${subif_index_1}
235 | | Run Keyword If | '${dut2_status}' == 'PASS'
236 | | ... | Vpp Route Add | ${dut2} | ${tg_if1_net} | ${host_prefix}
237 | | ... | gateway=2002:2::1 | interface=${subif_index_2}
238 | | Vpp Route Add | ${dut} | ${tg_if2_net} | ${host_prefix}
239 | | ... | gateway=2002:3::1 | interface=${dut_if2}
240
241 | Initialize IPv6 forwarding over SRv6 with encapsulation with '${n}' x SID '${prepos}' decapsulation in 3-node circular topology
242 | | [Documentation]
243 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
244 | | ... | topology. Get the interface MAC addresses and setup neighbours on all
245 | | ... | VPP interfaces. Setup IPv6 addresses on all interfaces. Set segment
246 | | ... | routing for IPv6 for required number of SIDs and configure IPv6 routes
247 | | ... | on both DUT nodes.
248 | | ...
249 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
250 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
251 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
252 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
253 | | VPP Interface Set IP Address
254 | | ... | ${dut1} | ${dut1_if1} | ${dut1_if1_ip6} | ${prefix}
255 | | VPP Interface Set IP Address
256 | | ... | ${dut1} | ${dut1_if2} | ${dut1_if2_ip6} | ${prefix}
257 | | VPP Interface Set IP Address
258 | | ... | ${dut2} | ${dut2_if1} | ${dut2_if1_ip6} | ${prefix}
259 | | VPP Interface Set IP Address
260 | | ... | ${dut2} | ${dut2_if2} | ${dut2_if2_ip6} | ${prefix}
261 | | Vpp All Ra Suppress Link Layer | ${nodes}
262 | | :FOR | ${number} | IN RANGE | 2 | ${dst_addr_nr}+2
263 | | | ${hexa_nr}= | Convert To Hex | ${number}
264 | | | VPP Add IP Neighbor | ${dut1}
265 | | | ... | ${dut1_if1} | ${tg_if1_ip6_subnet}${hexa_nr} | ${tg1_if1_mac}
266 | | | VPP Add IP Neighbor | ${dut2}
267 | | | ... | ${dut2_if2} | ${tg_if2_ip6_subnet}${hexa_nr} | ${tg1_if2_mac}
268 | | VPP Add IP Neighbor
269 | | ... | ${dut1} | ${dut1_if2} | ${dut2_if1_ip6} | ${dut2_if1_mac}
270 | | VPP Add IP Neighbor
271 | | ... | ${dut2} | ${dut2_if1} | ${dut1_if2_ip6} | ${dut1_if2_mac}
272 | | ${sid1}= | Set Variable If
273 | | ... | "${n}" == "1" | ${dut2_sid1}
274 | | ... | "${n}" == "2" | ${dut2_sid1_1}
275 | | ${sid2}= | Set Variable If
276 | | ... | "${n}" == "1" | ${dut1_sid2}
277 | | ... | "${n}" == "2" | ${dut1_sid2_1}
278 | | Vpp Route Add | ${dut1} | ${sid1} | ${sid_prefix} | gateway=${dut2_if1_ip6}
279 | | ... | interface=${dut1_if2}
280 | | Vpp Route Add | ${dut2} | ${sid2} | ${sid_prefix} | gateway=${dut1_if2_ip6}
281 | | ... | interface=${dut2_if1}
282 # Configure SRv6 for direction0
283 | | Set SR Encaps Source Address on DUT | ${dut1} | ${dut1_sid1}
284 | | @{sid_list_dir0}= | Run Keyword If | "${n}" == "1"
285 | | ... | Create List | ${dut2_sid1}
286 | | ... | ELSE IF | "${n}" == "2"
287 | | ... | Create List | ${dut2_sid1_1} | ${dut2_sid1_2}
288 | | Configure SR Policy on DUT | ${dut1} | ${dut1_bsid} | encap
289 | | ... | @{sid_list_dir0}
290 | | Configure SR Steer on DUT | ${dut1} | L3 | ${dut1_bsid}
291 | | ... | ip_addr=${tg_if2_ip6_subnet} | prefix=${sid_prefix}
292 | | Run Keyword If | "${n}" == "1"
293 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.dx6
294 | | ... | interface=${dut2_if2} | next_hop=${tg_if2_ip6_subnet}2
295 | | Run Keyword If | "${n}" == "2"
296 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1_1} | end
297 | | Run Keyword If | "${n}" == "2" and "${prepos}" != "without"
298 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1_2} | end.dx6
299 | | ... | interface=${dut2_if2} | next_hop=${tg_if2_ip6_subnet}2
300 | | Run Keyword If | "${n}" == "2" and "${prepos}" == "without"
301 | | ... | Vpp Route Add | ${dut2} | ${dut2_sid1_2} | ${sid_prefix}
302 | | ... | gateway=${tg_if2_ip6_subnet}2 | interface=${dut2_if2}
303 # Configure SRv6 for direction1
304 | | Set SR Encaps Source Address on DUT | ${dut2} | ${dut2_sid2}
305 | | @{sid_list_dir1}= | Run Keyword If | "${n}" == "1"
306 | | ... | Create List | ${dut1_sid2}
307 | | ... | ELSE IF | "${n}" == "2"
308 | | ... | Create List | ${dut1_sid2_1} | ${dut1_sid2_2}
309 | | Configure SR Policy on DUT | ${dut2} | ${dut2_bsid} | encap
310 | | ... | @{sid_list_dir1}
311 | | Configure SR Steer on DUT | ${dut2} | L3 | ${dut2_bsid}
312 | | ... | ip_addr=${tg_if1_ip6_subnet} | prefix=${sid_prefix}
313 | | Run Keyword If | "${n}" == "1"
314 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.dx6
315 | | ... | interface=${dut1_if1} | next_hop=${tg_if1_ip6_subnet}2
316 | | Run Keyword If | "${n}" == "2"
317 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2_1} | end
318 | | Run Keyword If | "${n}" == "2" and "${prepos}" != "without"
319 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2_2} | end.dx6
320 | | ... | interface=${dut1_if1} | next_hop=${tg_if1_ip6_subnet}2
321 | | Run Keyword If | "${n}" == "2" and "${prepos}" == "without"
322 | | ... | Vpp Route Add | ${dut1} | ${dut1_sid2_2} | ${sid_prefix}
323 | | ... | gateway=${tg_if1_ip6_subnet}2 | interface=${dut1_if1}
324 | | Set interfaces in path up
325
326 | Initialize IPv6 forwarding over SRv6 with endpoint to SR-unaware Service Function via '${behavior}' behaviour in 3-node circular topology
327 | | [Documentation]
328 | | ... | Create pair of Memif interfaces on all defined VPP nodes. Set UP
329 | | ... | state on VPP interfaces in path on nodes in 3-node circular topology.
330 | | ... | Get the interface MAC addresses and setup neighbours on all VPP
331 | | ... | interfaces. Setup IPv6 addresses on all interfaces. Set segment
332 | | ... | routing for IPv6 with defined behaviour function and configure IPv6
333 | | ... | routes on both DUT nodes.
334 | | ...
335 | | ... | *Note:*
336 | | ... | KW uses test variable rxq_count_int set by KW Add worker threads
337 | | ... | and rxqueues to all DUTs
338 | | ...
339 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
340 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
341 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
342 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
343 | | ${sock1}= | Set Variable | memif-DUT1_CNF
344 | | ${sock2}= | Set Variable | memif-DUT2_CNF
345 | | Set up memif interfaces on DUT node | ${dut1} | ${sock1} | ${sock1}
346 | | ... | ${1} | dut1-memif-1-if1 | dut1-memif-1-if2 | ${rxq_count_int}
347 | | ... | ${rxq_count_int}
348 | | VPP Set interface MTU | ${dut1} | ${dut1-memif-1-if1}
349 | | VPP Set interface MTU | ${dut1} | ${dut1-memif-1-if2}
350 | | Set up memif interfaces on DUT node | ${dut2} | ${sock2} | ${sock2}
351 | | ... | ${1} | dut2-memif-1-if1 | dut2-memif-1-if2 | ${rxq_count_int}
352 | | ... | ${rxq_count_int}
353 | | VPP Set interface MTU | ${dut2} | ${dut2-memif-1-if1}
354 | | VPP Set interface MTU | ${dut2} | ${dut2-memif-1-if2}
355 | | ${duts}= | Get Matches | ${nodes} | DUT*
356 | | :FOR | ${dut} | IN | @{duts}
357 | | | Show Memif | ${nodes['${dut}']}
358 | | VPP Interface Set IP Address
359 | | ... | ${dut1} | ${dut1_if1} | ${dut1_if1_ip6} | ${prefix}
360 | | VPP Interface Set IP Address
361 | | ... | ${dut1} | ${dut1_if2} | ${dut1_if2_ip6} | ${prefix}
362 | | VPP Interface Set IP Address | ${dut1} | ${dut1-memif-1-if1}
363 | | ... | ${dut1-memif-1-if1_ip6} | ${mem_prefix}
364 | | VPP Interface Set IP Address | ${dut1} | ${dut1-memif-1-if2}
365 | | ... | ${dut1-memif-1-if2_ip6} | ${mem_prefix}
366 | | VPP Interface Set IP Address
367 | | ... | ${dut2} | ${dut2_if1} | ${dut2_if1_ip6} | ${prefix}
368 | | VPP Interface Set IP Address
369 | | ... | ${dut2} | ${dut2_if2} | ${dut2_if2_ip6} | ${prefix}
370 | | VPP Interface Set IP Address | ${dut2} | ${dut2-memif-1-if1}
371 | | ... | ${dut2-memif-1-if1_ip6} | ${mem_prefix}
372 | | VPP Interface Set IP Address | ${dut2} | ${dut2-memif-1-if2}
373 | | ... | ${dut2-memif-1-if2_ip6} | ${mem_prefix}
374 | | Vpp All Ra Suppress Link Layer | ${nodes}
375 | | VPP Add IP Neighbor
376 | | ... | ${dut1} | ${dut1_if2} | ${dut2_if1_ip6} | ${dut2_if1_mac}
377 | | VPP Add IP Neighbor
378 | | ... | ${dut2} | ${dut2_if1} | ${dut1_if2_ip6} | ${dut1_if2_mac}
379 | | VPP Add IP Neighbor
380 | | ... | ${dut1} | ${dut1_if1} | ${tg_if1_ip6_subnet}2 | ${tg1_if1_mac}
381 | | VPP Add IP Neighbor
382 | | ... | ${dut2} | ${dut2_if2} | ${tg_if2_ip6_subnet}2 | ${tg1_if2_mac}
383 | | ${dut1-memif-1-if2_mac}= | Get Interface MAC | ${dut1} | memif2
384 | | ${dut2-memif-1-if2_mac}= | Get Interface MAC | ${dut2} | memif2
385 | | VPP Add IP Neighbor | ${dut1}
386 | | ... | ${dut1-memif-1-if1} | ${dut1_nh} | ${dut1-memif-1-if2_mac}
387 | | VPP Add IP Neighbor | ${dut2}
388 | | ... | ${dut2-memif-1-if1} | ${dut2_nh} | ${dut2-memif-1-if2_mac}
389 | | Vpp Route Add | ${dut1} | ${dut2_sid1} | ${sid_prefix}
390 | | ... | gateway=${dut2_if1_ip6} | interface=${dut1_if2}
391 | | Vpp Route Add | ${dut1} | ${out_sid2_1} | ${sid_prefix}
392 | | ... | gateway=${tg_if1_ip6_subnet}2 | interface=${dut1_if1}
393 | | Vpp Route Add | ${dut2} | ${dut1_sid2} | ${sid_prefix}
394 | | ... | gateway=${dut1_if2_ip6} | interface=${dut2_if1}
395 | | Vpp Route Add | ${dut2} | ${out_sid1_1} | ${sid_prefix}
396 | | ... | gateway=${tg_if2_ip6_subnet}2 | interface=${dut2_if2}
397 # Configure SRv6 for direction0 on DUT1
398 | | Set SR Encaps Source Address on DUT | ${dut1} | ${dut1_sid1}
399 | | @{sid_list_dir0}= | Create List | ${dut2_sid1} | ${out_sid1_1}
400 | | ... | ${out_sid1_2}
401 | | Configure SR Policy on DUT | ${dut1} | ${dut1_bsid} | encap
402 | | ... | @{sid_list_dir0}
403 | | Configure SR Steer on DUT | ${dut1} | L3 | ${dut1_bsid}
404 | | ... | ip_addr=${tg_if2_ip6_subnet} | prefix=${sid_prefix}
405 # Configure SRv6 for direction1 on DUT2
406 | | Set SR Encaps Source Address on DUT | ${dut2} | ${dut2_sid2}
407 | | @{sid_list_dir1}= | Create List | ${dut1_sid2} | ${out_sid2_1}
408 | | ... | ${out_sid2_2}
409 | | Configure SR Policy on DUT | ${dut2} | ${dut2_bsid} | encap
410 | | ... | @{sid_list_dir1}
411 | | Configure SR Steer on DUT | ${dut2} | L3 | ${dut2_bsid}
412 | | ... | ip_addr=${tg_if1_ip6_subnet} | prefix=${sid_prefix}
413 # Configure SRv6 for direction0 on DUT2
414 | | ${dut2_out_if}= | Get Interface Name | ${dut2} | memif1
415 | | ${dut2_in_if}= | Get Interface Name | ${dut2} | memif2
416 | | Remove Values From List | ${sid_list_dir0} | ${dut2_sid1}
417 | | Run Keyword If | "${behavior}" == "static_proxy"
418 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.as
419 | | ... | ${NONE} | ${dut2_nh} | ${NONE} | ${dut2_out_if} | ${dut2_in_if}
420 | | ... | ${dut1_sid1} | @{sid_list_dir0}
421 | | ... | ELSE IF | "${behavior}" == "dynamic_proxy"
422 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.ad
423 | | ... | next_hop=${dut2_nh} | out_if=${dut2_out_if} | in_if=${dut2_in_if}
424 | | ... | ELSE IF | "${behavior}" == "masquerading"
425 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.am
426 | | ... | next_hop=${dut2_nh} | out_if=${dut2_out_if} | in_if=${dut2_in_if}
427 | | ... | ELSE | Fail | Unsupported behaviour: ${behavior}
428 # Configure SRv6 for direction1 on DUT1
429 | | ${dut1_out_if}= | Get Interface Name | ${dut1} | memif1
430 | | ${dut1_in_if}= | Get Interface Name | ${dut1} | memif2
431 | | Remove Values From List | ${sid_list_dir1} | ${dut1_sid2}
432 | | Run Keyword If | "${behavior}" == "static_proxy"
433 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.as
434 | | ... | ${NONE} | ${dut1_nh} | ${NONE} | ${dut1_out_if} | ${dut1_in_if}
435 | | ... | ${dut2_sid2} | @{sid_list_dir1}
436 | | ... | ELSE IF | "${behavior}" == "dynamic_proxy"
437 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.ad
438 | | ... | next_hop=${dut1_nh} | out_if=${dut1_out_if} | in_if=${dut1_in_if}
439 | | ... | ELSE IF | "${behavior}" == "masquerading"
440 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.am
441 | | ... | next_hop=${dut1_nh} | out_if=${dut1_out_if} | in_if=${dut1_in_if}
442 | | ... | ELSE | Fail | Unsupported behaviour: ${behavior}
443 | | Set interfaces in path up
444
445 | Initialize L2 patch
446 | | [Documentation]
447 | | ... | Setup L2 patch topology by cross connecting two interfaces on
448 | | ... | each DUT. Interfaces are brought up.
449 | | ...
450 | | Set interfaces in path up
451 | | ${duts}= | Get Matches | ${nodes} | DUT*
452 | | :FOR | ${dut} | IN | @{duts}
453 | | | Configure L2patch | ${nodes['${dut}']} | ${${dut}_if1} | ${${dut}_if2}
454
455 | Initialize L2 xconnect in 2-node circular topology
456 | | [Documentation]
457 | | ... | Setup L2 xconnect topology by cross connecting two interfaces on
458 | | ... | each DUT. Interfaces are brought up.
459 | | ...
460 | | Set interfaces in path up
461 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1_if2}
462
463 | Initialize L2 xconnect in 3-node circular topology
464 | | [Documentation]
465 | | ... | Setup L2 xconnect topology by cross connecting two interfaces on
466 | | ... | each DUT. Interfaces are brought up.
467 | | ... |
468 | | Set interfaces in path up
469 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1_if2}
470 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
471
472 | Initialize L2 xconnect with VXLANoIPv4 in 3-node circular topology
473 | | [Documentation]
474 | | ... | Setup L2 xconnect topology with VXLANoIPv4 by cross connecting
475 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
476 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
477 | | ... | between DUTs. VXLAN sub-interfaces has same IPv4 address as
478 | | ... | interfaces.
479 | | ...
480 | | Set interfaces in path up
481 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if2} | 172.16.0.1 | 24
482 | | VPP Interface Set IP Address | ${dut2} | ${dut2_if1} | 172.16.0.2 | 24
483 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
484 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
485 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if2} | 172.16.0.2 | ${dut2_if1_mac}
486 | | VPP Add IP Neighbor | ${dut2} | ${dut2_if1} | 172.16.0.1 | ${dut1_if2_mac}
487 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
488 | | ... | 172.16.0.1 | 172.16.0.2
489 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${dut1s_vxlan}
490 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
491 | | ... | 172.16.0.2 | 172.16.0.1
492 | | Configure L2XC | ${dut2} | ${dut2_if2} | ${dut2s_vxlan}
493
494 | Initialize L2 xconnect with Vhost-User on node
495 | | [Documentation]
496 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on
497 | | ... | defined VPP node. Add each Vhost-User interface into L2 cross-connect
498 | | ... | with with physical inteface or Vhost-User interface of another VM.
499 | | ...
500 | | ... | *Arguments:*
501 | | ... | - dut - DUT node. Type: string
502 | | ... | - nf_nodes - VM count. Type: integer
503 | | ...
504 | | ... | *Note:*
505 | | ... | Socket paths for VM are defined in following format:
506 | | ... | - /tmp/sock-\${VM_ID}-1
507 | | ... | - /tmp/sock-\${VM_ID}-2
508 | | ...
509 | | ... | *Example:*
510 | | ...
511 | | ... | \| Initialize L2 xconnect with Vhost-User on node \| DUT1 \| 1 \|
512 | | ...
513 | | [Arguments] | ${dut} | ${nf_nodes}=${1}
514 | | ...
515 | | :FOR | ${number} | IN RANGE | 1 | ${nf_nodes}+1
516 | | | ${sock1}= | Set Variable | /var/run/vpp/sock-${number}-1
517 | | | ${sock2}= | Set Variable | /var/run/vpp/sock-${number}-2
518 | | | ${prev_index}= | Evaluate | ${number}-1
519 | | | Configure vhost interfaces for L2BD forwarding | ${nodes['${dut}']}
520 | | | ... | ${sock1} | ${sock2} | ${dut}-vhost-${number}-if1
521 | | | ... | ${dut}-vhost-${number}-if2
522 | | | ${dut_xconnect_if1}= | Set Variable If | ${number}==1 | ${${dut}_if1}
523 | | | ... | ${${dut}-vhost-${prev_index}-if2}
524 | | | Configure L2XC | ${nodes['${dut}']} | ${dut_xconnect_if1}
525 | | | ... | ${${dut}-vhost-${number}-if1}
526 | | | Run Keyword If | ${number}==${nf_nodes} | Configure L2XC
527 | | | ... | ${nodes['${dut}']} | ${${dut}-vhost-${number}-if2} | ${${dut}_if2}
528
529 | Initialize L2 xconnect with Vhost-User
530 | | [Documentation]
531 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on
532 | | ... | all VPP nodes. Add each Vhost-User interface into L2 cross-connect
533 | | ... | with with physical inteface or Vhost-User interface of another VM.
534 | | ...
535 | | ... | *Arguments:*
536 | | ... | - nf_nodes - VM count. Type: integer
537 | | ...
538 | | ... | *Example:*
539 | | ...
540 | | ... | \| Initialize L2 xconnect with Vhost-User \| 1 \|
541 | | ...
542 | | [Arguments] | ${nf_nodes}=${1}
543 | | ...
544 | | ${duts}= | Get Matches | ${nodes} | DUT*
545 | | :FOR | ${dut} | IN | @{duts}
546 | | | Initialize L2 xconnect with Vhost-User on node | ${dut}
547 | | | ... | nf_nodes=${nf_nodes}
548
549 | Initialize L2 xconnect with Vhost-User and VLAN in 3-node circular topology
550 | | [Documentation]
551 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Cross
552 | | ... | connect each Vhost interface with one physical interface.
553 | | ... | Setup VLAN between DUTs. All interfaces are brought up.
554 | | ...
555 | | ... | *Arguments:*
556 | | ... | - subid - ID of the sub-interface to be created. Type: string
557 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
558 | | ...
559 | | ... | *Example:*
560 | | ...
561 | | ... | \| L2 xconnect with Vhost-User and VLAN initialized in a 3-node\
562 | | ... | circular topology \| 10 \| pop-1 \|
563 | | ...
564 | | [Arguments] | ${subid} | ${tag_rewrite}
565 | | ...
566 | | Set interfaces in path up
567 | | Initialize VLAN dot1q sub-interfaces in circular topology
568 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
569 | | Configure L2 tag rewrite method on interfaces
570 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
571 | | ... | ${tag_rewrite}
572 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
573 | | ... | /var/run/vpp/sock-1-1 | /var/run/vpp/sock-1-2
574 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${vhost_if1}
575 | | Configure L2XC | ${dut1} | ${subif_index_1} | ${vhost_if2}
576 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
577 | | ... | /var/run/vpp/sock-1-1 | /var/run/vpp/sock-1-2
578 | | Configure L2XC | ${dut2} | ${subif_index_2} | ${vhost_if1}
579 | | Configure L2XC | ${dut2} | ${dut2_if2} | ${vhost_if2}
580
581 | Initialize L2 xconnect with Vhost-User and VLAN with VPP link bonding in 3-node circular topology
582 | | [Documentation]
583 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Create one
584 | | ... | link bonding (BondEthernet) interface on both VPP nodes. Enslave one
585 | | ... | physical interface towards next DUT by BondEthernet interface. Setup
586 | | ... | VLAN on BondEthernet interfaces between DUTs. Cross connect one Vhost
587 | | ... | interface with physical interface towards TG and other Vhost interface
588 | | ... | with VLAN sub-interface. All interfaces are brought up.
589 | | ...
590 | | ... | *Arguments:*
591 | | ... | - subid - ID of the sub-interface to be created. Type: string
592 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
593 | | ... | - bond_mode - Link bonding mode. Type: string
594 | | ... | - lb_mode - Load balance mode. Type: string
595 | | ...
596 | | ... | *Example:*
597 | | ...
598 | | ... | \| Initialize L2 xconnect with Vhost-User and VLAN with VPP link\
599 | | ... | bonding in 3-node circular topology \| 10 \| pop-1 \| xor \| l34 \|
600 | | ...
601 | | [Arguments] | ${subid} | ${tag_rewrite} | ${bond_mode} | ${lb_mode}
602 | | ...
603 | | Set interfaces in path up
604 | | ${dut1_eth_bond_if1}= | VPP Create Bond Interface | ${dut1} | ${bond_mode}
605 | | ... | ${lb_mode}
606 | | Set Interface State | ${dut1} | ${dut1_eth_bond_if1} | up
607 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
608 | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
609 | | ... | Variable Should Exist | ${dut1_if2}
610 | | Run Keyword If | '${if2_status}' == 'PASS'
611 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2}
612 | | ... | ${dut1_eth_bond_if1}
613 | | ... | ELSE
614 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2_1}
615 | | ... | ${dut1_eth_bond_if1}
616 | | Run Keyword Unless | '${if2_status}' == 'PASS'
617 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2_2}
618 | | ... | ${dut1_eth_bond_if1}
619 | | ${dut2_eth_bond_if1}= | VPP Create Bond Interface | ${dut2} | ${bond_mode}
620 | | ... | ${lb_mode}
621 | | Set Interface State | ${dut2} | ${dut2_eth_bond_if1} | up
622 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
623 | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
624 | | ... | Variable Should Exist | ${dut2_if1}
625 | | Run Keyword If | '${if1_status}' == 'PASS'
626 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1}
627 | | ... | ${dut2_eth_bond_if1}
628 | | ... | ELSE
629 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1_1}
630 | | ... | ${dut2_eth_bond_if1}
631 | | Run Keyword Unless | '${if2_status}' == 'PASS'
632 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1_2}
633 | | ... | ${dut2_eth_bond_if1}
634 | | VPP Show Bond Data On All Nodes | ${nodes} | verbose=${TRUE}
635 | | Initialize VLAN dot1q sub-interfaces in circular topology
636 | | ... | ${dut1} | ${dut1_eth_bond_if1} | ${dut2} | ${dut2_eth_bond_if1}
637 | | ... | ${subid}
638 | | Configure L2 tag rewrite method on interfaces
639 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
640 | | ... | ${tag_rewrite}
641 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
642 | | ... | /var/run/vpp/sock-1-1 | /var/run/vpp/sock-1-2
643 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${vhost_if1}
644 | | Configure L2XC | ${dut1} | ${subif_index_1} | ${vhost_if2}
645 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
646 | | ... | /var/run/vpp/sock-1-1 | /var/run/vpp/sock-1-2
647 | | Configure L2XC | ${dut2} | ${subif_index_2} | ${vhost_if1}
648 | | Configure L2XC | ${dut2} | ${dut2_if2} | ${vhost_if2}
649
650 | Initialize L2 bridge domain in circular topology
651 | | [Documentation]
652 | | ... | Setup L2 DB topology by adding two interfaces on each DUT into BD
653 | | ... | that is created automatically with index 1. Learning is enabled.
654 | | ... | Interfaces are brought up.
655 | | ...
656 | | ... | *Arguments:*
657 | | ... | - bd_id - Bridge domain ID. Type: integer
658 | | ...
659 | | ... | *Example:*
660 | | ...
661 | | ... | \| Initialize L2 bridge domain in circular topology \| 1 \|
662 | | ...
663 | | [Arguments] | ${bd_id}=${1}
664 | | ...
665 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
666 | | ... | Variable Should Exist | ${dut2}
667 | | ...
668 | | Set interfaces in path up
669 | | ...
670 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id}
671 | | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${bd_id}
672 | | Run Keyword If | '${dut2_status}' == 'PASS'
673 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${bd_id}
674 | | Run Keyword If | '${dut2_status}' == 'PASS'
675 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id}
676
677 | Configure IPv4 ACLs
678 | | [Documentation]
679 | | ... | Configure ACL with required number of not-hitting permit ACEs plus two
680 | | ... | hitting ACEs for both traffic directions.
681 | | ...
682 | | ... | *Arguments:*
683 | | ... | - dut_node - DUT node. Type: dictionary
684 | | ... | - dut_if1 - DUT node interface1 name (Optional). Type: string
685 | | ... | - dut_if2 - DUT node interface2 name (Optional). Type: string
686 | | ...
687 | | ... | *Example:*
688 | | ...
689 | | ... | \| Configure IPv4 ACLs \| ${nodes['DUT1']} \| GigabitEthernet0/7/0 \
690 | | ... | \| GigabitEthernet0/8/0 \|
691 | | ...
692 | | ... | _NOTE:_ This KW uses following test case variables:
693 | | ... | - src_ip_start - Source IP address start. Type: string
694 | | ... | - dst_ip_start - Destination IP address start. Type: string
695 | | ... | - ip_step - IP address step. Type: string
696 | | ... | - sport_start - Source port number start. Type: string
697 | | ... | - dport_start - Destination port number start. Type: string
698 | | ... | - port_step - Port number step. Type: string
699 | | ... | - no_hit_aces_number - Number of not-hitting ACEs to be configured.
700 | | ... | Type: integer
701 | | ... | - acl_apply_type - To what path apply the ACL - input or output.
702 | | ... | Type: string
703 | | ... | - acl_action - Action for the rule - deny, permit, permit+reflect.
704 | | ... | Type: string
705 | | ... | - trex_stream1_subnet - IP subnet used by T-Rex in direction 0->1.
706 | | ... | Type: string
707 | | ... | - trex_stream2_subnet - IP subnet used by T-Rex in direction 1->0.
708 | | ... | Type: string
709 | | ...
710 | | [Arguments] | ${dut} | ${dut_if1}=${NONE} | ${dut_if2}=${NONE}
711 | | ${src_ip_int} = | Evaluate
712 | | ... | int(ipaddress.ip_address(unicode($src_ip_start))) - $ip_step
713 | | ... | modules=ipaddress
714 | | ${dst_ip_int} = | Evaluate
715 | | ... | int(ipaddress.ip_address(unicode($dst_ip_start))) - $ip_step
716 | | ... | modules=ipaddress
717 | | ${ip_limit} = | Set Variable | 255.255.255.255
718 | | ${ip_limit_int} = | Evaluate
719 | | ... | int(ipaddress.ip_address(unicode($ip_limit))) | modules=ipaddress
720 | | ${sport}= | Evaluate | $sport_start - $port_step
721 | | ${dport}= | Evaluate | $dport_start - $port_step
722 | | ${port_limit}= | Set Variable | ${65535}
723 | | ${acl}= | Set Variable | ipv4 permit
724 | | :FOR | ${nr} | IN RANGE | 0 | ${no_hit_aces_number}
725 | | | ${src_ip_int} = | Evaluate | $src_ip_int + $ip_step
726 | | | ${dst_ip_int} = | Evaluate | $dst_ip_int + $ip_step
727 | | | ${sport}= | Evaluate | $sport + $port_step
728 | | | ${dport}= | Evaluate | $dport + $port_step
729 | | | ${ipv4_limit_reached}= | Set Variable If
730 | | | ... | $src_ip_int > $ip_limit_int or $src_ip_int > $ip_limit_int
731 | | | ... | ${TRUE}
732 | | | ${udp_limit_reached}= | Set Variable If
733 | | | ... | $sport > $port_limit or $dport > $port_limit | ${TRUE}
734 | | | Run Keyword If | $ipv4_limit_reached is True | Log
735 | | | ... | Can't do more iterations - IPv4 address limit has been reached.
736 | | | ... | WARN
737 | | | Run Keyword If | $udp_limit_reached is True | Log
738 | | | ... | Can't do more iterations - UDP port limit has been reached.
739 | | | ... | WARN
740 | | | ${src_ip} = | Run Keyword If | $ipv4_limit_reached is True
741 | | | ... | Set Variable | ${ip_limit}
742 | | | ... | ELSE | Evaluate | str(ipaddress.ip_address($src_ip_int))
743 | | | ... | modules=ipaddress
744 | | | ${dst_ip} = | Run Keyword If | $ipv4_limit_reached is True
745 | | | ... | Set Variable | ${ip_limit}
746 | | | ... | ELSE | Evaluate | str(ipaddress.ip_address($dst_ip_int))
747 | | | ... | modules=ipaddress
748 | | | ${sport}= | Set Variable If | ${sport} > $port_limit | $port_limit
749 | | | ... | ${sport}
750 | | | ${dport}= | Set Variable If | ${dport} > $port_limit | $port_limit
751 | | | ... | ${dport}
752 | | | ${acl}= | Catenate | ${acl} | src ${src_ip}/32 dst ${dst_ip}/32
753 | | | ... | sport ${sport} | dport ${dport},
754 | | | Exit For Loop If
755 | | | ... | $ipv4_limit_reached is True or $udp_limit_reached is True
756 | | ${acl}= | Catenate | ${acl}
757 | | ... | ipv4 ${acl_action} src ${trex_stream1_subnet},
758 | | ... | ipv4 ${acl_action} src ${trex_stream2_subnet}
759 | | Add Replace Acl Multi Entries | ${dut} | rules=${acl}
760 | | @{acl_list}= | Create List | ${0}
761 | | Run Keyword If | 'input' in $acl_apply_type and $dut_if1 is not None
762 | | ... | Set Acl List For Interface | ${dut} | ${dut_if1} | input | ${acl_list}
763 | | Run Keyword If | 'input' in $acl_apply_type and $dut_if2 is not None
764 | | ... | Set Acl List For Interface | ${dut} | ${dut_if2} | input | ${acl_list}
765 | | Run Keyword If | 'output' in $acl_apply_type and $dut_if1 is not None
766 | | ... | Set Acl List For Interface | ${dut} | ${dut_if1} | output
767 | | ... | ${acl_list}
768 | | Run Keyword If | 'output' in $acl_apply_type and $dut_if2 is not None
769 | | ... | Set Acl List For Interface | ${dut} | ${dut_if2} | output
770 | | ... | ${acl_list}
771
772 | Initialize L2 bridge domain with IPv4 ACLs on DUT1 in 3-node circular topology
773 | | [Documentation]
774 | | ... | Setup L2BD topology by adding two interfaces on DUT1 into bridge
775 | | ... | domain that is created automatically with index 1. Learning is
776 | | ... | enabled. Interfaces are brought up. Apply required ACL rules to DUT1
777 | | ... | interfaces.
778 | | ...
779 | | ... | *Arguments:*
780 | | ... | _None_
781 | | ...
782 | | ... | *Example:*
783 | | ...
784 | | ... | \| Initialize L2 bridge domain with IPv4 ACLs on DUT1 in 3-node \
785 | | ... | circular topology \|
786 | | ...
787 | | ... | _NOTE:_ This KW uses following test case variables:
788 | | ... | - dut1 - DUT1 node.
789 | | ... | - dut2 - DUT2 node.
790 | | ... | - dut1_if1 - DUT1 interface towards TG.
791 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
792 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
793 | | ... | - dut2_if2 - DUT2 interface towards TG.
794 | | ...
795 | | Set interfaces in path up
796 | | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1_if2}
797 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
798 | | Configure IPv4 ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
799
800 | Initialize IPv4 routing for '${ip_nr}' addresses with IPv4 ACLs on DUT1 in circular topology
801 | | [Documentation]
802 | | ... | Set UP state on VPP interfaces in path on nodes in 2-node / 3-node
803 | | ... | circular topology. Get the interface MAC addresses and setup ARP on
804 | | ... | all VPP interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG
805 | | ... | links. In case of 3-node topology setup IPv4 adresses with /30 prefix
806 | | ... | on DUT1-DUT2 link and set routing on both DUT nodes with prefix /24
807 | | ... | and next hop of neighbour DUT interface IPv4 address.
808 | | ... | Apply required ACL rules to DUT1 interfaces.
809 | | ...
810 | | ... | *Arguments:*
811 | | ... | - ip_nr - Number of IPs to be used. Type: integer or string
812 | | ...
813 | | ... | *Example:*
814 | | ...
815 | | ... | \| Initialize IPv4 routing for '10' addresses with IPv4 ACLs on DUT1 \
816 | | ... | in 3-node circular topology \|
817 | | ...
818 | | ... | _NOTE:_ This KW uses following test case variables:
819 | | ... | - tg - TG node.
820 | | ... | - dut1 - DUT1 node.
821 | | ... | - dut2 - DUT2 node.
822 | | ... | - tg_if1 - TG interface 1 towards DUT1.
823 | | ... | - tg_if2 - TG interface 2 towards DUT2 (3-node topo) or DUT1
824 | | ... | (2-node topo).
825 | | ... | - dut1_if1 - DUT1 interface 1 towards TG.
826 | | ... | - dut1_if2 - DUT1 interface 2 towards DUT2 (3-node topo) or TG
827 | | ... | (2-node topo).
828 | | ... | - dut2_if1 - DUT2 interface 1 towards DUT1.
829 | | ... | - dut2_if2 - DUT2 interface 2 towards TG.
830 | | ...
831 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
832 | | ... | Variable Should Exist | ${dut2}
833 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
834 | | ... | Set Variable | ${dut2}
835 | | ... | ELSE | Set Variable | ${dut1}
836 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
837 | | ... | Set Variable | ${dut2_if2}
838 | | ... | ELSE | Set Variable | ${dut1_if2}
839 | | ...
840 | | Set interfaces in path up
841 | | ...
842 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
843 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
844 | | ${dut1_if2_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
845 | | ... | Get Interface MAC | ${dut1} | ${dut1_if2}
846 | | ${dut2_if1_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
847 | | ... | Get Interface MAC | ${dut2} | ${dut2_if1}
848 | | ...
849 | | :FOR | ${number} | IN RANGE | 2 | ${ip_nr}+2
850 | | | VPP Add IP Neighbor
851 | | | ... | ${dut1} | ${dut1_if1} | 10.10.10.${number} | ${tg1_if1_mac}
852 | | | VPP Add IP Neighbor
853 | | | ... | ${dut} | ${dut_if2} | 20.20.20.${number} | ${tg1_if2_mac}
854 | | Run Keyword If | '${dut2_status}' == 'PASS'
855 | | ... | VPP Add IP Neighbor
856 | | ... | ${dut1} | ${dut1_if2} | 1.1.1.2 | ${dut2_if1_mac}
857 | | Run Keyword If | '${dut2_status}' == 'PASS'
858 | | ... | VPP Add IP Neighbor
859 | | ... | ${dut2} | ${dut2_if1} | 1.1.1.1 | ${dut1_if2_mac}
860 | | ...
861 | | VPP Interface Set IP Address
862 | | ... | ${dut1} | ${dut1_if1} | 10.10.10.1 | 24
863 | | VPP Interface Set IP Address
864 | | ... | ${dut} | ${dut_if2} | 20.20.20.1 | 24
865 | | Run Keyword If | '${dut2_status}' == 'PASS'
866 | | ... | VPP Interface Set IP Address
867 | | ... | ${dut1} | ${dut1_if2} | 1.1.1.1 | 30
868 | | Run Keyword If | '${dut2_status}' == 'PASS'
869 | | ... | VPP Interface Set IP Address
870 | | ... | ${dut2} | ${dut2_if1} | 1.1.1.2 | 30
871 | | ...
872 | | Run Keyword If | '${dut2_status}' == 'PASS'
873 | | ... | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | gateway=1.1.1.2
874 | | ... | interface=${dut1_if2}
875 | | Run Keyword If | '${dut2_status}' == 'PASS'
876 | | ... | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | gateway=1.1.1.1
877 | | ... | interface=${dut2_if1}
878 | | ...
879 | | Configure IPv4 ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
880
881 | Configure MACIP ACLs
882 | | [Documentation]
883 | | ... | Configure MACIP ACL with required number of not-hitting permit ACEs
884 | | ... | plus two hitting ACEs for both traffic directions.
885 | | ...
886 | | ... | *Arguments:*
887 | | ... | - dut_node - DUT node. Type: dictionary
888 | | ... | - dut_if1 - DUT node interface1 name (Optional). Type: string
889 | | ... | - dut_if2 - DUT node interface2 name (Optional). Type: string
890 | | ...
891 | | ... | *Example:*
892 | | ...
893 | | ... | \| Configure MACIP ACLs \| ${nodes['DUT1']} \| GigabitEthernet0/7/0 \
894 | | ... | \| GigabitEthernet0/8/0 \|
895 | | ...
896 | | ... | _NOTE:_ This KW uses following test case variables:
897 | | ... | - src_ip_start - Source IP address start. Type: string
898 | | ... | - ip_step - IP address step. Type: string
899 | | ... | - src_mac_start - Source MAC address start in format with colons.
900 | | ... | Type: string
901 | | ... | - src_mac_step - Source MAC address step. Type: string
902 | | ... | - src_mac_mask - Source MAC address mask. 00:00:00:00:00:00 is a
903 | | ... | wildcard mask. Type: string
904 | | ... | - no_hit_aces_number - Number of not-hitting ACEs to be configured.
905 | | ... | Type: integer
906 | | ... | - acl_action - Action for the rule - deny, permit, permit+reflect.
907 | | ... | Type: string
908 | | ... | - tg_stream1_subnet - IP subnet used by TG in direction 0->1.
909 | | ... | Type: string
910 | | ... | - tg_stream2_subnet - IP subnet used by TG in direction 1->0.
911 | | ... | Type: string
912 | | ... | - tg_stream1_mac - Source MAC address of traffic stream 1.
913 | | ... | Type: string
914 | | ... | - tg_stream2_mac - Source MAC address of traffic stream 2.
915 | | ... | Type: string
916 | | ... | - tg_mac_mask - MAC address mask for traffic streams.
917 | | ... | 00:00:00:00:00:00 is a wildcard mask. Type: string
918 | | ...
919 | | [Arguments] | ${dut} | ${dut_if1}=${NONE} | ${dut_if2}=${NONE}
920 | | ...
921 | | ${src_ip_int} = | IP To Int | ${src_ip_start}
922 | | ${src_ip_int} = | Evaluate | ${src_ip_int} - ${ip_step}
923 | | ...
924 | | ${ip_limit} = | Set Variable | 255.255.255.255
925 | | ${ip_limit_int} = | IP To Int | ${ip_limit}
926 | | ...
927 | | ${src_mac_int} = | Mac To Int | ${src_mac_start}
928 | | ${src_mac_int} = | Evaluate | ${src_mac_int} - ${src_mac_step}
929 | | ...
930 | | ${mac_limit} = | Set Variable | ff:ff:ff:ff:ff:ff
931 | | ${mac_limit_int} = | Mac To Int | ${mac_limit}
932 | | ...
933 | | ${acl}= | Set Variable | ipv4 permit
934 | | :FOR | ${nr} | IN RANGE | 0 | ${no_hit_aces_number}
935 | | | ${src_ip_int} = | Evaluate | ${src_ip_int} + ${ip_step}
936 | | | ${src_mac_int} = | Evaluate | ${src_mac_int} + ${src_mac_step}
937 | | | ${ipv4_limit_reached}= | Set Variable If
938 | | | ... | ${src_ip_int} > ${ip_limit_int} | ${TRUE}
939 | | | ${mac_limit_reached}= | Set Variable If
940 | | | ... | ${src_mac_int} > ${mac_limit_int} | ${TRUE}
941 | | | Run Keyword If | '${ipv4_limit_reached}' == '${TRUE}' | Log
942 | | | ... | Can't do more iterations - IPv4 address limit has been reached.
943 | | | ... | WARN
944 | | | Run Keyword If | '${mac_limit_reached}' == '${TRUE}' | Log
945 | | | ... | Can't do more iterations - MAC address limit has been reached.
946 | | | ... | WARN
947 | | | ${src_ip} = | Run Keyword If | '${ipv4_limit_reached}' == '${TRUE}'
948 | | | ... | Set Variable | ${ip_limit}
949 | | | ... | ELSE | Int To IP | ${src_ip_int}
950 | | | ${src_mac}= | Run Keyword If | '${mac_limit_reached}' == '${TRUE}'
951 | | | ... | Set Variable | ${mac_limit}
952 | | | ... | ELSE | Int To Mac | ${src_mac_int}
953 | | | ${acl}= | Catenate | ${acl} | ip ${src_ip}/32
954 | | | ... | mac ${src_mac} | mask ${src_mac_mask},
955 | | | Exit For Loop If | '${ipv4_limit_reached}' == '${TRUE}' or '${mac_limit_reached}' == '${TRUE}'
956 | | ${acl0}= | Catenate | ${acl}
957 | | ... | ipv4 ${acl_action} ip ${tg_stream1_subnet} mac ${tg_stream1_mac}
958 | | ... | mask ${tg_mac_mask}
959 | | ${acl1}= | Catenate | ${acl}
960 | | ... | ipv4 ${acl_action} ip ${tg_stream2_subnet} mac ${tg_stream2_mac}
961 | | ... | mask ${tg_mac_mask}
962 | | Add Macip Acl Multi Entries | ${dut} | rules=${acl0}
963 | | Add Macip Acl Multi Entries | ${dut} | rules=${acl1}
964 | | ${acl_idx}= | Set Variable | 0
965 | | Run Keyword Unless | '${dut_if1}' == '${NONE}'
966 | | ... | Add Del Macip Acl Interface | ${dut} | ${dut_if1} | add | ${acl_idx}
967 | | ${acl_idx}= | Set Variable | 1
968 | | Run Keyword Unless | '${dut_if2}' == '${NONE}'
969 | | ... | Add Del Macip Acl Interface | ${dut} | ${dut_if2} | add | ${acl_idx}
970
971 | Initialize L2 bridge domain with MACIP ACLs on DUT1 in 3-node circular topology
972 | | [Documentation]
973 | | ... | Setup L2BD topology by adding two interfaces on DUT1 into bridge
974 | | ... | domain that is created automatically with index 1. Learning is
975 | | ... | enabled. Interfaces are brought up. Apply required MACIP ACL rules to
976 | | ... | DUT1 interfaces.
977 | | ...
978 | | ... | *Arguments:*
979 | | ... | _None_
980 | | ...
981 | | ... | *Example:*
982 | | ...
983 | | ... | \| Initialize L2 bridge domain with MACIP ACLs on DUT1 in 3-node \
984 | | ... | circular topology \|
985 | | ...
986 | | ... | _NOTE 1:_ This KW uses following test case variables:
987 | | ... | - tg - TG node.
988 | | ... | - dut1 - DUT1 node.
989 | | ... | - dut2 - DUT2 node.
990 | | ... | - tg_if1 - TG interface towards DUT1.
991 | | ... | - tg_if2 - TG interface towards DUT2.
992 | | ... | - dut1_if1 - DUT1 interface towards TG.
993 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
994 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
995 | | ... | - dut2_if2 - DUT2 interface towards TG.
996 | | ...
997 | | Set interfaces in path up
998 | | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1_if2}
999 | | Configure L2XC | ${dut2} | ${dut2_if1} | ${dut2_if2}
1000 | | Configure MACIP ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
1001
1002 | Initialize L2 bridge domains with Vhost-User on node
1003 | | [Documentation]
1004 | | ... | Create pairs of Vhost-User interfaces for defined number of VMs on
1005 | | ... | defined VPP node. Add each Vhost-User interface into L2 bridge
1006 | | ... | domains with learning enabled with physical inteface or Vhost-User
1007 | | ... | interface of another VM.
1008 | | ...
1009 | | ... | *Arguments:*
1010 | | ... | - dut - DUT node. Type: string
1011 | | ... | - nf_chain - NF chain. Type: integer
1012 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
1013 | | ...
1014 | | ... | *Note:*
1015 | | ... | Socket paths for VM are defined in following format:
1016 | | ... | - /var/run/vpp/sock-\${VM_ID}-1
1017 | | ... | - /var/run/vpp/sock-\${VM_ID}-2
1018 | | ...
1019 | | ... | *Example:*
1020 | | ...
1021 | | ... | \| Initialize L2 bridge domains with Vhost-User on node \| DUT1 \
1022 | | ... | \| 1 \| 1 \|
1023 | | ...
1024 | | [Arguments] | ${dut} | ${nf_chain}=${1} | ${nf_nodes}=${1}
1025 | | ...
1026 | | ${bd_id1}= | Evaluate | ${nf_nodes} * (${nf_chain} - 1) + ${nf_chain}
1027 | | ${bd_id2}= | Evaluate | ${nf_nodes} * ${nf_chain} + ${nf_chain}
1028 | | ${dut_str}= | Convert To Lowercase | ${dut}
1029 | | Add interface to bridge domain
1030 | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${nf_chain}_1}
1031 | | ... | ${bd_id1}
1032 | | Add interface to bridge domain
1033 | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${nf_chain}_2}
1034 | | ... | ${bd_id2}
1035 | | :FOR | ${nf_node} | IN RANGE | 1 | ${nf_nodes} + 1
1036 | | | ${qemu_id}= | Evaluate | (${nf_chain} - ${1}) * ${nf_nodes} + ${nf_node}
1037 | | | Configure vhost interfaces for L2BD forwarding
1038 | | | ... | ${nodes['${dut}']}
1039 | | | ... | /var/run/vpp/sock-${qemu_id}-1 | /var/run/vpp/sock-${qemu_id}-2
1040 | | | ... | ${dut}-vhost-${qemu_id}-if1 | ${dut}-vhost-${qemu_id}-if2
1041 | | | ${bd_id1}= | Evaluate | ${qemu_id} + (${nf_chain} - 1)
1042 | | | ${bd_id2}= | Evaluate | ${bd_id1} + 1
1043 | | | Add interface to bridge domain
1044 | | | ... | ${nodes['${dut}']} | ${${dut}-vhost-${qemu_id}-if1} | ${bd_id1}
1045 | | | Add interface to bridge domain
1046 | | | ... | ${nodes['${dut}']} | ${${dut}-vhost-${qemu_id}-if2} | ${bd_id2}
1047
1048 | Initialize L2 bridge domains with Vhost-User
1049 | | [Documentation]
1050 | | ... | Create pairs of Vhost-User interfaces for defined number of VNF nodes
1051 | | ... | on all defined VPP nodes. Add each Vhost-User interface into L2 bridge
1052 | | ... | domains with learning enabled with physical inteface or Vhost-User
1053 | | ... | interface of another VM.
1054 | | ...
1055 | | ... | *Arguments:*
1056 | | ... | - nf_chain - NF chain. Type: integer
1057 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
1058 | | ...
1059 | | ... | *Example:*
1060 | | ...
1061 | | ... | \| Initialize L2 bridge domains with Vhost-User \| 1 \| 1 \|
1062 | | ...
1063 | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1}
1064 | | ...
1065 | | :FOR | ${dut} | IN | @{duts}
1066 | | | Initialize L2 bridge domains with Vhost-User on node
1067 | | | ... | ${dut} | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
1068
1069 | Initialize L2 bridge domains for multiple chains with Vhost-User
1070 | | [Documentation]
1071 | | ... | Create pairs of Vhost-User interfaces for defined number of NF chains
1072 | | ... | with defined number of VNF nodes on all defined VPP nodes. Add each
1073 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
1074 | | ... | with physical inteface or Vhost-User interface of another VM.
1075 | | ... | Put all interfaces in path up.
1076 | | ...
1077 | | ... | *Arguments:*
1078 | | ... | - nf_chains - Number of chains of NFs. Type: integer
1079 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
1080 | | ...
1081 | | ... | *Example:*
1082 | | ...
1083 | | ... | \| Initialize L2 bridge domains for multiple chains with Vhost-User \
1084 | | ... | \| 1 \| 1 \|
1085 | | ...
1086 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1}
1087 | | ...
1088 | | Set interfaces in path up
1089 | | :FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains} + 1
1090 | | | Initialize L2 bridge domains with Vhost-User
1091 | | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
1092
1093 | Initialize L2 bridge domain with VXLANoIPv4 in 3-node circular topology
1094 | | [Documentation]
1095 | | ... | Setup L2 bridge domain topology with VXLANoIPv4 by connecting
1096 | | ... | physical and vxlan interfaces on each DUT. All interfaces are brought
1097 | | ... | up. IPv4 addresses with prefix /24 are configured on interfaces
1098 | | ... | between DUTs. VXLAN sub-interfaces has same IPv4 address as
1099 | | ... | interfaces.
1100 | | ...
1101 | | Set interfaces in path up
1102 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if2} | 172.16.0.1
1103 | | ... | 24
1104 | | VPP Interface Set IP Address | ${dut2} | ${dut2_if1} | 172.16.0.2
1105 | | ... | 24
1106 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
1107 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
1108 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if2} | 172.16.0.2 | ${dut2_if1_mac}
1109 | | VPP Add IP Neighbor | ${dut2} | ${dut2_if1} | 172.16.0.1 | ${dut1_if2_mac}
1110 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
1111 | | ... | 172.16.0.1 | 172.16.0.2
1112 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
1113 | | ... | 172.16.0.2 | 172.16.0.1
1114 | | Configure L2BD forwarding | ${dut1} | ${dut1_if1} | ${dut1s_vxlan}
1115 | | Configure L2BD forwarding | ${dut2} | ${dut2_if2} | ${dut2s_vxlan}
1116
1117 | Initialize L2 bridge domain with VLAN and VXLANoIPv4 in 3-node circular topology
1118 | | [Documentation]
1119 | | ... | Setup L2 bridge domain topology with VLAN and VXLANoIPv4 by connecting
1120 | | ... | pairs of VLAN sub-interface and VXLAN interface to separate L2 bridge
1121 | | ... | domain on each DUT. All interfaces are brought up. IPv4 addresses
1122 | | ... | with prefix /32 are configured on interfaces between DUTs. VXLAN
1123 | | ... | sub-interfaces has same IPv4 address as interfaces.
1124 | | ...
1125 | | ... | *Arguments:*
1126 | | ... | - vxlan_count - VXLAN count. Type: integer
1127 | | ...
1128 | | ... | *Example:*
1129 | | ...
1130 | | ... | \| Initialize L2 bridge domain with VLAN and VXLANoIPv4 in 3-node \
1131 | | ... | \| circular topology \| ${1} \|
1132 | | ...
1133 | | [Arguments] | ${vxlan_count}=${1}
1134 | | ...
1135 | | Set interfaces in path up
1136 | | ...
1137 | | ${bd_id_start}= | Set Variable | ${1}
1138 | | ${vni_start} = | Set Variable | ${20}
1139 | | ...
1140 | | ${ip_step} = | Set Variable | ${2}
1141 | | ${dut1_ip_start}= | Set Variable | 172.16.0.1
1142 | | ${dut2_ip_start}= | Set Variable | 172.16.0.2
1143 | | ...
1144 | | Vpp create multiple VXLAN IPv4 tunnels | node=${dut1}
1145 | | ... | node_vxlan_if=${dut1_if2} | node_vlan_if=${dut1_if1}
1146 | | ... | op_node=${dut2} | op_node_if=${dut2_if1} | n_tunnels=${vxlan_count}
1147 | | ... | vni_start=${vni_start} | src_ip_start=${dut1_ip_start}
1148 | | ... | dst_ip_start=${dut2_ip_start} | ip_step=${ip_step}
1149 | | ... | bd_id_start=${bd_id_start}
1150 | | Vpp create multiple VXLAN IPv4 tunnels | node=${dut2}
1151 | | ... | node_vxlan_if=${dut2_if1} | node_vlan_if=${dut2_if2}
1152 | | ... | op_node=${dut1} | op_node_if=${dut1_if2} | n_tunnels=${vxlan_count}
1153 | | ... | vni_start=${vni_start} | src_ip_start=${dut2_ip_start}
1154 | | ... | dst_ip_start=${dut1_ip_start} | ip_step=${ip_step}
1155 | | ... | bd_id_start=${bd_id_start}
1156
1157 | Initialize L2 bridge domains with Vhost-User and VXLANoIPv4 in 3-node circular topology
1158 | | [Documentation]
1159 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each
1160 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
1161 | | ... | with physical inteface.
1162 | | ... | Setup VXLANoIPv4 between DUTs by connecting physical and vxlan
1163 | | ... | interfaces on each DUT. All interfaces are brought up.
1164 | | ... | IPv4 addresses with prefix /24 are configured on interfaces between
1165 | | ... | DUTs. VXLAN sub-interfaces has same IPv4 address as interfaces.
1166 | | ...
1167 | | ... | *Arguments:*
1168 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1169 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1170 | | ...
1171 | | ... | *Example:*
1172 | | ...
1173 | | ... | \| L2 bridge domains with Vhost-User and VXLANoIPv4 initialized in a\
1174 | | ... | 3-node circular topology \| 1 \| 2 \|
1175 | | ...
1176 | | [Arguments] | ${bd_id1} | ${bd_id2}
1177 | | ...
1178 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if2} | 172.16.0.1
1179 | | ... | 24
1180 | | VPP Interface Set IP Address | ${dut2} | ${dut2_if1} | 172.16.0.2
1181 | | ... | 24
1182 | | Set interfaces in path up
1183 | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | 24
1184 | | ... | 172.16.0.1 | 172.16.0.2
1185 | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | 24
1186 | | ... | 172.16.0.2 | 172.16.0.1
1187 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1188 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
1189 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1190 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
1191 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
1192 | | Add interface to bridge domain | ${dut1} | ${dut1s_vxlan} | ${bd_id2}
1193 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1194 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
1195 | | Add interface to bridge domain | ${dut2} | ${dut2s_vxlan} | ${bd_id1}
1196 | | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
1197 | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
1198 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
1199
1200 | Init L2 bridge domains with single DUT with Vhost-User and VXLANoIPv4 in 3-node circular topology
1201 | | [Documentation]
1202 | | ... | Create two Vhost-User interfaces on one VPP node. Add each
1203 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
1204 | | ... | one connected to physical interface, the other to VXLAN.
1205 | | ... | Setup VXLANoIPv4 between DUTs and TG by connecting physical and vxlan
1206 | | ... | interfaces on the DUT. All interfaces are brought up.
1207 | | ... | IPv4 addresses with prefix /24 are configured on interfaces between
1208 | | ... | DUT and TG.
1209 | | ...
1210 | | ... | *Arguments:*
1211 | | ... | - dut1_address - Address of physical interface on DUT1. Type: string
1212 | | ... | - dut1_address_subnet - Subnet of the address of physical interface on
1213 | | ... |                         DUT1. Type: string
1214 | | ... | - dut2_address - Address of physical interface on DUT2. Type: string
1215 | | ... | - dut2_address_subnet - Subnet of the address of physical interface on
1216 | | ... |                         DUT2. Type: string
1217 | | ... | - dut1_gw - Address of the _gateway_ to which the traffic will be
1218 | | ... |             forwarded on DUT1. Type: string
1219 | | ... | - dut2_gw - Address of the _gateway_ to which the traffic will be
1220 | | ... |             forwarded on DUT2. Type: string
1221 | | ... | - dut1_vxlans - List of VXLAN params to be configured on DUT1.
1222 | | ... |                 Type: list of dicts, dict params vni, vtep
1223 | | ... | - dut2_vxlans - List of VXLAN params to be configured on DUT2.
1224 | | ... |                 Type: list of dicts, dict params vni, vtep
1225 | | ... | - dut1_route_subnet - Subnet address to forward to  _gateway_ on DUT1.
1226 | | ... |                       Type: string
1227 | | ... | - dut1_route_mask - Subnet address mask to forward to  _gateway_
1228 | | ... |                     on DUT1. Type: string
1229 | | ... | - dut2_route_subnet - Subnet address to forward to  _gateway_ on DUT2.
1230 | | ... |                       Type: string
1231 | | ... | - dut2_route_mask - Subnet address mask to forward to  _gateway_
1232 | | ... |                     on DUT2. Type: string
1233 | | ...
1234 | | ... | *Example:*
1235 | | ...
1236 | | [Arguments] | ${dut1_address} | ${dut1_address_subnet} |
1237 | | ... | ${dut2_address} | ${dut2_address_subnet} | ${dut1_gw} | ${dut2_gw} |
1238 | | ... | ${dut1_vxlans} | ${dut2_vxlans} | ${dut1_route_subnet} |
1239 | | ... | ${dut1_route_mask} | ${dut2_route_subnet} | ${dut2_route_mask}
1240 | | ...
1241 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1242 | | ... | /var/run/vpp/sock-1-${dut1_bd_id1}
1243 | | ... | /var/run/vpp/sock-1-${dut1_bd_id2}
1244 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if1} |
1245 | | ... | ${dut1_address} | ${dut1_address_subnet}
1246 | | VPP Interface Set IP Address | ${dut2} | ${dut2_if2} |
1247 | | ... | ${dut2_address} | ${dut2_address_subnet}
1248 | | ${dut1_bd_id1}= | Set Variable | 1
1249 | | ${dut1_bd_id2}= | Set Variable | 2
1250 | | ${dut2_bd_id1}= | Set Variable | 1
1251 | | :FOR | ${vxlan} | IN | @{dut1_vxlans}
1252 | | | ${dut1s_vxlan}= | Create VXLAN interface | ${dut1} | ${vxlan.vni}
1253 | | | ... | ${dut1_address} | ${vxlan.vtep}
1254 | | | Add interface to bridge domain | ${dut1} | ${dut1s_vxlan} | ${dut1_bd_id1}
1255 | | :FOR | ${vxlan} | IN | @{dut2_vxlans}
1256 | | | ${dut2s_vxlan}= | Create VXLAN interface | ${dut2} | ${vxlan.vni}
1257 | | | ... | ${dut2_address} | ${vxlan.vtep}
1258 | | | Add interface to bridge domain | ${dut2} | ${dut2s_vxlan} | ${dut2_bd_id1}
1259 | | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
1260 | | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
1261 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | ${dut1_gw} | ${tg_if1_mac}
1262 | | VPP Add IP Neighbor | ${dut2} | ${dut2_if2} | ${dut2_gw} | ${tg_if2_mac}
1263 | | Vpp Route Add | ${dut1} | ${dut1_route_subnet} | ${dut1_route_mask}
1264 | | ... | gateway=${dut1_gw} | interface=${dut1_if1}
1265 | | Vpp Route Add | ${dut2} | ${dut2_route_subnet} | ${dut2_route_mask}
1266 | | ... | gateway=${dut2_gw} | interface=${dut2_if2}
1267 | | Add interface to bridge domain | ${dut1} | ${dut1_if2} | ${dut1_bd_id2}
1268 | | Add interface to bridge domain | ${dut2} | ${dut2_if1} | ${dut2_bd_id1}
1269 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${dut1_bd_id1}
1270 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${dut1_bd_id2}
1271
1272 | Initialize L2 bridge domains with VLAN dot1q sub-interfaces in circular topology
1273 | | [Documentation]
1274 | | ... | Setup L2 bridge domain topology with learning enabled with VLAN by
1275 | | ... | connecting physical and vlan interfaces on each DUT. In case of 3-node
1276 | | ... | topology create VLAN sub-interfaces between DUTs. In case of 2-node
1277 | | ... | topology create VLAN sub-interface on dut1-if2 interface. All
1278 | | ... | interfaces are brought up.
1279 | | ...
1280 | | ... | *Arguments:*
1281 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1282 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1283 | | ... | - subid - ID of the sub-interface to be created. Type: string
1284 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1285 | | ...
1286 | | ... | _NOTE:_ This KW uses following test case variables:
1287 | | ... | - dut1 - DUT1 node.
1288 | | ... | - dut2 - DUT2 node.
1289 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
1290 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
1291 | | ...
1292 | | ... | *Example:*
1293 | | ...
1294 | | ... | \| Initialize L2 bridge domains with VLAN dot1q sub-interfaces
1295 | | ... | in a 3-node circular topology \| 1 \| 2 \| 10 \| pop-1 \|
1296 | | ...
1297 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
1298 | | ...
1299 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
1300 | | ... | Variable Should Exist | ${dut2}
1301 | | ...
1302 | | Set interfaces in path up
1303 | | ...
1304 | | Run Keyword If | '${dut2_status}' == 'PASS'
1305 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
1306 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
1307 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
1308 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
1309 | | Run Keyword If | '${dut2_status}' == 'PASS'
1310 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
1311 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
1312 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
1313 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
1314 | | ...
1315 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1316 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id1}
1317 | | Run Keyword If | '${dut2_status}' == 'PASS'
1318 | | ... | Add interface to bridge domain | ${dut2} | ${subif_index_2}
1319 | | ... | ${bd_id2}
1320 | | Run Keyword If | '${dut2_status}' == 'PASS'
1321 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if2}
1322 | | ... | ${bd_id2}
1323
1324 | Initialize L2 bridge domains with Vhost-User and VLAN in circular topology
1325 | | [Documentation]
1326 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Add each
1327 | | ... | Vhost-User interface into L2 bridge domains with learning enabled
1328 | | ... | with physical inteface. In case of 3-node topology create VLAN
1329 | | ... | sub-interfaces between DUTs. In case of 2-node topology create VLAN
1330 | | ... | sub-interface on dut1-if2 interface. All interfaces are brought up.
1331 | | ...
1332 | | ... | *Arguments:*
1333 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1334 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1335 | | ... | - subid - ID of the sub-interface to be created. Type: string
1336 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1337 | | ...
1338 | | ... | *Example:*
1339 | | ...
1340 | | ... | \| L2 bridge domains with Vhost-User and VLAN initialized in circular\
1341 | | ... | topology \| 1 \| 2 \| 10 \| pop-1 \|
1342 | | ...
1343 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
1344 | | ...
1345 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
1346 | | ... | Variable Should Exist | ${dut2}
1347 | | ...
1348 | | Set interfaces in path up
1349 | | ...
1350 | | Run Keyword If | '${dut2_status}' == 'PASS'
1351 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
1352 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
1353 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
1354 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
1355 | | Run Keyword If | '${dut2_status}' == 'PASS'
1356 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
1357 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
1358 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
1359 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
1360 | | ...
1361 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1362 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
1363 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1364 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
1365 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
1366 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
1367 | | Run Keyword If | '${dut2_status}' == 'PASS'
1368 | | ... | Configure vhost interfaces for L2BD forwarding | ${dut2}
1369 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
1370 | | Run Keyword If | '${dut2_status}' == 'PASS'
1371 | | ... | Add interface to bridge domain | ${dut2} | ${subif_index_2}
1372 | | ... | ${bd_id1}
1373 | | Run Keyword If | '${dut2_status}' == 'PASS'
1374 | | ... | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
1375 | | Run Keyword If | '${dut2_status}' == 'PASS'
1376 | | ... | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
1377 | | Run Keyword If | '${dut2_status}' == 'PASS'
1378 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
1379
1380 | Initialize L2 bridge domains with Vhost-User and VLAN with VPP link bonding in a 3-node circular topology
1381 | | [Documentation]
1382 | | ... | Create two Vhost-User interfaces on all defined VPP nodes. Create one
1383 | | ... | link bonding (BondEthernet) interface on both VPP nodes. Enslave one
1384 | | ... | physical interface towards next DUT by BondEthernet interface. Setup
1385 | | ... | VLAN on BondEthernet interfaces between DUTs. Add one Vhost-User
1386 | | ... | interface into L2 bridge domains with learning enabled with physical
1387 | | ... | interface towards TG and other Vhost-User interface into L2 bridge
1388 | | ... | domains with learning enabled with VLAN sub-interface. All interfaces
1389 | | ... | are brought up.
1390 | | ...
1391 | | ... | *Arguments:*
1392 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1393 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1394 | | ... | - subid - ID of the sub-interface to be created. Type: string
1395 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1396 | | ... | - bond_mode - Link bonding mode. Type: string
1397 | | ... | - lb_mode - Load balance mode. Type: string
1398 | | ...
1399 | | ... | *Example:*
1400 | | ...
1401 | | ... | \| Initialize L2 bridge domains with Vhost-User and VLAN with VPP\
1402 | | ... | link bonding in a 3-node circular topology \| 1 \| 2 \
1403 | | ... | \| 10 \| pop-1 \| xor \| l34 \|
1404 | | ...
1405 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
1406 | | ... | ${bond_mode} | ${lb_mode}
1407 | | ...
1408 | | Set interfaces in path up
1409 | | ${dut1_eth_bond_if1}= | VPP Create Bond Interface | ${dut1} | ${bond_mode}
1410 | | ... | ${lb_mode}
1411 | | Set Interface State | ${dut1} | ${dut1_eth_bond_if1} | up
1412 | | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1}
1413 | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
1414 | | ... | Variable Should Exist | ${dut1_if2}
1415 | | Run Keyword If | '${if2_status}' == 'PASS'
1416 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2}
1417 | | ... | ${dut1_eth_bond_if1}
1418 | | ... | ELSE
1419 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2_1}
1420 | | ... | ${dut1_eth_bond_if1}
1421 | | Run Keyword Unless | '${if2_status}' == 'PASS'
1422 | | ... | VPP Enslave Physical Interface | ${dut1} | ${dut1_if2_2}
1423 | | ... | ${dut1_eth_bond_if1}
1424 | | ${dut2_eth_bond_if1}= | VPP Create Bond Interface | ${dut2} | ${bond_mode}
1425 | | ... | ${lb_mode}
1426 | | Set Interface State | ${dut2} | ${dut2_eth_bond_if1} | up
1427 | | VPP Set interface MTU | ${dut2} | ${dut2_eth_bond_if1}
1428 | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
1429 | | ... | Variable Should Exist | ${dut2_if1}
1430 | | Run Keyword If | '${if1_status}' == 'PASS'
1431 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1}
1432 | | ... | ${dut2_eth_bond_if1}
1433 | | ... | ELSE
1434 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1_1}
1435 | | ... | ${dut2_eth_bond_if1}
1436 | | Run Keyword Unless | '${if2_status}' == 'PASS'
1437 | | ... | VPP Enslave Physical Interface | ${dut2} | ${dut2_if1_2}
1438 | | ... | ${dut2_eth_bond_if1}
1439 | | VPP Show Bond Data On All Nodes | ${nodes} | verbose=${TRUE}
1440 | | Initialize VLAN dot1q sub-interfaces in circular topology
1441 | | ... | ${dut1} | ${dut1_eth_bond_if1} | ${dut2} | ${dut2_eth_bond_if1}
1442 | | ... | ${subid}
1443 | | Configure L2 tag rewrite method on interfaces
1444 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
1445 | | ... | ${tag_rewrite}
1446 | | Configure vhost interfaces for L2BD forwarding | ${dut1}
1447 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
1448 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
1449 | | Add interface to bridge domain | ${dut1} | ${vhost_if1} | ${bd_id1}
1450 | | Add interface to bridge domain | ${dut1} | ${vhost_if2} | ${bd_id2}
1451 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
1452 | | Configure vhost interfaces for L2BD forwarding | ${dut2}
1453 | | ... | /var/run/vpp/sock-1-${bd_id1} | /var/run/vpp/sock-1-${bd_id2}
1454 | | Add interface to bridge domain | ${dut2} | ${subif_index_2} | ${bd_id1}
1455 | | Add interface to bridge domain | ${dut2} | ${vhost_if1} | ${bd_id1}
1456 | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2}
1457 | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
1458
1459 | Initialize LISP IPv4 forwarding in 3-node circular topology
1460 | | [Documentation] | Custom setup of IPv4 addresses on all DUT nodes and TG \
1461 | | ... | Don`t set route.
1462 | | ...
1463 | | ... | *Arguments:*
1464 | | ... | - dut1_dut2_address - Ip address from DUT1 to DUT2. Type: string
1465 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
1466 | | ... | - dut2_dut1_address - Ip address from DUT2 to DUT1. Type: string
1467 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
1468 | | ... | - duts_prefix - ip prefix. Type: int
1469 | | ...
1470 | | ... | *Return:*
1471 | | ... | - No value returned
1472 | | ...
1473 | | ... | *Example:*
1474 | | ... | \| Initialize LISP IPv4 forwarding in 3-node circular topology \
1475 | | ... | \| ${dut1_dut2_address} \| ${dut1_tg_address} \
1476 | | ... | \| ${dut2_dut1_address} \| ${dut2_tg_address} \| ${duts_prefix} \|
1477 | | ...
1478 | | [Arguments] | ${dut1_dut2_address} | ${dut1_tg_address}
1479 | | ... | ${dut2_dut1_address} | ${dut2_tg_address} | ${duts_prefix}
1480 | | ...
1481 | | Set interfaces in path up
1482 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
1483 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
1484 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
1485 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
1486 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac}
1487 | | VPP Add IP Neighbor
1488 | | ... | ${dut1} | ${dut1_if2} | ${dut2_dut1_address} | ${dut2_if1_mac}
1489 | | VPP Add IP Neighbor
1490 | | ... | ${dut2} | ${dut2_if1} | ${dut1_dut2_address} | ${dut1_if2_mac}
1491 | | VPP Add IP Neighbor | ${dut2} | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac}
1492 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if1}
1493 | | ... | ${dut1_tg_address} | ${duts_prefix}
1494 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if2}
1495 | | ... | ${dut1_dut2_address} | ${duts_prefix}
1496 | | VPP Interface Set IP Address | ${dut2} | ${dut2_if1}
1497 | | ... | ${dut2_dut1_address} | ${duts_prefix}
1498 | | VPP Interface Set IP Address | ${dut2} | ${dut2_if2}
1499 | | ... | ${dut2_tg_address} | ${duts_prefix}
1500
1501 | Initialize LISP GPE IPv4 over IPsec in 3-node circular topology
1502 | | [Documentation] | Setup Lisp GPE IPv4 forwarding over IPsec.
1503 | | ...
1504 | | ... | *Arguments:*
1505 | | ... | - encr_alg - Encryption algorithm. Type: string
1506 | | ... | - auth_alg - Authentication algorithm. Type: string
1507 | | ...
1508 | | ... | *Return:*
1509 | | ... | - No value returned
1510 | | ...
1511 | | ... | *Example:*
1512 | | ... | \| Initialize LISP GPE IPv4 over IPsec in 3-node circular topology\
1513 | | ... | \| ${encr_alg} \| ${auth_alg}
1514 | | ...
1515 | | [Arguments] | ${encr_alg} | ${auth_alg}
1516 | | ...
1517 | | Generate keys for IPSec | ${encr_alg} | ${auth_alg}
1518 | | Initialize LISP IPv4 forwarding in 3-node circular topology
1519 | | ... | ${dut1_to_dut2_ip4} | ${dut1_to_tg_ip4} | ${dut2_to_dut1_ip4}
1520 | | ... | ${dut2_to_tg_ip4} | ${prefix4}
1521 | | Configure LISP GPE topology in 3-node circular topology
1522 | | ... | ${dut1} | ${dut1_if2} | ${NONE}
1523 | | ... | ${dut2} | ${dut2_if1} | ${NONE}
1524 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
1525 | | ... | ${dut1_ip4_static_adjacency} | ${dut2_ip4_static_adjacency}
1526 | | Configure manual keyed connection for IPSec
1527 | | ... | ${dut1} | ${dut1_if2} | ${encr_alg} | ${encr_key}
1528 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
1529 | | ... | ${dut1_to_dut2_ip4} | ${dut2_to_dut1_ip4}
1530 | | Configure manual keyed connection for IPSec
1531 | | ... | ${dut2} | ${dut2_if1} | ${encr_alg} | ${encr_key}
1532 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
1533 | | ... | ${dut2_to_dut1_ip4} | ${dut1_to_dut2_ip4}
1534
1535 | Initialize LISP IPv6 forwarding in 3-node circular topology
1536 | | [Documentation] | Custom setup of IPv6 topology on all DUT nodes \
1537 | | ... | Don`t set route.
1538 | | ...
1539 | | ... | *Arguments:*
1540 | | ... | - dut1_dut2_address - Ip address from DUT1 to DUT2. Type: string
1541 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
1542 | | ... | - dut2_dut1_address - Ip address from DUT2 to DUT1. Type: string
1543 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
1544 | | ... | - duts_prefix - ip prefix. Type: int
1545 | | ...
1546 | | ... | *Return:*
1547 | | ... | - No value returned
1548 | | ...
1549 | | ... | *Example:*
1550 | | ... | \| Initialize LISP IPv6 forwarding in 3-node circular topology \
1551 | | ... | \| ${dut1_dut2_address} \| ${dut1_tg_address} \
1552 | | ... | \| ${dut2_dut1_address} \| ${dut2_tg_address} \| ${duts_prefix} \|
1553 | | ...
1554 | | [Arguments] | ${dut1_dut2_address} | ${dut1_tg_address}
1555 | | ... | ${dut2_dut1_address} | ${dut2_tg_address} | ${prefix}
1556 | | ...
1557 | | Set interfaces in path up
1558 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
1559 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
1560 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
1561 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
1562 | | VPP Interface Set IP Address
1563 | | ... | ${dut1} | ${dut1_if1} | ${dut1_tg_address} | ${prefix}
1564 | | VPP Interface Set IP Address
1565 | | ... | ${dut1} | ${dut1_if2} | ${dut1_dut2_address} | ${prefix}
1566 | | VPP Interface Set IP Address
1567 | | ... | ${dut2} | ${dut2_if1} | ${dut2_dut1_address} | ${prefix}
1568 | | VPP Interface Set IP Address
1569 | | ... | ${dut2} | ${dut2_if2} | ${dut2_tg_address} | ${prefix}
1570 | | Vpp All Ra Suppress Link Layer | ${nodes}
1571 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac}
1572 | | VPP Add IP Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac}
1573 | | VPP Add IP Neighbor
1574 | | ... | ${dut1} | ${dut1_if2} | ${dut2_dut1_address} | ${dut2_if1_mac}
1575 | | VPP Add IP Neighbor
1576 | | ... | ${dut2} | ${dut2_if1} | ${dut1_dut2_address} | ${dut1_if2_mac}
1577
1578 | Initialize LISP IPv4 over IPv6 forwarding in 3-node circular topology
1579 | | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \
1580 | | ... | Don`t set route.
1581 | | ...
1582 | | ... | *Arguments:*
1583 | | ... | - dut1_dut2_ip6_address - IPv6 address from DUT1 to DUT2.
1584 | | ... | Type: string
1585 | | ... | - dut1_tg_ip4_address - IPv4 address from DUT1 to tg. Type: string
1586 | | ... | - dut2_dut1_ip6_address - IPv6 address from DUT2 to DUT1.
1587 | | ... | Type: string
1588 | | ... | - dut1_tg_ip4_address - IPv4 address from DUT1 to tg. Type: string
1589 | | ... | - prefix4 - IPv4 prefix. Type: int
1590 | | ... | - prefix6 - IPv6 prefix. Type: int
1591 | | ...
1592 | | ... | *Return:*
1593 | | ... | - No value returned
1594 | | ...
1595 | | ... | *Example:*
1596 | | ... | \| Lisp IPv4 over IPv6 forwarding initialized in a 3-node circular \
1597 | | ... | topology \| ${dut1_dut2_ip6_address} \| ${dut1_tg_ip4_address} \
1598 | | ... | \| ${dut2_dut1_ip6_address} \| ${dut2_tg_ip4_address} \
1599 | | ... | \| ${prefix4} \| ${prefix6} \|
1600 | | ...
1601 | | [Arguments] | ${dut1_dut2_ip6_address} | ${dut1_tg_ip4_address}
1602 | | ... | ${dut2_dut1_ip6_address} | ${dut2_tg_ip4_address}
1603 | | ... | ${prefix4} | ${prefix6}
1604 | | ...
1605 | | Set interfaces in path up
1606 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
1607 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
1608 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
1609 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
1610 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if1}
1611 | | ... | ${dut1_tg_ip4_address} | ${prefix4}
1612 | | VPP Interface Set IP Address
1613 | | ... | ${dut1} | ${dut1_if2} | ${dut1_dut2_ip6_address} | ${prefix6}
1614 | | VPP Interface Set IP Address
1615 | | ... | ${dut2} | ${dut2_if1} | ${dut2_dut1_ip6_address} | ${prefix6}
1616 | | VPP Interface Set IP Address | ${dut2} | ${dut2_if2}
1617 | | ... | ${dut2_tg_ip4_address} | ${prefix4}
1618 | | Vpp All Ra Suppress Link Layer | ${nodes}
1619 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac}
1620 | | VPP Add IP Neighbor | ${dut2} | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac}
1621 | | VPP Add IP Neighbor
1622 | | ... | ${dut1} | ${dut1_if2} | ${dut2_dut1_ip6_address} | ${dut2_if1_mac}
1623 | | VPP Add IP Neighbor
1624 | | ... | ${dut2} | ${dut2_if1} | ${dut1_dut2_ip6_address} | ${dut1_if2_mac}
1625
1626 | Initialize LISP IPv6 over IPv4 forwarding in 3-node circular topology
1627 | | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \
1628 | | ... | Don`t set route.
1629 | | ...
1630 | | ... | *Arguments:*
1631 | | ... | - dut1_dut2_ip4_address - IPv4 address from DUT1 to DUT2.
1632 | | ... | Type: string
1633 | | ... | - dut1_tg_ip6_address - IPv6 address from DUT1 to tg. Type: string
1634 | | ... | - dut2_dut1_ip4_address - IPv4 address from DUT2 to DUT1.
1635 | | ... | Type: string
1636 | | ... | - dut1_tg_ip6_address - IPv6 address from DUT1 to tg. Type: string
1637 | | ... | - prefix4 - IPv4 prefix. Type: int
1638 | | ... | - prefix6 - IPv6 prefix. Type: int
1639 | | ...
1640 | | ... | *Return:*
1641 | | ... | - No value returned
1642 | | ...
1643 | | ... | *Example:*
1644 | | ... | \| Lisp IPv6 over IPv4 forwarding initialized in a 3-node circular \
1645 | | ... | topology \| ${dut1_dut2_ip4_address} \| ${dut1_tg_ip6_address} \
1646 | | ... | \| ${dut2_dut1_ip4_address} \| ${dut2_tg_ip6_address} \
1647 | | ... | \| ${prefix6} \| ${prefix4} \|
1648 | | ...
1649 | | [Arguments] | ${dut1_dut2_ip4_address} | ${dut1_tg_ip6_address}
1650 | | ... | ${dut2_dut1_ip4_address} | ${dut2_tg_ip6_address}
1651 | | ... | ${prefix6} | ${prefix4}
1652 | | ...
1653 | | Set interfaces in path up
1654 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
1655 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
1656 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
1657 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut2_if1}
1658 | | VPP Interface Set IP Address
1659 | | ... | ${dut1} | ${dut1_if1} | ${dut1_tg_ip6_address} | ${prefix6}
1660 | | VPP Interface Set IP Address
1661 | | ... | ${dut1} | ${dut1_if2} | ${dut1_dut2_ip4_address} | ${prefix4}
1662 | | VPP Interface Set IP Address
1663 | | ... | ${dut2} | ${dut2_if1} | ${dut2_dut1_ip4_address} | ${prefix4}
1664 | | VPP Interface Set IP Address
1665 | | ... | ${dut2} | ${dut2_if2} | ${dut2_tg_ip6_address} | ${prefix6}
1666 | | Vpp All Ra Suppress Link Layer | ${nodes}
1667 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg1_if1_mac}
1668 | | VPP Add IP Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg1_if2_mac}
1669 | | VPP Add IP Neighbor
1670 | | ... | ${dut1} | ${dut1_if2} | ${dut2_dut1_ip4_address} | ${dut2_if1_mac}
1671 | | VPP Add IP Neighbor
1672 | | ... | ${dut2} | ${dut2_if1} | ${dut1_dut2_ip4_address} | ${dut1_if2_mac}
1673
1674 | Initialize NAT44 in circular topology
1675 | | [Documentation] | Initialization of 2-node / 3-node topology with NAT44
1676 | | ... | between DUTs:
1677 | | ... | - set interfaces up
1678 | | ... | - set IP addresses
1679 | | ... | - set ARP
1680 | | ... | - create routes
1681 | | ... | - set NAT44 - only on DUT1
1682 | | ...
1683 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
1684 | | ... | Variable Should Exist | ${dut2}
1685 | | ...
1686 | | Set interfaces in path up
1687 | | ...
1688 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if1} | 10.0.0.1 | 20
1689 | | Run Keyword If | '${dut2_status}' == 'PASS'
1690 | | ... | VPP Interface Set IP Address | ${dut1} | ${dut1_if2}
1691 | | ... | 11.0.0.1 | 20
1692 | | Run Keyword If | '${dut2_status}' == 'PASS'
1693 | | ... | VPP Interface Set IP Address | ${dut2} | ${dut2_if1}
1694 | | ... | 11.0.0.2 | 20
1695 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
1696 | | ... | Set Variable | ${dut2}
1697 | | ... | ELSE | Set Variable | ${dut1}
1698 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
1699 | | ... | Set Variable | ${dut2_if2}
1700 | | ... | ELSE | Set Variable | ${dut1_if2}
1701 | | VPP Interface Set IP Address | ${dut} | ${dut_if2} | 12.0.0.1 | 20
1702 | | ...
1703 | | ${tg_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
1704 | | ${tg_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
1705 | | ${dut1_if2_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
1706 | | ... | Get Interface MAC | ${dut1} | ${dut1_if2}
1707 | | ${dut2_if1_mac}= | Run Keyword If | '${dut2_status}' == 'PASS'
1708 | | ... | Get Interface MAC | ${dut2} | ${dut2_if1}
1709 | | ...
1710 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | 10.0.0.2 | ${tg_if1_mac}
1711 | | Run Keyword If | '${dut2_status}' == 'PASS'
1712 | | ... | VPP Add IP Neighbor
1713 | | ... | ${dut1} | ${dut1_if2} | 11.0.0.2 | ${dut2_if1_mac}
1714 | | Run Keyword If | '${dut2_status}' == 'PASS'
1715 | | ... | VPP Add IP Neighbor
1716 | | ... | ${dut2} | ${dut2_if1} | 11.0.0.1 | ${dut1_if2_mac}
1717 | | VPP Add IP Neighbor | ${dut} | ${dut_if2} | 12.0.0.2 | ${tg_if2_mac}
1718 | | ...
1719 | | Vpp Route Add | ${dut1} | 20.0.0.0 | 18 | gateway=10.0.0.2
1720 | | ... | interface=${dut1_if1}
1721 | | Run Keyword If | '${dut2_status}' == 'PASS'
1722 | | ... | Vpp Route Add | ${dut1} | 12.0.0.2 | 32 | gateway=11.0.0.2
1723 | | ... | interface=${dut1_if2}
1724 | | Run Keyword If | '${dut2_status}' == 'PASS'
1725 | | ... | Vpp Route Add | ${dut2} | 12.0.0.0 | 24 | gateway=12.0.0.2
1726 | | ... | interface=${dut2_if2}
1727 | | Run Keyword If | '${dut2_status}' == 'PASS'
1728 | | ... | Vpp Route Add | ${dut2} | 200.0.0.0 | 30 | gateway=11.0.0.1
1729 | | ... | interface=${dut2_if1}
1730 | | ...
1731 | | Configure inside and outside interfaces
1732 | | ... | ${dut1} | ${dut1_if1} | ${dut1_if2}
1733 | | Configure deterministic mode for NAT44
1734 | | ... | ${dut1} | 20.0.0.0 | 18 | 200.0.0.0 | 30
1735
1736 | Initialize L2 xconnect with memif pairs on DUT node
1737 | | [Documentation]
1738 | | ... | Create pairs of Memif interfaces on DUT node. Cross connect each Memif
1739 | | ... | interface with one physical interface or virtual interface to create
1740 | | ... | a chain accross DUT node.
1741 | | ...
1742 | | ... | *Arguments:*
1743 | | ... | - dut - DUT node. Type: dictionary
1744 | | ... | - count - Number of memif pairs (containers). Type: integer
1745 | | ...
1746 | | ... | *Note:*
1747 | | ... | Socket paths for Memif are defined in following format:
1748 | | ... | - /tmp/memif-\${dut}_CNF\${number}-\${sid}
1749 | | ...
1750 | | ... | KW uses test variable \${rxq_count_int} set by KW Add worker threads
1751 | | ... | and rxqueues to all DUTs
1752 | | ...
1753 | | ... | *Example:*
1754 | | ...
1755 | | ... | \| Initialize L2 xconnect with memif pairs on DUT node \| ${dut} \
1756 | | ... | \| ${1} \|
1757 | | ...
1758 | | [Arguments] | ${dut} | ${count}
1759 | | ...
1760 | | :FOR | ${number} | IN RANGE | 1 | ${count}+1
1761 | | | ${sock1}= | Set Variable | memif-${dut}_CNF
1762 | | | ${sock2}= | Set Variable | memif-${dut}_CNF
1763 | | | ${prev_index}= | Evaluate | ${number}-1
1764 | | | Set up memif interfaces on DUT node | ${nodes['${dut}']}
1765 | | | ... | ${sock1} | ${sock2} | ${number} | ${dut}-memif-${number}-if1
1766 | | | ... | ${dut}-memif-${number}-if2 | ${rxq_count_int} | ${rxq_count_int}
1767 | | | ${xconnect_if1}= | Set Variable If | ${number}==1 | ${${dut}_if1}
1768 | | | ... | ${${dut}-memif-${prev_index}-if2}
1769 | | | Configure L2XC | ${nodes['${dut}']} | ${xconnect_if1}
1770 | | | ... | ${${dut}-memif-${number}-if1}
1771 | | | Run Keyword If | ${number}==${count} | Configure L2XC
1772 | | | ... | ${nodes['${dut}']} | ${${dut}-memif-${number}-if2} | ${${dut}_if2}
1773
1774 | Initialize L2 xconnect with memif pairs
1775 | | [Documentation]
1776 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Cross
1777 | | ... | connect each Memif interface with one physical interface or virtual
1778 | | ... | interface to create a chain accross DUT node.
1779 | | ...
1780 | | ... | *Arguments:*
1781 | | ... | - count - Number of memif pairs (containers). Type: integer
1782 | | ...
1783 | | ... | *Example:*
1784 | | ...
1785 | | ... | \| Initialize L2 xconnect with memif pairs \| ${1} \|
1786 | | ...
1787 | | [Arguments] | ${count}=${1}
1788 | | ...
1789 | | ${duts}= | Get Matches | ${nodes} | DUT*
1790 | | :FOR | ${dut} | IN | @{duts}
1791 | | | Initialize L2 xconnect with memif pairs on DUT node | ${dut} | ${count}
1792 | | Set interfaces in path up
1793 | | Show Memif on all DUTs | ${nodes}
1794 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
1795
1796 | Initialize L2 Bridge Domain with memif pairs on DUT node
1797 | | [Documentation]
1798 | | ... | Create pairs of Memif interfaces on DUT node. Put each Memif interface
1799 | | ... | to separate L2 bridge domain with one physical or memif interface
1800 | | ... | to create a chain accross DUT node.
1801 | | ...
1802 | | ... | *Arguments:*
1803 | | ... | - dut - DUT node. Type: dictionary
1804 | | ... | - nf_chain - NF chain. Type: integer
1805 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
1806 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
1807 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
1808 | | ...
1809 | | ... | *Note:*
1810 | | ... | Socket paths for Memif are defined in following format:
1811 | | ... | - /tmp/memif-\${dut}_CNF\${nf_id}-\${sid}
1812 | | ...
1813 | | ... | *Example:*
1814 | | ...
1815 | | ... | \| Initialize L2 Bridge Domain with memif pairs on DUT node \
1816 | | ... | \| ${dut} \| 1 \| 1 \|
1817 | | ...
1818 | | [Arguments] | ${dut} | ${nf_chain}=${1} | ${nf_nodes}=${1}
1819 | | ... | ${auto_scale}=${True}
1820 | | ...
1821 | | ${rxq}= | Run Keyword If | ${auto_scale} == ${True}
1822 | | ... | Set Variable | ${rxq_count_int}
1823 | | ... | ELSE | Set Variable | ${1}
1824 | | ${bd_id2}= | Evaluate | ${nf_nodes}+1
1825 | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if1} | ${1}
1826 | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if2}
1827 | | ... | ${bd_id2}
1828 | | :FOR | ${nf_node} | IN RANGE | 1 | ${nf_nodes}+1
1829 | | | ${nf_id}= | Evaluate | (${nf_chain} - ${1}) * ${nf_nodes} + ${nf_node}
1830 | | | ${sock1}= | Set Variable | memif-${dut}_CNF
1831 | | | ${sock2}= | Set Variable | memif-${dut}_CNF
1832 | | | Set up memif interfaces on DUT node | ${nodes['${dut}']}
1833 | | | ... | ${sock1} | ${sock2} | ${nf_id} | ${dut}-memif-${nf_id}-if1
1834 | | | ... | ${dut}-memif-${nf_id}-if2 | ${rxq} | ${rxq}
1835 | | | ${bd_id2}= | Evaluate | ${nf_node}+1
1836 | | | Add interface to bridge domain | ${nodes['${dut}']}
1837 | | | ... | ${${dut}-memif-${nf_id}-if1} | ${nf_node}
1838 | | | Add interface to bridge domain | ${nodes['${dut}']}
1839 | | | ... | ${${dut}-memif-${nf_id}-if2} | ${bd_id2}
1840
1841 | Initialize L2 Bridge Domain with memif pairs
1842 | | [Documentation]
1843 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
1844 | | ... | Memif interface to separate L2 bridge domain with one physical or
1845 | | ... | virtual interface to create a chain accross DUT node.
1846 | | ...
1847 | | ... | *Arguments:*
1848 | | ... | - nf_chain - NF chain. Type: integer
1849 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
1850 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
1851 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
1852 | | ...
1853 | | ... | *Example:*
1854 | | ...
1855 | | ... | \| Initialize L2 Bridge Domain with memif pairs \| 1 \| 1 \|
1856 | | ...
1857 | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
1858 | | ...
1859 | | ${duts}= | Get Matches | ${nodes} | DUT*
1860 | | :FOR | ${dut} | IN | @{duts}
1861 | | | Initialize L2 Bridge Domain with memif pairs on DUT node | ${dut}
1862 | | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
1863 | | | ... | auto_scale=${auto_scale}
1864
1865 | Initialize L2 Bridge Domain for multiple chains with memif pairs
1866 | | [Documentation]
1867 | | ... | Create pairs of Memif interfaces for defined number of NF chains
1868 | | ... | with defined number of NF nodes on all defined VPP nodes. Add each
1869 | | ... | Memif interface into L2 bridge domains with learning enabled
1870 | | ... | with physical inteface or Memif interface of another NF.
1871 | | ...
1872 | | ... | *Arguments:*
1873 | | ... | - nf_chains - Number of chains of NFs. Type: integer
1874 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
1875 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
1876 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
1877 | | ...
1878 | | ... | *Example:*
1879 | | ...
1880 | | ... | \| Initialize L2 Bridge Domain for multiple chains with memif pairs \
1881 | | ... | \| 1 \| 1 \|
1882 | | ...
1883 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
1884 | | ...
1885 | | :FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains}+1
1886 | | | Initialize L2 Bridge Domain with memif pairs | nf_chain=${nf_chain}
1887 | | | ... | nf_nodes=${nf_nodes} | auto_scale=${auto_scale}
1888 | | Set interfaces in path up
1889 | | Show Memif on all DUTs | ${nodes}
1890 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
1891
1892 | Initialize L2 Bridge Domain for pipeline with memif pairs
1893 | | [Documentation]
1894 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
1895 | | ... | Memif interface to separate L2 bridge domain with one physical or
1896 | | ... | virtual interface to create a service pipeline on DUT node.
1897 | | ...
1898 | | ... | *Arguments:*
1899 | | ... | - nf_chain - NF pipe. Type: integer
1900 | | ... | - nf_nodes - Number of NFs nodes per pipeline. Type: integer
1901 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
1902 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
1903 | | ...
1904 | | ... | *Example:*
1905 | | ...
1906 | | ... | \| Initialize L2 Bridge Domain for pipeline with memif pairs \
1907 | | ... | \| 1 \| 1 \|
1908 | | ...
1909 | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
1910 | | ...
1911 | | ${rxq}= | Run Keyword If | ${auto_scale} == ${True}
1912 | | ... | Set Variable | ${rxq_count_int}
1913 | | ... | ELSE | Set Variable | ${1}
1914 | | ${duts}= | Get Matches | ${nodes} | DUT*
1915 | | :FOR | ${dut} | IN | @{duts}
1916 | | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if1} | ${1}
1917 | | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if2} | ${2}
1918 | | | ${nf_id_frst}= | Evaluate | (${nf_chain}-${1}) * ${nf_nodes} + ${1}
1919 | | | ${nf_id_last}= | Evaluate | (${nf_chain}-${1}) * ${nf_nodes} + ${nf_nodes}
1920 | | | ${sid_frst}= | Evaluate | ${nf_id_frst} * ${2} - ${1}
1921 | | | ${sid_last}= | Evaluate | ${nf_id_last} * ${2}
1922 | | | Set up single memif interface on DUT node | ${nodes['${dut}']}
1923 | | | ... | memif-${dut}_CNF | mid=${nf_id_frst} | sid=${sid_frst}
1924 | | | ... | memif_if=${dut}-memif-${nf_id_frst}-if1
1925 | | | ... | rxq=${rxq} | txq=${rxq}
1926 | | | Set up single memif interface on DUT node | ${nodes['${dut}']}
1927 | | | ... | memif-${dut}_CNF | mid=${nf_id_last} | sid=${sid_last}
1928 | | | ... | memif_if=${dut}-memif-${nf_id_last}-if2
1929 | | | ... | rxq=${rxq} | txq=${rxq}
1930 | | | Add interface to bridge domain | ${nodes['${dut}']}
1931 | | | ... | ${${dut}-memif-${nf_id_frst}-if1} | ${1}
1932 | | | Add interface to bridge domain | ${nodes['${dut}']}
1933 | | | ... | ${${dut}-memif-${nf_id_last}-if2} | ${2}
1934
1935 | Initialize L2 Bridge Domain for multiple pipelines with memif pairs
1936 | | [Documentation]
1937 | | ... | Create pairs of Memif interfaces for defined number of NF pipelines
1938 | | ... | with defined number of NF nodes on all defined VPP nodes. Add each
1939 | | ... | Memif interface into L2 bridge domains with learning enabled
1940 | | ... | with physical inteface or Memif interface of another NF.
1941 | | ...
1942 | | ... | *Arguments:*
1943 | | ... | - nf_chains - Number of pipelines of NFs. Type: integer
1944 | | ... | - nf_nodes - Number of NFs nodes per pipeline. Type: integer
1945 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
1946 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
1947 | | ...
1948 | | ... | *Example:*
1949 | | ...
1950 | | ... | \| Initialize L2 Bridge Domain for multiple pipelines with memif \
1951 | | ... | pairs \| 1 \| 1 \|
1952 | | ...
1953 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
1954 | | ...
1955 | | :FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains}+1
1956 | | | Initialize L2 Bridge Domain for pipeline with memif pairs
1957 | | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes}
1958 | | | ... | auto_scale=${auto_scale}
1959 | | Set interfaces in path up
1960 | | Show Memif on all DUTs | ${nodes}
1961 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
1962
1963 | Initialize L2 Bridge Domain with memif pairs and VLAN in circular topology
1964 | | [Documentation]
1965 | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each
1966 | | ... | Memif interface to separate L2 bridge domain with one physical or
1967 | | ... | virtual interface to create a chain accross DUT node. In case of
1968 | | ... | 3-node topology create VLAN sub-interfaces between DUTs. In case of
1969 | | ... | 2-node topology create VLAN sub-interface on dut1-if2 interface. All
1970 | | ... | interfaces are brought up.
1971 | | ...
1972 | | ... | *Arguments:*
1973 | | ... | - bd_id1 - Bridge domain ID. Type: integer
1974 | | ... | - bd_id2 - Bridge domain ID. Type: integer
1975 | | ... | - subid - ID of the sub-interface to be created. Type: string
1976 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
1977 | | ...
1978 | | ... | *Example:*
1979 | | ...
1980 | | ... | \| Initialize L2 Bridge Domain with memif pairs and VLAN in circular\
1981 | | ... | topology \| 1 \| 2 \| 10 \| pop-1 \|
1982 | | ...
1983 | | [Arguments] | ${bd_id1} | ${bd_id2} | ${subid} | ${tag_rewrite}
1984 | | ...
1985 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
1986 | | ... | Variable Should Exist | ${dut2}
1987 | | ...
1988 | | Set interfaces in path up
1989 | | ...
1990 | | Run Keyword If | '${dut2_status}' == 'PASS'
1991 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
1992 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
1993 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
1994 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
1995 | | Run Keyword If | '${dut2_status}' == 'PASS'
1996 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
1997 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
1998 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
1999 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
2000 | | ...
2001 | | ${number}= | Set Variable | ${1}
2002 | | ${sock1}= | Set Variable | memif-DUT1_CNF
2003 | | ${sock2}= | Set Variable | memif-DUT1_CNF
2004 | | ${memif_if1_name}= | Set Variable | DUT1-memif-${number}-if1
2005 | | ${memif_if2_name}= | Set Variable | DUT1-memif-${number}-if2
2006 | | Set up memif interfaces on DUT node | ${dut1} | ${sock1} | ${sock2}
2007 | | ... | ${number} | ${memif_if1_name} | ${memif_if2_name} | ${rxq_count_int}
2008 | | ... | ${rxq_count_int}
2009 | | Add interface to bridge domain | ${dut1} | ${dut1_if1} | ${bd_id1}
2010 | | Add interface to bridge domain | ${dut1} | ${${memif_if1_name}} | ${bd_id1}
2011 | | Add interface to bridge domain | ${dut1} | ${${memif_if2_name}} | ${bd_id2}
2012 | | Add interface to bridge domain | ${dut1} | ${subif_index_1} | ${bd_id2}
2013 | | ${sock1}= | Run Keyword If | '${dut2_status}' == 'PASS'
2014 | | ... | Set Variable | memif-DUT2_CNF
2015 | | ${sock2}= | Run Keyword If | '${dut2_status}' == 'PASS'
2016 | | ... | Set Variable | memif-DUT2_CNF
2017 | | ${memif_if1_name}= | Run Keyword If | '${dut2_status}' == 'PASS'
2018 | | ... | Set Variable | DUT2-memif-${number}-if1
2019 | | ${memif_if2_name}= | Run Keyword If | '${dut2_status}' == 'PASS'
2020 | | ... | Set Variable | DUT2-memif-${number}-if2
2021 | | Run Keyword If | '${dut2_status}' == 'PASS'
2022 | | ... | Set up memif interfaces on DUT node | ${dut2} | ${sock1} | ${sock2}
2023 | | ... | ${number} | ${memif_if1_name} | ${memif_if2_name} | ${rxq_count_int}
2024 | | ... | ${rxq_count_int}
2025 | | Run Keyword If | '${dut2_status}' == 'PASS'
2026 | | ... | Add interface to bridge domain | ${dut2} | ${subif_index_2}
2027 | | ... | ${bd_id1}
2028 | | Run Keyword If | '${dut2_status}' == 'PASS'
2029 | | ... | Add interface to bridge domain | ${dut2} | ${${memif_if1_name}}
2030 | | ... | ${bd_id1}
2031 | | Run Keyword If | '${dut2_status}' == 'PASS'
2032 | | ... | Add interface to bridge domain | ${dut2} | ${${memif_if2_name}}
2033 | | ... | ${bd_id2}
2034 | | Run Keyword If | '${dut2_status}' == 'PASS'
2035 | | ... | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2}
2036 | | ...
2037 | | Show Memif on all DUTs | ${nodes}
2038 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
2039
2040 | Initialize L2 xconnect for single memif
2041 | | [Documentation]
2042 | | ... | Create single Memif interface on all defined VPP nodes. Cross
2043 | | ... | connect Memif interface with one physical interface.
2044 | | ...
2045 | | ... | *Arguments:*
2046 | | ... | - number - Memif ID. Type: integer
2047 | | ...
2048 | | ... | *Note:*
2049 | | ... | Socket paths for Memif are defined in following format:
2050 | | ... | - /tmp/memif-DUT1_CNF\${number}-\${sid}
2051 | | ...
2052 | | ... | KW uses test variable ${rxq_count_int} set by KW Add worker threads
2053 | | ... | and rxqueues to all DUTs
2054 | | ...
2055 | | ... | *Example:*
2056 | | ...
2057 | | ... | \| Initialize L2 xconnect for single memif \| 1 \|
2058 | | ...
2059 | | [Arguments] | ${number}=${1}
2060 | | ...
2061 | | ${duts}= | Get Matches | ${nodes} | DUT*
2062 | | :FOR | ${dut} | IN | @{duts}
2063 | | | ${sock}= | Set Variable | memif-${dut}_CNF
2064 | | | ${sid}= | Evaluate | (${number} * ${2}) - ${1}
2065 | | | Set up single memif interface on DUT node | ${nodes['${dut}']} | ${sock}
2066 | | | ... | mid=${number} | sid=${sid} | memif_if=${dut}-memif-${number}-if1
2067 | | | ... | rxq=${rxq_count_int} | txq=${rxq_count_int}
2068 | | | Configure L2XC | ${nodes['${dut}']} | ${${dut}_if1}
2069 | | | ... | ${${dut}-memif-${number}-if1}
2070 | | Set single interfaces in path up
2071 | | Show Memif on all DUTs | ${nodes}
2072 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=memif
2073
2074 | Initialize L2 Bridge Domain for single memif
2075 | | [Documentation]
2076 | | ... | Create single Memif interface on all defined VPP nodes. Put Memif
2077 | | ... | interface to separate L2 bridge domain with one physical interface.
2078 | | ...
2079 | | ... | *Arguments:*
2080 | | ... | - number - Memif ID. Type: integer
2081 | | ...
2082 | | ... | *Note:*
2083 | | ... | Socket paths for Memif are defined in following format:
2084 | | ... | - /tmp/memif-DUT1_CNF\${number}-\${sid}
2085 | | ...
2086 | | ... | KW uses test variable ${rxq_count_int} set by KW Add worker threads
2087 | | ... | and rxqueues to all DUTs
2088 | | ...
2089 | | ... | *Example:*
2090 | | ...
2091 | | ... | \| Initialize L2 Bridge Domain for single memif \| 1 \|
2092 | | ...
2093 | | [Arguments] | ${number}=${1}
2094 | | ...
2095 | | ${duts}= | Get Matches | ${nodes} | DUT*
2096 | | :FOR | ${dut} | IN | @{duts}
2097 | | | ${sock}= | Set Variable | memif-${dut}_CNF
2098 | | | ${sid}= | Evaluate | (${number} * ${2}) - ${1}
2099 | | | Set up single memif interface on DUT node | ${nodes['${dut}']} | ${sock}
2100 | | | ... | mid=${number} | sid=${sid} | memif_if=${dut}-memif-${number}-if1
2101 | | | ... | rxq=${rxq_count_int} | txq=${rxq_count_int}
2102 | | | Add interface to bridge domain | ${nodes['${dut}']} | ${${dut}_if1}
2103 | | | ... | ${number}
2104 | | | Add interface to bridge domain | ${nodes['${dut}']}
2105 | | | ... | ${${dut}-memif-${number}-if1} | ${number}
2106 | | Set single interfaces in path up
2107 | | Show Memif on all DUTs | ${nodes}
2108
2109 | Configure ACLs on a single interface
2110 | | [Documentation]
2111 | | ... | Configure ACL
2112 | | ...
2113 | | ... | *Arguments:*
2114 | | ... | - dut - DUT node. Type: string
2115 | | ... | - dut_if - DUT node interface name. Type: string
2116 | | ... | - acl_apply_type - To what path apply the ACL - input or output.
2117 | | ... | - acl_action - Action for the rule - deny, permit, permit+reflect.
2118 | | ... | - subnets - Subnets to apply the specific ACL. Type: list
2119 | | ...
2120 | | ... | *Example:*
2121 | | ...
2122 | | ... | \| Configure ACLs on a single interface \| ${nodes['DUT1']}
2123 | | ... | \| ... \| GigabitEthernet0/7/0 \| input \| permit | 0.0.0.0/0
2124 | | ...
2125 | | [Arguments] | ${dut} | ${dut_if} | ${acl_apply_type} | ${acl_action}
2126 | | ... | @{subnets}
2127 | | Set Test variable | ${acl} | ${EMPTY}
2128 | | :FOR | ${subnet} | IN | @{subnets}
2129 | | | ${acl} = | Run Keyword If | '${acl}' == '${EMPTY}'
2130 | | | ... | Set Variable | ipv4 ${acl_action} src ${subnet}
2131 | | | ... | ELSE
2132 | | | ... | Catenate | SEPARATOR=", " | ${acl}
2133 | | | ... | ipv4 ${acl_action} src ${subnet}
2134 | | Add Replace Acl Multi Entries | ${dut} | rules=${acl}
2135 | | @{acl_list} = | Create List | ${0}
2136 | | Set Acl List For Interface | ${dut} | ${dut_if} | ${acl_apply_type}
2137 | | ... | ${acl_list}