CSIT-509: Add perf tests for vlan + l2 + vhost
[csit.git] / tests / func / lisp / eth2p-ethip4ipsectptlispgpe-ip4base-func.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 | Func Test Setup
39 | Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
40 | ... | AND | Show vpp trace dump on all DUTs
41 | ... | AND | Show Vpp Settings | ${nodes['DUT1']}
42 | ... | AND | Show Vpp Settings | ${nodes['DUT2']}
43 | ... | AND | Check VPP PID in Teardown
44 | ...
45 | Documentation | *IPv4-ip4-ipsec-lispgpe-ip4 - main fib, vrf (gpe_vni-to-vrf)*
46 | ...
47 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology\
48 | ... | with single links between nodes.
49 | ... | *[Enc] Packet Encapsulations:* ICMPv4-IPv4-IPSec-LISPGPE-IPv4-ICMPv4.
50 | ... | *[Cfg] DUT configuration:* Each DUT is configured with LISP and IPsec.\
51 | ... | IPsec is in transport mode. Tests cases are for IPsec configured both\
52 | ... | on RLOC interface or lisp_gpe0 interface.
53 | ... | *[Ver] TG verification:* Packet is send from TG(if1) across the DUT1 to\
54 | ... | DUT2 where it is forwarded to TG(if2).
55 | ... | *[Ref] Applicable standard specifications:* RFC6830, RFC4303.
56
57 *** Variables ***
58 | ${dut2_spi}= | ${1000}
59 | ${dut1_spi}= | ${1001}
60
61 | ${ESP_PROTO}= | ${50}
62
63 | ${bid}= | 10
64
65 *** Test Cases ***
66 | TC01: DUT1 and DUT2 route IPv4 bidirectionally over LISP GPE tunnel using IPsec (transport) on RLOC Int.
67 | | [Documentation]
68 | | ... | [Top] TG-DUT1-DUT2-TG.
69 | | ... | [Enc] Eth-IPv4-IPSec-LISPGPE-IPv4-ICMPv4 on DUT1-DUT2,\
70 | | ... | Eth-IPv4-ICMPv4 on TG-DUTn.
71 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2 with\
72 | | ... | IPsec in between DUTs.
73 | | ... | [Ver] Case: ip4-lispgpe-ipsec-ip4 - main fib
74 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across both\
75 | | ... | DUTs and LISP GPE tunnel between them; verify IPv4 headers on\
76 | | ... | received packets are correct.
77 | | ... | [Ref] RFC6830, RFC4303.
78 | | ...
79 | | ${encr_alg}= | Crypto Alg AES CBC 128
80 | | ${auth_alg}= | Integ Alg SHA1 96
81 | | Given Setup 3-node Topology
82 | | And Add IP Neighbors
83 | | And Set up LISP GPE topology
84 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
85 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
86 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
87 | | ... | ${dut1_to_dut2_ip4_static_adjacency}
88 | | ... | ${dut2_to_dut1_ip4_static_adjacency}
89 | | And IPsec Generate Keys | ${encr_alg} | ${auth_alg}
90 | | When VPP Setup IPsec Manual Keyed Connection
91 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${encr_alg} | ${encr_key}
92 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
93 | | ... | ${dut1_to_dut2_ip4} | ${dut2_to_dut1_ip4}
94 | | And VPP Setup IPsec Manual Keyed Connection
95 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${encr_alg} | ${encr_key}
96 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
97 | | ... | ${dut2_to_dut1_ip4} | ${dut1_to_dut2_ip4}
98 | | Then Send Packet And Check Headers
99 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
100 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
101 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
102 | | And Send Packet And Check Headers
103 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
104 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
105 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
106
107 | TC02: DUT1 and DUT2 route IPv4 bidirectionally over LISP GPE tunnel using IPsec (transport) lisp_gpe0 Int.
108 | | [Documentation]
109 | | ... | [Top] TG-DUT1-DUT2-TG.
110 | | ... | [Enc] Eth-IPv4-IPSec-LISPGPE-IPv4-ICMPv4 on DUT1-DUT2,\
111 | | ... | Eth-IPv4-ICMPv4 on TG-DUTn.
112 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2 with\
113 | | ... | IPsec in between DUTs.
114 | | ... | [Ver] Case: ip4-ipsec-lispgpe-ip4 - main fib
115 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across both\
116 | | ... | DUTs and LISP GPE tunnel between them; verify IPv4 headers on\
117 | | ... | received packets are correct.
118 | | ... | [Ref] RFC6830, RFC4303.
119 | | ...
120 | | ${encr_alg}= | Crypto Alg AES CBC 128
121 | | ${auth_alg}= | Integ Alg SHA1 96
122 | | Given Setup 3-node Topology
123 | | And Add IP Neighbors
124 | | And Set up LISP GPE topology
125 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
126 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
127 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
128 | | ... | ${dut1_to_dut2_ip4_static_adjacency}
129 | | ... | ${dut2_to_dut1_ip4_static_adjacency}
130 | | ${lisp_if_idx}= | resources.libraries.python.InterfaceUtil.Get sw if index
131 | | ... | ${dut1_node} | lisp_gpe0
132 | | And IPsec Generate Keys | ${encr_alg} | ${auth_alg}
133 | | When VPP Setup IPsec Manual Keyed Connection
134 | | ... | ${dut1_node} | ${lisp_if_idx} | ${encr_alg} | ${encr_key}
135 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi} | ${tg1_ip4}
136 | | ... | ${tg2_ip4}
137 | | And VPP Setup IPsec Manual Keyed Connection
138 | | ... | ${dut2_node} | ${lisp_if_idx} | ${encr_alg} | ${encr_key}
139 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi} | ${tg2_ip4}
140 | | ... | ${tg1_ip4}
141 | | Then Send Packet And Check Headers
142 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
143 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
144 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
145 | | And Send Packet And Check Headers
146 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
147 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
148 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
149
150 | TC03: DUT1 and DUT2 route IPv4 bidirectionally over LISP GPE tunnel using IPsec (transport) on RLOC Int and VRF on EID is enabled.
151 | | [Documentation]
152 | | ... | [Top] TG-DUT1-DUT2-TG.
153 | | ... | [Enc] Eth-IPv4-IPSec-LISPGPE-IPv4-ICMPv4 on DUT1-DUT2,\
154 | | ... | Eth-IPv4-ICMPv4 on TG-DUTn.
155 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2 with\
156 | | ... | IPsec in between DUTs.
157 | | ... | [Ver] Case: ip4-lispgpe-ipsec-ip4 - vrf, main fib
158 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across both\
159 | | ... | DUTs and LISP GPE tunnel between them; verify IPv4 headers on\
160 | | ... | received packets are correct.
161 | | ... | [Ref] RFC6830, RFC4303.
162 | | ...
163 | | ${encr_alg}= | Crypto Alg AES CBC 128
164 | | ${auth_alg}= | Integ Alg SHA1 96
165 | | Given Setup 3-node Topology | ${fib_table_1}
166 | | And Add IP Neighbors | ${fib_table_1}
167 | | When IPsec Generate Keys | ${encr_alg} | ${auth_alg}
168 | | And Set up LISP GPE topology
169 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
170 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
171 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
172 | | ... | ${dut1_to_dut2_ip4_static_adjacency}
173 | | ... | ${dut2_to_dut1_ip4_static_adjacency}
174 | | ... | ${dut1_dut2_vni} | ${fib_table_1}
175 | | And VPP Setup IPsec Manual Keyed Connection
176 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${encr_alg} | ${encr_key}
177 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi}
178 | | ... | ${dut1_to_dut2_ip4} | ${dut2_to_dut1_ip4}
179 | | And VPP Setup IPsec Manual Keyed Connection
180 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${encr_alg} | ${encr_key}
181 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi}
182 | | ... | ${dut2_to_dut1_ip4} | ${dut1_to_dut2_ip4}
183 | | Then Send Packet And Check Headers
184 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
185 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
186 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
187 | | And Send Packet And Check Headers
188 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
189 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
190 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
191
192 | TC04: DUT1 and DUT2 route IPv4 bidirectionally over LISP GPE tunnel using IPsec (transport) on lisp_gpe0 Int and VRF is enabled.
193 | | [Documentation]
194 | | ... | [Top] TG-DUT1-DUT2-TG.
195 | | ... | [Enc] Eth-IPv4-IPSec-LISPGPE-IPv4-ICMPv4 on DUT1-DUT2,\
196 | | ... | Eth-IPv4-ICMPv4 on TG-DUTn.
197 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2 with\
198 | | ... | IPsec in between DUTs.
199 | | ... | [Ver] Case: ip4-ipsec-lispgpe-ip4 - vrf, main fib
200 | | ... | Make TG send ICMPv4 Echo Req between its interfaces across both\
201 | | ... | DUTs and LISP GPE tunnel between them; verify IPv4 headers on\
202 | | ... | received packets are correct.
203 | | ... | [Ref] RFC6830, RFC4303.
204 | | ...
205 | | ${encr_alg}= | Crypto Alg AES CBC 128
206 | | ${auth_alg}= | Integ Alg SHA1 96
207 | | Given Setup 3-node Topology | ${fib_table_1}
208 | | And Add IP Neighbors | ${fib_table_1}
209 | | And Set up LISP GPE topology
210 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
211 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
212 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
213 | | ... | ${dut1_to_dut2_ip4_static_adjacency}
214 | | ... | ${dut2_to_dut1_ip4_static_adjacency}
215 | | ... | ${dut1_dut2_vni} | ${fib_table_1}
216 | | When IPsec Generate Keys | ${encr_alg} | ${auth_alg}
217 | | ${lisp_if_idx}= | resources.libraries.python.InterfaceUtil.Get sw if index
218 | | ... | ${dut1_node} | lisp_gpe0
219 | | And VPP Setup IPsec Manual Keyed Connection
220 | | ... | ${dut1_node} | ${lisp_if_idx} | ${encr_alg} | ${encr_key}
221 | | ... | ${auth_alg} | ${auth_key} | ${dut1_spi} | ${dut2_spi} | ${tg1_ip4}
222 | | ... | ${tg2_ip4}
223 | | And VPP Setup IPsec Manual Keyed Connection
224 | | ... | ${dut2_node} | ${lisp_if_idx} | ${encr_alg} | ${encr_key}
225 | | ... | ${auth_alg} | ${auth_key} | ${dut2_spi} | ${dut1_spi} | ${tg2_ip4}
226 | | ... | ${tg1_ip4}
227 | | Then Send Packet And Check Headers
228 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
229 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
230 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
231 | | And Send Packet And Check Headers
232 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
233 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
234 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
235
236 *** Keywords ***
237 | Setup 3-node Topology
238 | | [Documentation]
239 | | ... | Setup 3-node topology for this test suite. Set all physical\
240 | | ... | interfaces up and assing IP adresses to them.\
241 | | ... | You can specify fib table ID where the DUT-TG interfaces assign to.\
242 | | ... | Default is 0.
243 | | ...
244 | | [Arguments] | ${fib_table}=0
245 | | Path for 3-node testing is set
246 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
247 | | Interfaces in 3-node path are up
248 | | Assign Interface To Fib Table | ${dut1_node}
249 | | ... | ${dut1_to_tg} | ${fib_table}
250 | | Assign Interface To Fib Table | ${dut2_node}
251 | | ... | ${dut2_to_tg} | ${fib_table}
252 | | Set Interface Address | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip4}
253 | | ... | ${prefix4}
254 | | Set Interface Address | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip4}
255 | | ... | ${prefix4}
256 | | Set Interface Address | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip4}
257 | | ... | ${prefix4}
258 | | Set Interface Address | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip4}
259 | | ... | ${prefix4}
260
261 | Add IP Neighbors
262 | | [Documentation]
263 | | ... | Add IP neighbors to physical interfaces on DUTs.\
264 | | ... | You can specify fib table ID for DUT-TG interfaces. Default is 0.
265 | | ...
266 | | [Arguments] | ${fib_id}=0
267 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip4}
268 | | ... | ${tg_to_dut1_mac} | ${fib_id}
269 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip4}
270 | | ... | ${tg_to_dut2_mac} | ${fib_id}
271 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip4}
272 | | ... | ${dut2_to_dut1_mac}
273 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip4}
274 | | ... | ${dut1_to_dut2_mac}