CSIT-393 ip4-ipsec-lispgpe-ip4 virt2lisp
[csit.git] / tests / func / lisp / ipsec_ipv4_lispgpe_ipv4.robot
1 # Copyright (c) 2016 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.topology.Topology
16 | Library | resources.libraries.python.NodePath
17 | Library | resources.libraries.python.Trace
18 | Library | resources.libraries.python.LispUtil
19 | Library | resources.libraries.python.VhostUser
20 | Library | resources.libraries.python.QemuUtils
21 | Library | resources.libraries.python.VPPUtil
22 | Library | resources.libraries.python.IPsecUtil
23 | Resource | resources/libraries/robot/traffic.robot
24 | Resource | resources/libraries/robot/default.robot
25 | Resource | resources/libraries/robot/interfaces.robot
26 | Resource | resources/libraries/robot/testing_path.robot
27 | Resource | resources/libraries/robot/vrf.robot
28 | Resource | resources/libraries/robot/ipsec.robot
29 | Resource | resources/libraries/robot/qemu.robot
30 | Resource | resources/libraries/robot/lisp/lispgpe.robot
31 | Resource | resources/libraries/robot/bridge_domain.robot
32 | Resource | resources/libraries/robot/lisp/l2lisp.robot
33 # Import configuration and test data:
34 | Variables | resources/test_data/lisp/ipv4_ipsec_lispgpe_ipv4/ipv4_ipsec_lispgpe_ipv4.py
35 | ...
36 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | VM_ENV | LISP
37 | ...
38 | Test Setup | Run Keywords | Setup all DUTs before test
39 | ...        | AND          | Setup all TGs before traffic script
40 | ...        | AND          | Update All Interface Data On All Nodes | ${nodes}
41 | Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
42 | ...           | AND          | Show vpp trace dump on all DUTs
43 | ...           | AND          | Show Vpp Settings | ${nodes['DUT1']}
44 | ...           | AND          | Show Vpp Settings | ${nodes['DUT2']}
45 | ...
46 | Documentation | *IPv4-ip4-ipsec-lispgpe-ip4 - main fib, vrf (gpe_vni-to-vrf)
47 | ...
48 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology\
49 | ... | with single links between nodes.
50 | ... | *[Enc] Packet Encapsulations:* ICMPv4-IPv4-IPSec-LISPGPE-IPv4-ICMPv4.
51 | ... | *[Cfg] DUT configuration:* Each DUT is configured with LISP and IPsec.\
52 | ... | IPsec is in transport mode. Tests cases are for IPsec configured both\
53 | ... | on RLOC interface or lisp_gpe0 interface.
54 | ... | *[Ver] TG verification:* Packet is send from TG(if1) across the DUT1 to\
55 | ... | DUT2 where it is forwarded to TG(if2).
56 | ... | *[Ref] Applicable standard specifications:* RFC6830, RFC4303.
57
58 *** Variables ***
59 | ${dut2_spi}= | ${1000}
60 | ${dut1_spi}= | ${1001}
61 | ${ESP_PROTO}= | ${50}
62 | ${sock1}= | /tmp/sock1
63 | ${sock2}= | /tmp/sock2
64 | ${bid}= | 10
65
66 *** Test Cases ***
67 | TC01: DUT1 and DUT2 route IPv4 bidirectionally over LISP GPE tunnel using IPsec (transport) on RLOC Int.
68 | | [Documentation]
69 | | ... | [Top] TG-DUT1-DUT2-TG.
70 | | ... | [Enc] Eth-IPv4-IPSec-LISPGPE-IPv4-ICMPv4 on DUT1-DUT2,\
71 | | ... | Eth-IPv4-ICMPv4 on TG-DUTn.
72 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2 with\
73 | | ... | IPsec in between DUTs.
74 | | ... | [Ver] Case: ip4-lispgpe-ipsec-ip4 - main fib
75 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across both\
76 | | ... | DUTs and LISP GPE tunnel between them; verify IPv4 headers on\
77 | | ... | received packets are correct.
78 | | ... | [Ref] RFC6830, RFC4303.
79 | | ...
80 | | ${encr_alg}= | Crypto Alg AES CBC 128
81 | | ${auth_alg}= | Integ Alg SHA1 96
82 | | Given Setup 3-node Topology
83 | | And Add IP Neighbors
84 | | And Set up LISP GPE topology
85 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
86 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
87 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
88 | | ... | ${dut1_to_dut2_ip4_static_adjacency}
89 | | ... | ${dut2_to_dut1_ip4_static_adjacency}
90 | | And IPsec Generate Keys | ${encr_alg} | ${auth_alg}
91 | | When VPP Setup IPsec Manual Keyed Connection
92 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${encr_alg} | ${encr_key}
93 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
94 | | ... | ${dut1_to_dut2_ip4} | ${dut2_to_dut1_ip4}
95 | | And VPP Setup IPsec Manual Keyed Connection
96 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${encr_alg} | ${encr_key}
97 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
98 | | ... | ${dut2_to_dut1_ip4} | ${dut1_to_dut2_ip4}
99 | | Then Send Packet And Check Headers
100 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
101 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
102 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
103 | | And Send Packet And Check Headers
104 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
105 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
106 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
107
108 | TC02: DUT1 and DUT2 route IPv4 bidirectionally over LISP GPE tunnel using IPsec (transport) lisp_gpe0 Int.
109 | | [Documentation]
110 | | ... | [Top] TG-DUT1-DUT2-TG.
111 | | ... | [Enc] Eth-IPv4-IPSec-LISPGPE-IPv4-ICMPv4 on DUT1-DUT2,\
112 | | ... | Eth-IPv4-ICMPv4 on TG-DUTn.
113 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2 with\
114 | | ... | IPsec in between DUTs.
115 | | ... | [Ver] Case: ip4-ipsec-lispgpe-ip4 - main fib
116 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across both\
117 | | ... | DUTs and LISP GPE tunnel between them; verify IPv4 headers on\
118 | | ... | received packets are correct.
119 | | ... | [Ref] RFC6830, RFC4303.
120 | | ...
121 | | ${encr_alg}= | Crypto Alg AES CBC 128
122 | | ${auth_alg}= | Integ Alg SHA1 96
123 | | Given Setup 3-node Topology
124 | | And Add IP Neighbors
125 | | And Set up LISP GPE topology
126 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
127 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
128 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
129 | | ... | ${dut1_to_dut2_ip4_static_adjacency}
130 | | ... | ${dut2_to_dut1_ip4_static_adjacency}
131 | | ${lisp_if_idx}= | resources.libraries.python.InterfaceUtil.Get sw if index
132 | | ... | ${dut1_node} | lisp_gpe0
133 | | And IPsec Generate Keys | ${encr_alg} | ${auth_alg}
134 | | When VPP Setup IPsec Manual Keyed Connection
135 | | ... | ${dut1_node} | ${lisp_if_idx} | ${encr_alg} | ${encr_key}
136 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi} | ${tg1_ip4}
137 | | ... | ${tg2_ip4}
138 | | And VPP Setup IPsec Manual Keyed Connection
139 | | ... | ${dut2_node} | ${lisp_if_idx} | ${encr_alg} | ${encr_key}
140 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi} | ${tg2_ip4}
141 | | ... | ${tg1_ip4}
142 | | Then Send Packet And Check Headers
143 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
144 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
145 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
146 | | And Send Packet And Check Headers
147 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
148 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
149 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
150
151 | TC03: DUT1 and DUT2 route IPv4 bidirectionally over LISP GPE tunnel using IPsec (transport) on RLOC Int and VRF on EID is enabled.
152 | | [Documentation]
153 | | ... | [Top] TG-DUT1-DUT2-TG.
154 | | ... | [Enc] Eth-IPv4-IPSec-LISPGPE-IPv4-ICMPv4 on DUT1-DUT2,\
155 | | ... | Eth-IPv4-ICMPv4 on TG-DUTn.
156 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2 with\
157 | | ... | IPsec in between DUTs.
158 | | ... | [Ver] Case: ip4-lispgpe-ipsec-ip4 - vrf, main fib
159 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across both\
160 | | ... | DUTs and LISP GPE tunnel between them; verify IPv4 headers on\
161 | | ... | received packets are correct.
162 | | ... | [Ref] RFC6830, RFC4303.
163 | | ...
164 | | ${encr_alg}= | Crypto Alg AES CBC 128
165 | | ${auth_alg}= | Integ Alg SHA1 96
166 | | Given Setup 3-node Topology | ${fib_table_1}
167 | | And Add IP Neighbors | ${fib_table_1}
168 | | When IPsec Generate Keys | ${encr_alg} | ${auth_alg}
169 | | And Set up LISP GPE topology
170 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
171 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
172 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
173 | | ... | ${dut1_to_dut2_ip4_static_adjacency}
174 | | ... | ${dut2_to_dut1_ip4_static_adjacency}
175 | | ... | ${dut1_dut2_vni} | ${fib_table_1}
176 | | And VPP Setup IPsec Manual Keyed Connection
177 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${encr_alg} | ${encr_key}
178 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
179 | | ... | ${dut1_to_dut2_ip4} | ${dut2_to_dut1_ip4}
180 | | And VPP Setup IPsec Manual Keyed Connection
181 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${encr_alg} | ${encr_key}
182 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
183 | | ... | ${dut2_to_dut1_ip4} | ${dut1_to_dut2_ip4}
184 | | Then Send Packet And Check Headers
185 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
186 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
187 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
188 | | And Send Packet And Check Headers
189 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
190 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
191 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
192
193 | TC04: DUT1 and DUT2 route IPv4 bidirectionally over LISP GPE tunnel using IPsec (transport) on lisp_gpe0 Int and VRF is enabled.
194 | | [Documentation]
195 | | ... | [Top] TG-DUT1-DUT2-TG.
196 | | ... | [Enc] Eth-IPv4-IPSec-LISPGPE-IPv4-ICMPv4 on DUT1-DUT2,\
197 | | ... | Eth-IPv4-ICMPv4 on TG-DUTn.
198 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2 with\
199 | | ... | IPsec in between DUTs.
200 | | ... | [Ver] Case: ip4-ipsec-lispgpe-ip4 - vrf, main fib
201 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across both\
202 | | ... | DUTs and LISP GPE tunnel between them; verify IPv4 headers on\
203 | | ... | received packets are correct.
204 | | ... | [Ref] RFC6830, RFC4303.
205 | | ...
206 | | ${encr_alg}= | Crypto Alg AES CBC 128
207 | | ${auth_alg}= | Integ Alg SHA1 96
208 | | Given Setup 3-node Topology | ${fib_table_1}
209 | | And Add IP Neighbors | ${fib_table_1}
210 | | And Set up LISP GPE topology
211 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
212 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
213 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
214 | | ... | ${dut1_to_dut2_ip4_static_adjacency}
215 | | ... | ${dut2_to_dut1_ip4_static_adjacency}
216 | | ... | ${dut1_dut2_vni} | ${fib_table_1}
217 | | When IPsec Generate Keys | ${encr_alg} | ${auth_alg}
218 | | ${lisp_if_idx}= | resources.libraries.python.InterfaceUtil.Get sw if index
219 | | ... | ${dut1_node} | lisp_gpe0
220 | | And VPP Setup IPsec Manual Keyed Connection
221 | | ... | ${dut1_node} | ${lisp_if_idx} | ${encr_alg} | ${encr_key}
222 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi} | ${tg1_ip4}
223 | | ... | ${tg2_ip4}
224 | | And VPP Setup IPsec Manual Keyed Connection
225 | | ... | ${dut2_node} | ${lisp_if_idx} | ${encr_alg} | ${encr_key}
226 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi} | ${tg2_ip4}
227 | | ... | ${tg1_ip4}
228 | | Then Send Packet And Check Headers
229 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
230 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
231 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
232 | | And Send Packet And Check Headers
233 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
234 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
235 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
236
237 | TC05: DUT1 and DUT2 route IPv4 over Vhost to LISP GPE tunnel using IPsec (transport) on RLOC Int.
238 | | [Documentation]
239 | | ... | [Top] TG-DUT1-DUT2-TG.
240 | | ... | [Enc] Eth-IPv4-IPSec-LISPGPE-IPv4-ICMP on DUT1-DUT2, Eth-IPv4-ICMP\
241 | | ... | on TG-DUTn.
242 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2 with\
243 | | ... | IPsec in between DUTS. Create Qemu vm on DUT1 and configure bridge\
244 | | ... | between two vhosts.
245 | | ... | [Ver] Case: ip4-ipsec-lispgpe-ip4 - main fib, virt2lisp\
246 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across\
247 | | ... | both DUTs and LISP GPE tunnel between them; verify IPv4 headers on\
248 | | ... | received packets are correct.
249 | | ... | [Ref] RFC6830, RFC4303.
250 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
251 | | ...           | AND       | Show vpp trace dump on all DUTs
252 | | ...           | AND       | Stop and Clear QEMU | ${dut1_node} | ${vm_node}
253 | | ...           | AND       | Show VPP Settings | ${dut1_node}
254 | | ...           | AND       | Show VPP Settings | ${dut2_node}
255 | | ...
256 | | ${encr_alg}= | Crypto Alg AES CBC 128
257 | | ${auth_alg}= | Integ Alg SHA1 96
258 | | Given Setup 3-node Topology
259 | | And Add IP Neighbors
260 | | And Setup Qemu DUT1
261 | | And Set up LISP GPE topology
262 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
263 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
264 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
265 | | ... | ${dut1_to_dut2_ip4_static_adjacency}
266 | | ... | ${dut2_to_dut1_ip4_static_adjacency}
267 | | And IPsec Generate Keys | ${encr_alg} | ${auth_alg}
268 | | When VPP Setup IPsec Manual Keyed Connection
269 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${encr_alg} | ${encr_key}
270 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
271 | | ... | ${dut1_to_dut2_ip4} | ${dut2_to_dut1_ip4}
272 | | And VPP Setup IPsec Manual Keyed Connection
273 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${encr_alg} | ${encr_key}
274 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
275 | | ... | ${dut2_to_dut1_ip4} | ${dut1_to_dut2_ip4}
276 | | Then Send Packet And Check Headers
277 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
278 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dst_vhost_mac}
279 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
280 | | And Send Packet And Check Headers
281 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
282 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
283 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
284
285 | TC06: DUT1 and DUT2 route IPv4 over Vhost to LISP GPE tunnel using IPsec (transport) on lisp_gpe0 Int.
286 | | [Documentation]
287 | | ... | [Top] TG-DUT1-DUT2-TG.
288 | | ... | [Enc] Eth-IPv4-IPSec-LISPGPE-IPv4-ICMPv4 on DUT1-DUT2,\
289 | | ... | Eth-IPv4-ICMPv4 on TG-DUTn.
290 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2 with\
291 | | ... | IPsec in between DUTS.
292 | | ... | [Ver] Case: ip4-ipsec-lispgpe-ip4 - main fib, virt2lisp\
293 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across\
294 | | ... | both DUTs and LISP GPE tunnel between them; verify IPv4 headers on\
295 | | ... | received packets are correct.
296 | | ... | [Ref] RFC6830, RFC4303.
297 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
298 | | ...           | AND       | Show vpp trace dump on all DUTs
299 | | ...           | AND       | Stop and Clear QEMU | ${dut1_node} | ${vm_node}
300 | | ...           | AND       | Show VPP Settings | ${dut1_node}
301 | | ...           | AND       | Show VPP Settings | ${dut2_node}
302 | | ...
303 | | ${encr_alg}= | Crypto Alg AES CBC 128
304 | | ${auth_alg}= | Integ Alg SHA1 96
305 | | Given Setup 3-node Topology
306 | | And Add IP Neighbors
307 | | And Setup Qemu DUT1
308 | | And Set up LISP GPE topology
309 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
310 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
311 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
312 | | ... | ${dut1_to_dut2_ip4_static_adjacency}
313 | | ... | ${dut2_to_dut1_ip4_static_adjacency}
314 | | ${lisp1_if_idx}= | resources.libraries.python.InterfaceUtil.Get Sw If Index
315 | | ... | ${dut1_node} | lisp_gpe0
316 | | ${lisp2_if_idx}= | resources.libraries.python.InterfaceUtil.Get Sw If Index
317 | | ... | ${dut2_node} | lisp_gpe0
318 | | And IPsec Generate Keys | ${encr_alg} | ${auth_alg}
319 | | When VPP Setup IPsec Manual Keyed Connection
320 | | ... | ${dut1_node} | ${lisp1_if_idx} | ${encr_alg} | ${encr_key}
321 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
322 | | ... | ${dut1_to_dut2_ip4} | ${dut2_to_dut1_ip4}
323 | | And VPP Setup IPsec Manual Keyed Connection
324 | | ... | ${dut2_node} | ${lisp2_if_idx} | ${encr_alg} | ${encr_key}
325 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
326 | | ... | ${dut2_to_dut1_ip4} | ${dut1_to_dut2_ip4}
327 | | Then Send Packet And Check Headers
328 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
329 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dst_vhost_mac}
330 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
331 | | And Send Packet And Check Headers
332 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
333 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
334 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
335
336 *** Keywords ***
337 | Setup 3-node Topology
338 | | [Documentation]
339 | | ... | Setup 3-node topology for this test suite. Set all physical\
340 | | ... | interfaces up and assing IP adresses to them.\
341 | | ... | You can specify fib table ID where the DUT-TG interfaces assign to.\
342 | | ... | Default is 0.
343 | | ...
344 | | [Arguments] | ${fib_table}=0
345 | | Path for 3-node testing is set
346 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
347 | | Interfaces in 3-node path are up
348 | | Assign Interface To Fib Table | ${dut1_node}
349 | | ... | ${dut1_to_tg} | ${fib_table}
350 | | Assign Interface To Fib Table | ${dut2_node}
351 | | ... | ${dut2_to_tg} | ${fib_table}
352 | | Set Interface Address | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip4}
353 | | ... | ${prefix4}
354 | | Set Interface Address | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip4}
355 | | ... | ${prefix4}
356 | | Set Interface Address | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip4}
357 | | ... | ${prefix4}
358 | | Set Interface Address | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip4}
359 | | ... | ${prefix4}
360
361 | Add IP Neighbors
362 | | [Documentation]
363 | | ... | Add IP neighbors to physical interfaces on DUTs.\
364 | | ... | You can specify fib table ID for DUT-TG interfaces. Default is 0.
365 | | ...
366 | | [Arguments] | ${fib_id}=0
367 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip4}
368 | | ... | ${tg_to_dut1_mac} | ${fib_id}
369 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip4}
370 | | ... | ${tg_to_dut2_mac} | ${fib_id}
371 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip4}
372 | | ... | ${dut2_to_dut1_mac}
373 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip4}
374 | | ... | ${dut1_to_dut2_mac}
375
376 | Setup Qemu DUT1
377 | | [Documentation] | Setup Vhosts on DUT1 and setup IP to one of them. Setup \
378 | | ... | Qemu and bridge the vhosts.
379 | | ${vhost1}= | And Vpp Create Vhost User Interface | ${dut1_node} | ${sock1}
380 | | ${vhost2}= | And Vpp Create Vhost User Interface | ${dut1_node} | ${sock2}
381 | | Set Interface Address | ${dut1_node} | ${vhost2} | 6.6.1.9
382 | | ... | ${prefix4}
383 | | Set Interface State | ${dut1_node} | ${vhost1} | up
384 | | Set Interface State | ${dut1_node} | ${vhost2} | up
385 | | Bridge domain on DUT node is created | ${dut1_node} | ${bid} | learn=${TRUE}
386 | | Interface is added to bridge domain | ${dut1_node}
387 | | ... | ${dut1_to_tg} | ${bid} | 0
388 | | Interface is added to bridge domain | ${dut1_node}
389 | | ... | ${vhost1} | ${bid} | 0
390 | | ${vhost_mac}= | Get Vhost User Mac By SW Index | ${dut1_node} | ${vhost2}
391 | | Set test variable | ${dst_vhost_mac} | ${vhost_mac}
392 | | VM for Vhost L2BD forwarding is setup | ${dut1_node} | ${sock1} | ${sock2}