Clean: L2 bridge domain
[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 | resources.libraries.python.DpdkUtil
16 | Library | resources.libraries.python.InterfaceUtil
17 | Library | resources.libraries.python.IPUtil
18 | Library | resources.libraries.python.NodePath
19 | Library | resources.libraries.python.TestConfig
20 | Library | resources.libraries.python.TrafficGenerator
21 | Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl
22 | Library | resources.libraries.python.VhostUser
23 | ...
24 | Documentation | Performance suite keywords - configuration
25
26 *** Keywords ***
27 | Initialize IPSec in 3-node circular topology
28 | | [Documentation]
29 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
30 | | ... | topology. Get the interface MAC addresses and setup ARP on all VPP
31 | | ... | interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG and
32 | | ... | DUT1-DUT2 links. Set routing for encrypted traffic on both DUT nodes
33 | | ... | with prefix /8 and next hop of neighbour DUT or TG interface IPv4
34 | | ... | address.
35 | | ...
36 | | Set interfaces in path up
37 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if1}
38 | | ... | ${dut1_if1_ip4} | 24
39 | | VPP Interface Set IP Address | ${dut2} | ${dut2_if2}
40 | | ... | ${dut2_if2_ip4} | 24
41 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | ${tg_if1_ip4} | ${tg_if1_mac}
42 | | VPP Add IP Neighbor | ${dut2} | ${dut2_if2} | ${tg_if2_ip4} | ${tg_if2_mac}
43 | | Vpp Route Add | ${dut1} | ${laddr_ip4} | 8 | gateway=${tg_if1_ip4}
44 | | ... | interface=${dut1_if1}
45 | | Vpp Route Add | ${dut2} | ${raddr_ip4} | 8 | gateway=${tg_if2_ip4}
46 | | ... | interface=${dut2_if2}
47
48 | Initialize IPv6 forwarding with VLAN dot1q sub-interfaces in circular topology
49 | | [Documentation]
50 | | ... | Set UP state on VPP interfaces in path on nodes in 2-node / 3-node
51 | | ... | circular topology. In case of 3-node topology create VLAN
52 | | ... | sub-interfaces between DUTs. In case of 2-node topology create VLAN
53 | | ... | sub-interface on dut1-if2 interface. Get the interface MAC addresses
54 | | ... | and setup ARPs. Setup IPv6 addresses with /64 prefix on DUT-TG links
55 | | ... | and set routing with prefix /64. In case of 3-node set IPv6 adresses
56 | | ... | with /64 prefix on VLAN and set routing on both DUT nodes with prefix
57 | | ... | /64. Set next hop of neighbour DUT interface IPv6 address. All
58 | | ... | interfaces are brought up.
59 | | ...
60 | | ... | *Arguments:*
61 | | ... | - tg_if1_net - TG interface 1 IPv6 subnet used by traffic generator.
62 | | ... | Type: integer
63 | | ... | - tg_if2_net - TG interface 2 IPv6 subnet used by traffic generator.
64 | | ... | Type: integer
65 | | ... | - subid - ID of the sub-interface to be created. Type: string
66 | | ... | - tag_rewrite - Method of tag rewrite. Type: string
67 | | ...
68 | | ... | _NOTE:_ This KW uses following test case variables:
69 | | ... | - dut1 - DUT1 node.
70 | | ... | - dut2 - DUT2 node.
71 | | ... | - dut1_if2 - DUT1 interface towards DUT2.
72 | | ... | - dut2_if1 - DUT2 interface towards DUT1.
73 | | ...
74 | | ... | *Example:*
75 | | ...
76 | | ... | \| Initialize IPv6 forwarding with VLAN dot1q sub-interfaces\
77 | | ... | in circular topology \| 2001:1::0 \| 2001:2::0 \| 10 \| pop-1 \|
78 | | ...
79 | | [Arguments] | ${tg_if1_net} | ${tg_if2_net} | ${subid} | ${tag_rewrite}
80 | | ...
81 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
82 | | ... | Variable Should Exist | ${dut2}
83 | | ...
84 | | Set interfaces in path up
85 | | ...
86 | | Run Keyword If | '${dut2_status}' == 'PASS'
87 | | ... | Initialize VLAN dot1q sub-interfaces in circular topology
88 | | ... | ${dut1} | ${dut1_if2} | ${dut2} | ${dut2_if1} | ${subid}
89 | | ... | ELSE | Initialize VLAN dot1q sub-interfaces in circular topology
90 | | ... | ${dut1} | ${dut1_if2} | SUB_ID=${subid}
91 | | Run Keyword If | '${dut2_status}' == 'PASS'
92 | | ... | Configure L2 tag rewrite method on interfaces | ${dut1}
93 | | ... | ${subif_index_1} | ${dut2} | ${subif_index_2} | ${tag_rewrite}
94 | | ... | ELSE | Configure L2 tag rewrite method on interfaces
95 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
96 | | ...
97 | | ${prefix}= | Set Variable | 64
98 | | ${host_prefix}= | Set Variable | 64
99 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | 2002:1::1 | ${tg_if1_mac}
100 | | Run Keyword If | '${dut2_status}' == 'PASS'
101 | | ... | VPP Add Ip Neighbor
102 | | ... | ${dut1} | ${subif_index_1} | 2002:2::2 | ${dut2_if1_mac}
103 | | Run Keyword If | '${dut2_status}' == 'PASS'
104 | | ... | VPP Add Ip Neighbor
105 | | ... | ${dut2} | ${subif_index_2} | 2002:2::1 | ${dut1_if2_mac}
106 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
107 | | ... | Set Variable | ${dut2}
108 | | ... | ELSE | Set Variable | ${dut1}
109 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
110 | | ... | Set Variable | ${dut2_if2}
111 | | ... | ELSE | Set Variable | ${subif_index_1}
112 | | VPP Add IP Neighbor | ${dut} | ${dut_if2} | 2002:3::1 | ${tg_if2_mac}
113 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if1} | 2002:1::2 | ${prefix}
114 | | Run Keyword If | '${dut2_status}' == 'PASS'
115 | | ... | VPP Interface Set IP Address | ${dut1} | ${subif_index_1} | 2002:2::1
116 | | ... | ${prefix}
117 | | Run Keyword If | '${dut2_status}' == 'PASS'
118 | | ... | VPP Interface Set IP Address | ${dut2} | ${subif_index_2} | 2002:2::2
119 | | ... | ${prefix}
120 | | VPP Interface Set IP Address | ${dut} | ${dut_if2} | 2002:3::2 | ${prefix}
121 | | Vpp All Ra Suppress Link Layer | ${nodes}
122 | | Vpp Route Add | ${dut1} | ${tg_if1_net} | ${host_prefix}
123 | | ... | gateway=2002:1::1 | interface=${dut1_if1}
124 | | Run Keyword If | '${dut2_status}' == 'PASS'
125 | | ... | Vpp Route Add | ${dut1} | ${tg_if2_net} | ${host_prefix}
126 | | ... | gateway=2002:2::2 | interface=${subif_index_1}
127 | | Run Keyword If | '${dut2_status}' == 'PASS'
128 | | ... | Vpp Route Add | ${dut2} | ${tg_if1_net} | ${host_prefix}
129 | | ... | gateway=2002:2::1 | interface=${subif_index_2}
130 | | Vpp Route Add | ${dut} | ${tg_if2_net} | ${host_prefix}
131 | | ... | gateway=2002:3::1 | interface=${dut_if2}
132
133 | Initialize IPv6 forwarding over SRv6 with encapsulation with '${n}' x SID '${prepos}' decapsulation in 3-node circular topology
134 | | [Documentation]
135 | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular
136 | | ... | topology. Get the interface MAC addresses and setup neighbours on all
137 | | ... | VPP interfaces. Setup IPv6 addresses on all interfaces. Set segment
138 | | ... | routing for IPv6 for required number of SIDs and configure IPv6 routes
139 | | ... | on both DUT nodes.
140 | | ...
141 | | VPP Interface Set IP Address
142 | | ... | ${dut1} | ${dut1_if1} | ${dut1_if1_ip6} | ${prefix}
143 | | VPP Interface Set IP Address
144 | | ... | ${dut1} | ${dut1_if2} | ${dut1_if2_ip6} | ${prefix}
145 | | VPP Interface Set IP Address
146 | | ... | ${dut2} | ${dut2_if1} | ${dut2_if1_ip6} | ${prefix}
147 | | VPP Interface Set IP Address
148 | | ... | ${dut2} | ${dut2_if2} | ${dut2_if2_ip6} | ${prefix}
149 | | Vpp All Ra Suppress Link Layer | ${nodes}
150 | | :FOR | ${number} | IN RANGE | 2 | ${dst_addr_nr}+2
151 | | | ${hexa_nr}= | Convert To Hex | ${number}
152 | | | VPP Add IP Neighbor | ${dut1}
153 | | | ... | ${dut1_if1} | ${tg_if1_ip6_subnet}${hexa_nr} | ${tg_if1_mac}
154 | | | VPP Add IP Neighbor | ${dut2}
155 | | | ... | ${dut2_if2} | ${tg_if2_ip6_subnet}${hexa_nr} | ${tg_if2_mac}
156 | | VPP Add IP Neighbor
157 | | ... | ${dut1} | ${dut1_if2} | ${dut2_if1_ip6} | ${dut2_if1_mac}
158 | | VPP Add IP Neighbor
159 | | ... | ${dut2} | ${dut2_if1} | ${dut1_if2_ip6} | ${dut1_if2_mac}
160 | | ${sid1}= | Set Variable If
161 | | ... | "${n}" == "1" | ${dut2_sid1}
162 | | ... | "${n}" == "2" | ${dut2_sid1_1}
163 | | ${sid2}= | Set Variable If
164 | | ... | "${n}" == "1" | ${dut1_sid2}
165 | | ... | "${n}" == "2" | ${dut1_sid2_1}
166 | | Vpp Route Add | ${dut1} | ${sid1} | ${sid_prefix} | gateway=${dut2_if1_ip6}
167 | | ... | interface=${dut1_if2}
168 | | Vpp Route Add | ${dut2} | ${sid2} | ${sid_prefix} | gateway=${dut1_if2_ip6}
169 | | ... | interface=${dut2_if1}
170 # Configure SRv6 for direction0
171 | | Set SR Encaps Source Address on DUT | ${dut1} | ${dut1_sid1}
172 | | @{sid_list_dir0}= | Run Keyword If | "${n}" == "1"
173 | | ... | Create List | ${dut2_sid1}
174 | | ... | ELSE IF | "${n}" == "2"
175 | | ... | Create List | ${dut2_sid1_1} | ${dut2_sid1_2}
176 | | Configure SR Policy on DUT | ${dut1} | ${dut1_bsid} | encap
177 | | ... | @{sid_list_dir0}
178 | | Configure SR Steer on DUT | ${dut1} | L3 | ${dut1_bsid}
179 | | ... | ip_addr=${tg_if2_ip6_subnet} | prefix=${sid_prefix}
180 | | Run Keyword If | "${n}" == "1"
181 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.dx6
182 | | ... | interface=${dut2_if2} | next_hop=${tg_if2_ip6_subnet}2
183 | | Run Keyword If | "${n}" == "2"
184 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1_1} | end
185 | | Run Keyword If | "${n}" == "2" and "${prepos}" != "without"
186 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1_2} | end.dx6
187 | | ... | interface=${dut2_if2} | next_hop=${tg_if2_ip6_subnet}2
188 | | Run Keyword If | "${n}" == "2" and "${prepos}" == "without"
189 | | ... | Vpp Route Add | ${dut2} | ${dut2_sid1_2} | ${sid_prefix}
190 | | ... | gateway=${tg_if2_ip6_subnet}2 | interface=${dut2_if2}
191 # Configure SRv6 for direction1
192 | | Set SR Encaps Source Address on DUT | ${dut2} | ${dut2_sid2}
193 | | @{sid_list_dir1}= | Run Keyword If | "${n}" == "1"
194 | | ... | Create List | ${dut1_sid2}
195 | | ... | ELSE IF | "${n}" == "2"
196 | | ... | Create List | ${dut1_sid2_1} | ${dut1_sid2_2}
197 | | Configure SR Policy on DUT | ${dut2} | ${dut2_bsid} | encap
198 | | ... | @{sid_list_dir1}
199 | | Configure SR Steer on DUT | ${dut2} | L3 | ${dut2_bsid}
200 | | ... | ip_addr=${tg_if1_ip6_subnet} | prefix=${sid_prefix}
201 | | Run Keyword If | "${n}" == "1"
202 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.dx6
203 | | ... | interface=${dut1_if1} | next_hop=${tg_if1_ip6_subnet}2
204 | | Run Keyword If | "${n}" == "2"
205 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2_1} | end
206 | | Run Keyword If | "${n}" == "2" and "${prepos}" != "without"
207 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2_2} | end.dx6
208 | | ... | interface=${dut1_if1} | next_hop=${tg_if1_ip6_subnet}2
209 | | Run Keyword If | "${n}" == "2" and "${prepos}" == "without"
210 | | ... | Vpp Route Add | ${dut1} | ${dut1_sid2_2} | ${sid_prefix}
211 | | ... | gateway=${tg_if1_ip6_subnet}2 | interface=${dut1_if1}
212 | | Set interfaces in path up
213
214 | Initialize IPv6 forwarding over SRv6 with endpoint to SR-unaware Service Function via '${behavior}' behaviour in 3-node circular topology
215 | | [Documentation]
216 | | ... | Create pair of Memif interfaces on all defined VPP nodes. Set UP
217 | | ... | state on VPP interfaces in path on nodes in 3-node circular topology.
218 | | ... | Get the interface MAC addresses and setup neighbours on all VPP
219 | | ... | interfaces. Setup IPv6 addresses on all interfaces. Set segment
220 | | ... | routing for IPv6 with defined behaviour function and configure IPv6
221 | | ... | routes on both DUT nodes.
222 | | ...
223 | | ... | *Note:*
224 | | ... | KW uses test variable rxq_count_int set by KW Add worker threads
225 | | ... | and rxqueues to all DUTs
226 | | ...
227 | | ${sock1}= | Set Variable | memif-DUT1_CNF
228 | | ${sock2}= | Set Variable | memif-DUT2_CNF
229 | | Set up memif interfaces on DUT node | ${dut1} | ${sock1} | ${sock1}
230 | | ... | ${1} | dut1-memif-1-if1 | dut1-memif-1-if2 | ${rxq_count_int}
231 | | ... | ${rxq_count_int}
232 | | VPP Set interface MTU | ${dut1} | ${dut1-memif-1-if1}
233 | | VPP Set interface MTU | ${dut1} | ${dut1-memif-1-if2}
234 | | Set up memif interfaces on DUT node | ${dut2} | ${sock2} | ${sock2}
235 | | ... | ${1} | dut2-memif-1-if1 | dut2-memif-1-if2 | ${rxq_count_int}
236 | | ... | ${rxq_count_int}
237 | | VPP Set interface MTU | ${dut2} | ${dut2-memif-1-if1}
238 | | VPP Set interface MTU | ${dut2} | ${dut2-memif-1-if2}
239 | | :FOR | ${dut} | IN | @{duts}
240 | | | Show Memif | ${nodes['${dut}']}
241 | | VPP Interface Set IP Address
242 | | ... | ${dut1} | ${dut1_if1} | ${dut1_if1_ip6} | ${prefix}
243 | | VPP Interface Set IP Address
244 | | ... | ${dut1} | ${dut1_if2} | ${dut1_if2_ip6} | ${prefix}
245 | | VPP Interface Set IP Address | ${dut1} | ${dut1-memif-1-if1}
246 | | ... | ${dut1-memif-1-if1_ip6} | ${mem_prefix}
247 | | VPP Interface Set IP Address | ${dut1} | ${dut1-memif-1-if2}
248 | | ... | ${dut1-memif-1-if2_ip6} | ${mem_prefix}
249 | | VPP Interface Set IP Address
250 | | ... | ${dut2} | ${dut2_if1} | ${dut2_if1_ip6} | ${prefix}
251 | | VPP Interface Set IP Address
252 | | ... | ${dut2} | ${dut2_if2} | ${dut2_if2_ip6} | ${prefix}
253 | | VPP Interface Set IP Address | ${dut2} | ${dut2-memif-1-if1}
254 | | ... | ${dut2-memif-1-if1_ip6} | ${mem_prefix}
255 | | VPP Interface Set IP Address | ${dut2} | ${dut2-memif-1-if2}
256 | | ... | ${dut2-memif-1-if2_ip6} | ${mem_prefix}
257 | | Vpp All Ra Suppress Link Layer | ${nodes}
258 | | VPP Add IP Neighbor
259 | | ... | ${dut1} | ${dut1_if2} | ${dut2_if1_ip6} | ${dut2_if1_mac}
260 | | VPP Add IP Neighbor
261 | | ... | ${dut2} | ${dut2_if1} | ${dut1_if2_ip6} | ${dut1_if2_mac}
262 | | VPP Add IP Neighbor
263 | | ... | ${dut1} | ${dut1_if1} | ${tg_if1_ip6_subnet}2 | ${tg_if1_mac}
264 | | VPP Add IP Neighbor
265 | | ... | ${dut2} | ${dut2_if2} | ${tg_if2_ip6_subnet}2 | ${tg_if2_mac}
266 | | ${dut1-memif-1-if2_mac}= | Get Interface MAC | ${dut1} | memif2
267 | | ${dut2-memif-1-if2_mac}= | Get Interface MAC | ${dut2} | memif2
268 | | VPP Add IP Neighbor | ${dut1}
269 | | ... | ${dut1-memif-1-if1} | ${dut1_nh} | ${dut1-memif-1-if2_mac}
270 | | VPP Add IP Neighbor | ${dut2}
271 | | ... | ${dut2-memif-1-if1} | ${dut2_nh} | ${dut2-memif-1-if2_mac}
272 | | Vpp Route Add | ${dut1} | ${dut2_sid1} | ${sid_prefix}
273 | | ... | gateway=${dut2_if1_ip6} | interface=${dut1_if2}
274 | | Vpp Route Add | ${dut1} | ${out_sid2_1} | ${sid_prefix}
275 | | ... | gateway=${tg_if1_ip6_subnet}2 | interface=${dut1_if1}
276 | | Vpp Route Add | ${dut2} | ${dut1_sid2} | ${sid_prefix}
277 | | ... | gateway=${dut1_if2_ip6} | interface=${dut2_if1}
278 | | Vpp Route Add | ${dut2} | ${out_sid1_1} | ${sid_prefix}
279 | | ... | gateway=${tg_if2_ip6_subnet}2 | interface=${dut2_if2}
280 # Configure SRv6 for direction0 on DUT1
281 | | Set SR Encaps Source Address on DUT | ${dut1} | ${dut1_sid1}
282 | | @{sid_list_dir0}= | Create List | ${dut2_sid1} | ${out_sid1_1}
283 | | ... | ${out_sid1_2}
284 | | Configure SR Policy on DUT | ${dut1} | ${dut1_bsid} | encap
285 | | ... | @{sid_list_dir0}
286 | | Configure SR Steer on DUT | ${dut1} | L3 | ${dut1_bsid}
287 | | ... | ip_addr=${tg_if2_ip6_subnet} | prefix=${sid_prefix}
288 # Configure SRv6 for direction1 on DUT2
289 | | Set SR Encaps Source Address on DUT | ${dut2} | ${dut2_sid2}
290 | | @{sid_list_dir1}= | Create List | ${dut1_sid2} | ${out_sid2_1}
291 | | ... | ${out_sid2_2}
292 | | Configure SR Policy on DUT | ${dut2} | ${dut2_bsid} | encap
293 | | ... | @{sid_list_dir1}
294 | | Configure SR Steer on DUT | ${dut2} | L3 | ${dut2_bsid}
295 | | ... | ip_addr=${tg_if1_ip6_subnet} | prefix=${sid_prefix}
296 # Configure SRv6 for direction0 on DUT2
297 | | ${dut2_out_if}= | Get Interface Name | ${dut2} | memif1
298 | | ${dut2_in_if}= | Get Interface Name | ${dut2} | memif2
299 | | Remove Values From List | ${sid_list_dir0} | ${dut2_sid1}
300 | | Run Keyword If | "${behavior}" == "static_proxy"
301 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.as
302 | | ... | ${NONE} | ${dut2_nh} | ${NONE} | ${dut2_out_if} | ${dut2_in_if}
303 | | ... | ${dut1_sid1} | @{sid_list_dir0}
304 | | ... | ELSE IF | "${behavior}" == "dynamic_proxy"
305 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.ad
306 | | ... | next_hop=${dut2_nh} | out_if=${dut2_out_if} | in_if=${dut2_in_if}
307 | | ... | ELSE IF | "${behavior}" == "masquerading"
308 | | ... | Configure SR LocalSID on DUT | ${dut2} | ${dut2_sid1} | end.am
309 | | ... | next_hop=${dut2_nh} | out_if=${dut2_out_if} | in_if=${dut2_in_if}
310 | | ... | ELSE | Fail | Unsupported behaviour: ${behavior}
311 # Configure SRv6 for direction1 on DUT1
312 | | ${dut1_out_if}= | Get Interface Name | ${dut1} | memif1
313 | | ${dut1_in_if}= | Get Interface Name | ${dut1} | memif2
314 | | Remove Values From List | ${sid_list_dir1} | ${dut1_sid2}
315 | | Run Keyword If | "${behavior}" == "static_proxy"
316 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.as
317 | | ... | ${NONE} | ${dut1_nh} | ${NONE} | ${dut1_out_if} | ${dut1_in_if}
318 | | ... | ${dut2_sid2} | @{sid_list_dir1}
319 | | ... | ELSE IF | "${behavior}" == "dynamic_proxy"
320 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.ad
321 | | ... | next_hop=${dut1_nh} | out_if=${dut1_out_if} | in_if=${dut1_in_if}
322 | | ... | ELSE IF | "${behavior}" == "masquerading"
323 | | ... | Configure SR LocalSID on DUT | ${dut1} | ${dut1_sid2} | end.am
324 | | ... | next_hop=${dut1_nh} | out_if=${dut1_out_if} | in_if=${dut1_in_if}
325 | | ... | ELSE | Fail | Unsupported behaviour: ${behavior}
326 | | Set interfaces in path up
327
328 | Configure IPv4 ACLs
329 | | [Documentation]
330 | | ... | Configure ACL with required number of not-hitting permit ACEs plus two
331 | | ... | hitting ACEs for both traffic directions.
332 | | ...
333 | | ... | *Arguments:*
334 | | ... | - dut_node - DUT node. Type: dictionary
335 | | ... | - dut_if1 - DUT node interface1 name (Optional). Type: string
336 | | ... | - dut_if2 - DUT node interface2 name (Optional). Type: string
337 | | ...
338 | | ... | *Example:*
339 | | ...
340 | | ... | \| Configure IPv4 ACLs \| ${nodes['DUT1']} \| GigabitEthernet0/7/0 \
341 | | ... | \| GigabitEthernet0/8/0 \|
342 | | ...
343 | | ... | _NOTE:_ This KW uses following test case variables:
344 | | ... | - src_ip_start - Source IP address start. Type: string
345 | | ... | - dst_ip_start - Destination IP address start. Type: string
346 | | ... | - ip_step - IP address step. Type: string
347 | | ... | - sport_start - Source port number start. Type: string
348 | | ... | - dport_start - Destination port number start. Type: string
349 | | ... | - port_step - Port number step. Type: string
350 | | ... | - no_hit_aces_number - Number of not-hitting ACEs to be configured.
351 | | ... | Type: integer
352 | | ... | - acl_apply_type - To what path apply the ACL - input or output.
353 | | ... | Type: string
354 | | ... | - acl_action - Action for the rule - deny, permit, permit+reflect.
355 | | ... | Type: string
356 | | ... | - trex_stream1_subnet - IP subnet used by T-Rex in direction 0->1.
357 | | ... | Type: string
358 | | ... | - trex_stream2_subnet - IP subnet used by T-Rex in direction 1->0.
359 | | ... | Type: string
360 | | ...
361 | | [Arguments] | ${dut} | ${dut_if1}=${NONE} | ${dut_if2}=${NONE}
362 | | ${src_ip_int} = | Evaluate
363 | | ... | int(ipaddress.ip_address(unicode($src_ip_start))) - $ip_step
364 | | ... | modules=ipaddress
365 | | ${dst_ip_int} = | Evaluate
366 | | ... | int(ipaddress.ip_address(unicode($dst_ip_start))) - $ip_step
367 | | ... | modules=ipaddress
368 | | ${ip_limit} = | Set Variable | 255.255.255.255
369 | | ${ip_limit_int} = | Evaluate
370 | | ... | int(ipaddress.ip_address(unicode($ip_limit))) | modules=ipaddress
371 | | ${sport}= | Evaluate | $sport_start - $port_step
372 | | ${dport}= | Evaluate | $dport_start - $port_step
373 | | ${port_limit}= | Set Variable | ${65535}
374 | | ${acl}= | Set Variable | ipv4 permit
375 | | :FOR | ${nr} | IN RANGE | 0 | ${no_hit_aces_number}
376 | | | ${src_ip_int} = | Evaluate | $src_ip_int + $ip_step
377 | | | ${dst_ip_int} = | Evaluate | $dst_ip_int + $ip_step
378 | | | ${sport}= | Evaluate | $sport + $port_step
379 | | | ${dport}= | Evaluate | $dport + $port_step
380 | | | ${ipv4_limit_reached}= | Set Variable If
381 | | | ... | $src_ip_int > $ip_limit_int or $src_ip_int > $ip_limit_int
382 | | | ... | ${TRUE}
383 | | | ${udp_limit_reached}= | Set Variable If
384 | | | ... | $sport > $port_limit or $dport > $port_limit | ${TRUE}
385 | | | Run Keyword If | $ipv4_limit_reached is True | Log
386 | | | ... | Can't do more iterations - IPv4 address limit has been reached.
387 | | | ... | WARN
388 | | | Run Keyword If | $udp_limit_reached is True | Log
389 | | | ... | Can't do more iterations - UDP port limit has been reached.
390 | | | ... | WARN
391 | | | ${src_ip} = | Run Keyword If | $ipv4_limit_reached is True
392 | | | ... | Set Variable | ${ip_limit}
393 | | | ... | ELSE | Evaluate | str(ipaddress.ip_address($src_ip_int))
394 | | | ... | modules=ipaddress
395 | | | ${dst_ip} = | Run Keyword If | $ipv4_limit_reached is True
396 | | | ... | Set Variable | ${ip_limit}
397 | | | ... | ELSE | Evaluate | str(ipaddress.ip_address($dst_ip_int))
398 | | | ... | modules=ipaddress
399 | | | ${sport}= | Set Variable If | ${sport} > $port_limit | $port_limit
400 | | | ... | ${sport}
401 | | | ${dport}= | Set Variable If | ${dport} > $port_limit | $port_limit
402 | | | ... | ${dport}
403 | | | ${acl}= | Catenate | ${acl} | src ${src_ip}/32 dst ${dst_ip}/32
404 | | | ... | sport ${sport} | dport ${dport},
405 | | | Exit For Loop If
406 | | | ... | $ipv4_limit_reached is True or $udp_limit_reached is True
407 | | ${acl}= | Catenate | ${acl}
408 | | ... | ipv4 ${acl_action} src ${trex_stream1_subnet},
409 | | ... | ipv4 ${acl_action} src ${trex_stream2_subnet}
410 | | Add Replace Acl Multi Entries | ${dut} | rules=${acl}
411 | | @{acl_list}= | Create List | ${0}
412 | | Run Keyword If | 'input' in $acl_apply_type and $dut_if1 is not None
413 | | ... | Set Acl List For Interface | ${dut} | ${dut_if1} | input | ${acl_list}
414 | | Run Keyword If | 'input' in $acl_apply_type and $dut_if2 is not None
415 | | ... | Set Acl List For Interface | ${dut} | ${dut_if2} | input | ${acl_list}
416 | | Run Keyword If | 'output' in $acl_apply_type and $dut_if1 is not None
417 | | ... | Set Acl List For Interface | ${dut} | ${dut_if1} | output
418 | | ... | ${acl_list}
419 | | Run Keyword If | 'output' in $acl_apply_type and $dut_if2 is not None
420 | | ... | Set Acl List For Interface | ${dut} | ${dut_if2} | output
421 | | ... | ${acl_list}
422
423 | Initialize IPv4 routing for '${ip_nr}' addresses with IPv4 ACLs on DUT1 in circular topology
424 | | [Documentation]
425 | | ... | Set UP state on VPP interfaces in path on nodes in 2-node / 3-node
426 | | ... | circular topology. Get the interface MAC addresses and setup ARP on
427 | | ... | all VPP interfaces. Setup IPv4 addresses with /24 prefix on DUT-TG
428 | | ... | links. In case of 3-node topology setup IPv4 adresses with /30 prefix
429 | | ... | on DUT1-DUT2 link and set routing on both DUT nodes with prefix /24
430 | | ... | and next hop of neighbour DUT interface IPv4 address.
431 | | ... | Apply required ACL rules to DUT1 interfaces.
432 | | ...
433 | | ... | *Arguments:*
434 | | ... | - ip_nr - Number of IPs to be used. Type: integer or string
435 | | ...
436 | | ... | *Example:*
437 | | ...
438 | | ... | \| Initialize IPv4 routing for '10' addresses with IPv4 ACLs on DUT1 \
439 | | ... | in 3-node circular topology \|
440 | | ...
441 | | ... | _NOTE:_ This KW uses following test case variables:
442 | | ... | - tg - TG node.
443 | | ... | - dut1 - DUT1 node.
444 | | ... | - dut2 - DUT2 node.
445 | | ... | - tg_if1 - TG interface 1 towards DUT1.
446 | | ... | - tg_if2 - TG interface 2 towards DUT2 (3-node topo) or DUT1
447 | | ... | (2-node topo).
448 | | ... | - dut1_if1 - DUT1 interface 1 towards TG.
449 | | ... | - dut1_if2 - DUT1 interface 2 towards DUT2 (3-node topo) or TG
450 | | ... | (2-node topo).
451 | | ... | - dut2_if1 - DUT2 interface 1 towards DUT1.
452 | | ... | - dut2_if2 - DUT2 interface 2 towards TG.
453 | | ...
454 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
455 | | ... | Variable Should Exist | ${dut2}
456 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
457 | | ... | Set Variable | ${dut2}
458 | | ... | ELSE | Set Variable | ${dut1}
459 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
460 | | ... | Set Variable | ${dut2_if2}
461 | | ... | ELSE | Set Variable | ${dut1_if2}
462 | | ...
463 | | Set interfaces in path up
464 | | ...
465 | | :FOR | ${number} | IN RANGE | 2 | ${ip_nr}+2
466 | | | VPP Add IP Neighbor
467 | | | ... | ${dut1} | ${dut1_if1} | 10.10.10.${number} | ${tg_if1_mac}
468 | | | VPP Add IP Neighbor
469 | | | ... | ${dut} | ${dut_if2} | 20.20.20.${number} | ${tg_if2_mac}
470 | | Run Keyword If | '${dut2_status}' == 'PASS'
471 | | ... | VPP Add IP Neighbor
472 | | ... | ${dut1} | ${dut1_if2} | 1.1.1.2 | ${dut2_if1_mac}
473 | | Run Keyword If | '${dut2_status}' == 'PASS'
474 | | ... | VPP Add IP Neighbor
475 | | ... | ${dut2} | ${dut2_if1} | 1.1.1.1 | ${dut1_if2_mac}
476 | | ...
477 | | VPP Interface Set IP Address
478 | | ... | ${dut1} | ${dut1_if1} | 10.10.10.1 | 24
479 | | VPP Interface Set IP Address
480 | | ... | ${dut} | ${dut_if2} | 20.20.20.1 | 24
481 | | Run Keyword If | '${dut2_status}' == 'PASS'
482 | | ... | VPP Interface Set IP Address
483 | | ... | ${dut1} | ${dut1_if2} | 1.1.1.1 | 30
484 | | Run Keyword If | '${dut2_status}' == 'PASS'
485 | | ... | VPP Interface Set IP Address
486 | | ... | ${dut2} | ${dut2_if1} | 1.1.1.2 | 30
487 | | ...
488 | | Run Keyword If | '${dut2_status}' == 'PASS'
489 | | ... | Vpp Route Add | ${dut1} | 20.20.20.0 | 24 | gateway=1.1.1.2
490 | | ... | interface=${dut1_if2}
491 | | Run Keyword If | '${dut2_status}' == 'PASS'
492 | | ... | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | gateway=1.1.1.1
493 | | ... | interface=${dut2_if1}
494 | | ...
495 | | Configure IPv4 ACLs | ${dut1} | ${dut1_if1} | ${dut1_if2}
496
497 | Configure MACIP ACLs
498 | | [Documentation]
499 | | ... | Configure MACIP ACL with required number of not-hitting permit ACEs
500 | | ... | plus two hitting ACEs for both traffic directions.
501 | | ...
502 | | ... | *Arguments:*
503 | | ... | - dut_node - DUT node. Type: dictionary
504 | | ... | - dut_if1 - DUT node interface1 name (Optional). Type: string
505 | | ... | - dut_if2 - DUT node interface2 name (Optional). Type: string
506 | | ...
507 | | ... | *Example:*
508 | | ...
509 | | ... | \| Configure MACIP ACLs \| ${nodes['DUT1']} \| GigabitEthernet0/7/0 \
510 | | ... | \| GigabitEthernet0/8/0 \|
511 | | ...
512 | | ... | _NOTE:_ This KW uses following test case variables:
513 | | ... | - src_ip_start - Source IP address start. Type: string
514 | | ... | - ip_step - IP address step. Type: string
515 | | ... | - src_mac_start - Source MAC address start in format with colons.
516 | | ... | Type: string
517 | | ... | - src_mac_step - Source MAC address step. Type: string
518 | | ... | - src_mac_mask - Source MAC address mask. 00:00:00:00:00:00 is a
519 | | ... | wildcard mask. Type: string
520 | | ... | - no_hit_aces_number - Number of not-hitting ACEs to be configured.
521 | | ... | Type: integer
522 | | ... | - acl_action - Action for the rule - deny, permit, permit+reflect.
523 | | ... | Type: string
524 | | ... | - tg_stream1_subnet - IP subnet used by TG in direction 0->1.
525 | | ... | Type: string
526 | | ... | - tg_stream2_subnet - IP subnet used by TG in direction 1->0.
527 | | ... | Type: string
528 | | ... | - tg_stream1_mac - Source MAC address of traffic stream 1.
529 | | ... | Type: string
530 | | ... | - tg_stream2_mac - Source MAC address of traffic stream 2.
531 | | ... | Type: string
532 | | ... | - tg_mac_mask - MAC address mask for traffic streams.
533 | | ... | 00:00:00:00:00:00 is a wildcard mask. Type: string
534 | | ...
535 | | [Arguments] | ${dut} | ${dut_if1}=${NONE} | ${dut_if2}=${NONE}
536 | | ...
537 | | ${src_ip_int} = | IP To Int | ${src_ip_start}
538 | | ${src_ip_int} = | Evaluate | ${src_ip_int} - ${ip_step}
539 | | ...
540 | | ${ip_limit} = | Set Variable | 255.255.255.255
541 | | ${ip_limit_int} = | IP To Int | ${ip_limit}
542 | | ...
543 | | ${src_mac_int} = | Mac To Int | ${src_mac_start}
544 | | ${src_mac_int} = | Evaluate | ${src_mac_int} - ${src_mac_step}
545 | | ...
546 | | ${mac_limit} = | Set Variable | ff:ff:ff:ff:ff:ff
547 | | ${mac_limit_int} = | Mac To Int | ${mac_limit}
548 | | ...
549 | | ${acl}= | Set Variable | ipv4 permit
550 | | :FOR | ${nr} | IN RANGE | 0 | ${no_hit_aces_number}
551 | | | ${src_ip_int} = | Evaluate | ${src_ip_int} + ${ip_step}
552 | | | ${src_mac_int} = | Evaluate | ${src_mac_int} + ${src_mac_step}
553 | | | ${ipv4_limit_reached}= | Set Variable If
554 | | | ... | ${src_ip_int} > ${ip_limit_int} | ${TRUE}
555 | | | ${mac_limit_reached}= | Set Variable If
556 | | | ... | ${src_mac_int} > ${mac_limit_int} | ${TRUE}
557 | | | Run Keyword If | '${ipv4_limit_reached}' == '${TRUE}' | Log
558 | | | ... | Can't do more iterations - IPv4 address limit has been reached.
559 | | | ... | WARN
560 | | | Run Keyword If | '${mac_limit_reached}' == '${TRUE}' | Log
561 | | | ... | Can't do more iterations - MAC address limit has been reached.
562 | | | ... | WARN
563 | | | ${src_ip} = | Run Keyword If | '${ipv4_limit_reached}' == '${TRUE}'
564 | | | ... | Set Variable | ${ip_limit}
565 | | | ... | ELSE | Int To IP | ${src_ip_int}
566 | | | ${src_mac}= | Run Keyword If | '${mac_limit_reached}' == '${TRUE}'
567 | | | ... | Set Variable | ${mac_limit}
568 | | | ... | ELSE | Int To Mac | ${src_mac_int}
569 | | | ${acl}= | Catenate | ${acl} | ip ${src_ip}/32
570 | | | ... | mac ${src_mac} | mask ${src_mac_mask},
571 | | | Exit For Loop If | '${ipv4_limit_reached}' == '${TRUE}' or '${mac_limit_reached}' == '${TRUE}'
572 | | ${acl0}= | Catenate | ${acl}
573 | | ... | ipv4 ${acl_action} ip ${tg_stream1_subnet} mac ${tg_stream1_mac}
574 | | ... | mask ${tg_mac_mask}
575 | | ${acl1}= | Catenate | ${acl}
576 | | ... | ipv4 ${acl_action} ip ${tg_stream2_subnet} mac ${tg_stream2_mac}
577 | | ... | mask ${tg_mac_mask}
578 | | Add Macip Acl Multi Entries | ${dut} | rules=${acl0}
579 | | Add Macip Acl Multi Entries | ${dut} | rules=${acl1}
580 | | ${acl_idx}= | Set Variable | 0
581 | | Run Keyword Unless | '${dut_if1}' == '${NONE}'
582 | | ... | Add Del Macip Acl Interface | ${dut} | ${dut_if1} | add | ${acl_idx}
583 | | ${acl_idx}= | Set Variable | 1
584 | | Run Keyword Unless | '${dut_if2}' == '${NONE}'
585 | | ... | Add Del Macip Acl Interface | ${dut} | ${dut_if2} | add | ${acl_idx}
586
587 | Initialize LISP IPv4 forwarding in 3-node circular topology
588 | | [Documentation] | Custom setup of IPv4 addresses on all DUT nodes and TG \
589 | | ... | Don`t set route.
590 | | ...
591 | | ... | *Arguments:*
592 | | ... | - dut1_dut2_address - Ip address from DUT1 to DUT2. Type: string
593 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
594 | | ... | - dut2_dut1_address - Ip address from DUT2 to DUT1. Type: string
595 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
596 | | ... | - duts_prefix - ip prefix. Type: int
597 | | ...
598 | | ... | *Return:*
599 | | ... | - No value returned
600 | | ...
601 | | ... | *Example:*
602 | | ... | \| Initialize LISP IPv4 forwarding in 3-node circular topology \
603 | | ... | \| ${dut1_dut2_address} \| ${dut1_tg_address} \
604 | | ... | \| ${dut2_dut1_address} \| ${dut2_tg_address} \| ${duts_prefix} \|
605 | | ...
606 | | [Arguments] | ${dut1_dut2_address} | ${dut1_tg_address}
607 | | ... | ${dut2_dut1_address} | ${dut2_tg_address} | ${duts_prefix}
608 | | ...
609 | | Set interfaces in path up
610 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg_if1_mac}
611 | | VPP Add IP Neighbor
612 | | ... | ${dut1} | ${dut1_if2} | ${dut2_dut1_address} | ${dut2_if1_mac}
613 | | VPP Add IP Neighbor
614 | | ... | ${dut2} | ${dut2_if1} | ${dut1_dut2_address} | ${dut1_if2_mac}
615 | | VPP Add IP Neighbor | ${dut2} | ${dut2_if2} | 20.20.20.2 | ${tg_if2_mac}
616 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if1}
617 | | ... | ${dut1_tg_address} | ${duts_prefix}
618 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if2}
619 | | ... | ${dut1_dut2_address} | ${duts_prefix}
620 | | VPP Interface Set IP Address | ${dut2} | ${dut2_if1}
621 | | ... | ${dut2_dut1_address} | ${duts_prefix}
622 | | VPP Interface Set IP Address | ${dut2} | ${dut2_if2}
623 | | ... | ${dut2_tg_address} | ${duts_prefix}
624
625 | Initialize LISP GPE IPv4 over IPsec in 3-node circular topology
626 | | [Documentation] | Setup Lisp GPE IPv4 forwarding over IPsec.
627 | | ...
628 | | ... | *Arguments:*
629 | | ... | - encr_alg - Encryption algorithm. Type: string
630 | | ... | - auth_alg - Authentication algorithm. Type: string
631 | | ...
632 | | ... | *Return:*
633 | | ... | - No value returned
634 | | ...
635 | | ... | *Example:*
636 | | ... | \| Initialize LISP GPE IPv4 over IPsec in 3-node circular topology\
637 | | ... | \| ${encr_alg} \| ${auth_alg}
638 | | ...
639 | | [Arguments] | ${encr_alg} | ${auth_alg}
640 | | ...
641 | | Generate keys for IPSec | ${encr_alg} | ${auth_alg}
642 | | Initialize LISP IPv4 forwarding in 3-node circular topology
643 | | ... | ${dut1_to_dut2_ip4} | ${dut1_to_tg_ip4} | ${dut2_to_dut1_ip4}
644 | | ... | ${dut2_to_tg_ip4} | ${prefix4}
645 | | Configure LISP GPE topology in 3-node circular topology
646 | | ... | ${dut1} | ${dut1_if2} | ${NONE}
647 | | ... | ${dut2} | ${dut2_if1} | ${NONE}
648 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
649 | | ... | ${dut1_ip4_static_adjacency} | ${dut2_ip4_static_adjacency}
650 | | Configure manual keyed connection for IPSec
651 | | ... | ${dut1} | ${dut1_if2} | ${encr_alg} | ${encr_key}
652 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
653 | | ... | ${dut1_to_dut2_ip4} | ${dut2_to_dut1_ip4}
654 | | Configure manual keyed connection for IPSec
655 | | ... | ${dut2} | ${dut2_if1} | ${encr_alg} | ${encr_key}
656 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
657 | | ... | ${dut2_to_dut1_ip4} | ${dut1_to_dut2_ip4}
658
659 | Initialize LISP IPv6 forwarding in 3-node circular topology
660 | | [Documentation] | Custom setup of IPv6 topology on all DUT nodes \
661 | | ... | Don`t set route.
662 | | ...
663 | | ... | *Arguments:*
664 | | ... | - dut1_dut2_address - Ip address from DUT1 to DUT2. Type: string
665 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
666 | | ... | - dut2_dut1_address - Ip address from DUT2 to DUT1. Type: string
667 | | ... | - dut1_tg_address - Ip address from DUT1 to tg. Type: string
668 | | ... | - duts_prefix - ip prefix. Type: int
669 | | ...
670 | | ... | *Return:*
671 | | ... | - No value returned
672 | | ...
673 | | ... | *Example:*
674 | | ... | \| Initialize LISP IPv6 forwarding in 3-node circular topology \
675 | | ... | \| ${dut1_dut2_address} \| ${dut1_tg_address} \
676 | | ... | \| ${dut2_dut1_address} \| ${dut2_tg_address} \| ${duts_prefix} \|
677 | | ...
678 | | [Arguments] | ${dut1_dut2_address} | ${dut1_tg_address}
679 | | ... | ${dut2_dut1_address} | ${dut2_tg_address} | ${prefix}
680 | | ...
681 | | Set interfaces in path up
682 | | VPP Interface Set IP Address
683 | | ... | ${dut1} | ${dut1_if1} | ${dut1_tg_address} | ${prefix}
684 | | VPP Interface Set IP Address
685 | | ... | ${dut1} | ${dut1_if2} | ${dut1_dut2_address} | ${prefix}
686 | | VPP Interface Set IP Address
687 | | ... | ${dut2} | ${dut2_if1} | ${dut2_dut1_address} | ${prefix}
688 | | VPP Interface Set IP Address
689 | | ... | ${dut2} | ${dut2_if2} | ${dut2_tg_address} | ${prefix}
690 | | Vpp All Ra Suppress Link Layer | ${nodes}
691 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg_if1_mac}
692 | | VPP Add IP Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg_if2_mac}
693 | | VPP Add IP Neighbor
694 | | ... | ${dut1} | ${dut1_if2} | ${dut2_dut1_address} | ${dut2_if1_mac}
695 | | VPP Add IP Neighbor
696 | | ... | ${dut2} | ${dut2_if1} | ${dut1_dut2_address} | ${dut1_if2_mac}
697
698 | Initialize LISP IPv4 over IPv6 forwarding in 3-node circular topology
699 | | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \
700 | | ... | Don`t set route.
701 | | ...
702 | | ... | *Arguments:*
703 | | ... | - dut1_dut2_ip6_address - IPv6 address from DUT1 to DUT2.
704 | | ... | Type: string
705 | | ... | - dut1_tg_ip4_address - IPv4 address from DUT1 to tg. Type: string
706 | | ... | - dut2_dut1_ip6_address - IPv6 address from DUT2 to DUT1.
707 | | ... | Type: string
708 | | ... | - dut1_tg_ip4_address - IPv4 address from DUT1 to tg. Type: string
709 | | ... | - prefix4 - IPv4 prefix. Type: int
710 | | ... | - prefix6 - IPv6 prefix. Type: int
711 | | ...
712 | | ... | *Return:*
713 | | ... | - No value returned
714 | | ...
715 | | ... | *Example:*
716 | | ... | \| Lisp IPv4 over IPv6 forwarding initialized in a 3-node circular \
717 | | ... | topology \| ${dut1_dut2_ip6_address} \| ${dut1_tg_ip4_address} \
718 | | ... | \| ${dut2_dut1_ip6_address} \| ${dut2_tg_ip4_address} \
719 | | ... | \| ${prefix4} \| ${prefix6} \|
720 | | ...
721 | | [Arguments] | ${dut1_dut2_ip6_address} | ${dut1_tg_ip4_address}
722 | | ... | ${dut2_dut1_ip6_address} | ${dut2_tg_ip4_address}
723 | | ... | ${prefix4} | ${prefix6}
724 | | ...
725 | | Set interfaces in path up
726 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if1}
727 | | ... | ${dut1_tg_ip4_address} | ${prefix4}
728 | | VPP Interface Set IP Address
729 | | ... | ${dut1} | ${dut1_if2} | ${dut1_dut2_ip6_address} | ${prefix6}
730 | | VPP Interface Set IP Address
731 | | ... | ${dut2} | ${dut2_if1} | ${dut2_dut1_ip6_address} | ${prefix6}
732 | | VPP Interface Set IP Address | ${dut2} | ${dut2_if2}
733 | | ... | ${dut2_tg_ip4_address} | ${prefix4}
734 | | Vpp All Ra Suppress Link Layer | ${nodes}
735 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | 10.10.10.2 | ${tg_if1_mac}
736 | | VPP Add IP Neighbor | ${dut2} | ${dut2_if2} | 20.20.20.2 | ${tg_if2_mac}
737 | | VPP Add IP Neighbor
738 | | ... | ${dut1} | ${dut1_if2} | ${dut2_dut1_ip6_address} | ${dut2_if1_mac}
739 | | VPP Add IP Neighbor
740 | | ... | ${dut2} | ${dut2_if1} | ${dut1_dut2_ip6_address} | ${dut1_if2_mac}
741
742 | Initialize LISP IPv6 over IPv4 forwarding in 3-node circular topology
743 | | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \
744 | | ... | Don`t set route.
745 | | ...
746 | | ... | *Arguments:*
747 | | ... | - dut1_dut2_ip4_address - IPv4 address from DUT1 to DUT2.
748 | | ... | Type: string
749 | | ... | - dut1_tg_ip6_address - IPv6 address from DUT1 to tg. Type: string
750 | | ... | - dut2_dut1_ip4_address - IPv4 address from DUT2 to DUT1.
751 | | ... | Type: string
752 | | ... | - dut1_tg_ip6_address - IPv6 address from DUT1 to tg. Type: string
753 | | ... | - prefix4 - IPv4 prefix. Type: int
754 | | ... | - prefix6 - IPv6 prefix. Type: int
755 | | ...
756 | | ... | *Return:*
757 | | ... | - No value returned
758 | | ...
759 | | ... | *Example:*
760 | | ... | \| Lisp IPv6 over IPv4 forwarding initialized in a 3-node circular \
761 | | ... | topology \| ${dut1_dut2_ip4_address} \| ${dut1_tg_ip6_address} \
762 | | ... | \| ${dut2_dut1_ip4_address} \| ${dut2_tg_ip6_address} \
763 | | ... | \| ${prefix6} \| ${prefix4} \|
764 | | ...
765 | | [Arguments] | ${dut1_dut2_ip4_address} | ${dut1_tg_ip6_address}
766 | | ... | ${dut2_dut1_ip4_address} | ${dut2_tg_ip6_address}
767 | | ... | ${prefix6} | ${prefix4}
768 | | ...
769 | | Set interfaces in path up
770 | | VPP Interface Set IP Address
771 | | ... | ${dut1} | ${dut1_if1} | ${dut1_tg_ip6_address} | ${prefix6}
772 | | VPP Interface Set IP Address
773 | | ... | ${dut1} | ${dut1_if2} | ${dut1_dut2_ip4_address} | ${prefix4}
774 | | VPP Interface Set IP Address
775 | | ... | ${dut2} | ${dut2_if1} | ${dut2_dut1_ip4_address} | ${prefix4}
776 | | VPP Interface Set IP Address
777 | | ... | ${dut2} | ${dut2_if2} | ${dut2_tg_ip6_address} | ${prefix6}
778 | | Vpp All Ra Suppress Link Layer | ${nodes}
779 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | 2001:1::2 | ${tg_if1_mac}
780 | | VPP Add IP Neighbor | ${dut2} | ${dut2_if2} | 2001:2::2 | ${tg_if2_mac}
781 | | VPP Add IP Neighbor
782 | | ... | ${dut1} | ${dut1_if2} | ${dut2_dut1_ip4_address} | ${dut2_if1_mac}
783 | | VPP Add IP Neighbor
784 | | ... | ${dut2} | ${dut2_if1} | ${dut1_dut2_ip4_address} | ${dut1_if2_mac}
785
786 | Initialize NAT44 in circular topology
787 | | [Documentation] | Initialization of 2-node / 3-node topology with NAT44
788 | | ... | between DUTs:
789 | | ... | - set interfaces up
790 | | ... | - set IP addresses
791 | | ... | - set ARP
792 | | ... | - create routes
793 | | ... | - set NAT44 - only on DUT1
794 | | ...
795 | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error
796 | | ... | Variable Should Exist | ${dut2}
797 | | ...
798 | | Set interfaces in path up
799 | | ...
800 | | VPP Interface Set IP Address | ${dut1} | ${dut1_if1} | 10.0.0.1 | 20
801 | | Run Keyword If | '${dut2_status}' == 'PASS'
802 | | ... | VPP Interface Set IP Address | ${dut1} | ${dut1_if2}
803 | | ... | 11.0.0.1 | 20
804 | | Run Keyword If | '${dut2_status}' == 'PASS'
805 | | ... | VPP Interface Set IP Address | ${dut2} | ${dut2_if1}
806 | | ... | 11.0.0.2 | 20
807 | | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS'
808 | | ... | Set Variable | ${dut2}
809 | | ... | ELSE | Set Variable | ${dut1}
810 | | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS'
811 | | ... | Set Variable | ${dut2_if2}
812 | | ... | ELSE | Set Variable | ${dut1_if2}
813 | | VPP Interface Set IP Address | ${dut} | ${dut_if2} | 12.0.0.1 | 20
814 | | ...
815 | | VPP Add IP Neighbor | ${dut1} | ${dut1_if1} | 10.0.0.2 | ${tg_if1_mac}
816 | | Run Keyword If | '${dut2_status}' == 'PASS'
817 | | ... | VPP Add IP Neighbor
818 | | ... | ${dut1} | ${dut1_if2} | 11.0.0.2 | ${dut2_if1_mac}
819 | | Run Keyword If | '${dut2_status}' == 'PASS'
820 | | ... | VPP Add IP Neighbor
821 | | ... | ${dut2} | ${dut2_if1} | 11.0.0.1 | ${dut1_if2_mac}
822 | | VPP Add IP Neighbor | ${dut} | ${dut_if2} | 12.0.0.2 | ${tg_if2_mac}
823 | | ...
824 | | Vpp Route Add | ${dut1} | 20.0.0.0 | 18 | gateway=10.0.0.2
825 | | ... | interface=${dut1_if1}
826 | | Run Keyword If | '${dut2_status}' == 'PASS'
827 | | ... | Vpp Route Add | ${dut1} | 12.0.0.2 | 32 | gateway=11.0.0.2
828 | | ... | interface=${dut1_if2}
829 | | Run Keyword If | '${dut2_status}' == 'PASS'
830 | | ... | Vpp Route Add | ${dut2} | 12.0.0.0 | 24 | gateway=12.0.0.2
831 | | ... | interface=${dut2_if2}
832 | | Run Keyword If | '${dut2_status}' == 'PASS'
833 | | ... | Vpp Route Add | ${dut2} | 200.0.0.0 | 30 | gateway=11.0.0.1
834 | | ... | interface=${dut2_if1}
835 | | ...
836 | | Configure inside and outside interfaces
837 | | ... | ${dut1} | ${dut1_if1} | ${dut1_if2}
838 | | Configure deterministic mode for NAT44
839 | | ... | ${dut1} | 20.0.0.0 | 18 | 200.0.0.0 | 30
840
841 | Configure ACLs on a single interface
842 | | [Documentation]
843 | | ... | Configure ACL
844 | | ...
845 | | ... | *Arguments:*
846 | | ... | - dut - DUT node. Type: string
847 | | ... | - dut_if - DUT node interface name. Type: string
848 | | ... | - acl_apply_type - To what path apply the ACL - input or output.
849 | | ... | - acl_action - Action for the rule - deny, permit, permit+reflect.
850 | | ... | - subnets - Subnets to apply the specific ACL. Type: list
851 | | ...
852 | | ... | *Example:*
853 | | ...
854 | | ... | \| Configure ACLs on a single interface \| ${nodes['DUT1']}
855 | | ... | \| ... \| GigabitEthernet0/7/0 \| input \| permit | 0.0.0.0/0
856 | | ...
857 | | [Arguments] | ${dut} | ${dut_if} | ${acl_apply_type} | ${acl_action}
858 | | ... | @{subnets}
859 | | Set Test variable | ${acl} | ${EMPTY}
860 | | :FOR | ${subnet} | IN | @{subnets}
861 | | | ${acl} = | Run Keyword If | '${acl}' == '${EMPTY}'
862 | | | ... | Set Variable | ipv4 ${acl_action} src ${subnet}
863 | | | ... | ELSE
864 | | | ... | Catenate | SEPARATOR=", " | ${acl}
865 | | | ... | ipv4 ${acl_action} src ${subnet}
866 | | Add Replace Acl Multi Entries | ${dut} | rules=${acl}
867 | | @{acl_list} = | Create List | ${0}
868 | | Set Acl List For Interface | ${dut} | ${dut_if} | ${acl_apply_type}
869 | | ... | ${acl_list}