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