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