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