CSIT-28: IPSEC basic conectivity test - IPv4
[csit.git] / tests / func / ipsec / ipsec_tunnel_mode_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 | Resource | resources/libraries/robot/ipsec.robot
16 | Library | resources.libraries.python.Trace
17 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | 3_NODE_DOUBLE_LINK_TOPO
18 | ...        | VM_ENV | HW_ENV
19 | Test Setup | Run Keywords | Setup all DUTs before test
20 | ...        | AND          | Setup all TGs before traffic script
21 | ...        | AND          | Setup Topology for IPv4 IPsec testing
22 | Test Teardown | Run Keywords | VPP IPsec Show | ${dut_node}
23 | ...           | AND          | Show Packet Trace on All DUTs | ${nodes}
24 | ...           | AND          | Show vpp trace dump on all DUTs
25 | Documentation | *IPv4 IPsec tunnel mode test suite.*
26 | ...
27 | ... | *[Top] Network topologies:* TG-DUT1 2-node topology with one link\
28 | ... | between nodes.
29 | ... | *[Cfg] DUT configuration:* On DUT1 create loopback interface, configure\
30 | ... | loopback an physical interface IPv4 addresses, static ARP record, route\
31 | ... | and IPsec manual keyed connection in tunnel mode.
32 | ... | *[Ver] TG verification:* ESP packet is sent from TG to DUT1. ESP packet\
33 | ... | is received on TG from DUT1.
34 | ... | *[Ref] Applicable standard specifications:* RFC4303.
35
36 *** Variables ***
37 | ${tg_spi}= | ${1000}
38 | ${dut_spi}= | ${1001}
39 | ${ESP_PROTO}= | ${50}
40 | ${tg_if_ip4}= | 192.168.100.2
41 | ${dut_if_ip4}= | 192.168.100.3
42 | ${tg_lo_ip4}= | 192.168.3.3
43 | ${dut_lo_ip4}= | 192.168.4.4
44 | ${ip4_plen}= | ${24}
45
46 *** Test Cases ***
47 | TC01: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA1-96 integrity
48 | | [Documentation]
49 | | ... | [Top] TG-DUT1.
50 | | ... | [Ref] RFC4303.
51 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
52 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel mode.
53 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
54 | | ${encr_alg}= | Crypto Alg AES CBC 128
55 | | ${auth_alg}= | Integ Alg SHA1 96
56 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
57 | | When VPP Setup IPsec Manual Keyed Connection
58 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
59 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
60 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
61 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
62 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
63 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
64 | | ... | ${dut_tun_ip}
65
66 | TC02: VPP process ESP packet in Tunnel Mode with AES-CBC-192 encryption and SHA1-96 integrity
67 | | [Documentation]
68 | | ... | [Top] TG-DUT1.
69 | | ... | [Ref] RFC4303.
70 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
71 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA1-96 in tunnel mode.
72 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
73 | | [Tags] | SKIP_PATCH
74 | | ${encr_alg}= | Crypto Alg AES CBC 192
75 | | ${auth_alg}= | Integ Alg SHA1 96
76 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
77 | | When VPP Setup IPsec Manual Keyed Connection
78 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
79 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
80 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
81 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
82 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
83 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
84 | | ... | ${dut_tun_ip}
85
86 | TC03: VPP process ESP packet in Tunnel Mode with AES-CBC-256 encryption and SHA1-96 integrity
87 | | [Documentation]
88 | | ... | [Top] TG-DUT1.
89 | | ... | [Ref] RFC4303.
90 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
91 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA1-96 in tunnel mode.
92 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
93 | | [Tags] | SKIP_PATCH
94 | | ${encr_alg}= | Crypto Alg AES CBC 256
95 | | ${auth_alg}= | Integ Alg SHA1 96
96 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
97 | | When VPP Setup IPsec Manual Keyed Connection
98 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
99 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
100 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
101 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
102 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
103 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
104 | | ... | ${dut_tun_ip}
105
106 | TC04: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA-256-128 integrity
107 | | [Documentation]
108 | | ... | [Top] TG-DUT1.
109 | | ... | [Ref] RFC4303.
110 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
111 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-256-128 in tunnel
112 | | ... | mode.
113 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
114 | | [Tags] | SKIP_PATCH
115 | | ${encr_alg}= | Crypto Alg AES CBC 128
116 | | ${auth_alg}= | Integ Alg SHA 256 128
117 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
118 | | When VPP Setup IPsec Manual Keyed Connection
119 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
120 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
121 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
122 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
123 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
124 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
125 | | ... | ${dut_tun_ip}
126
127 | TC05: VPP process ESP packet in Tunnel Mode with AES-CBC-192 encryption and SHA-256-128 integrity
128 | | [Documentation]
129 | | ... | [Top] TG-DUT1.
130 | | ... | [Ref] RFC4303.
131 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
132 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-256-128 in tunnel
133 | | ... | mode.
134 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
135 | | ${encr_alg}= | Crypto Alg AES CBC 192
136 | | ${auth_alg}= | Integ Alg SHA 256 128
137 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
138 | | When VPP Setup IPsec Manual Keyed Connection
139 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
140 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
141 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
142 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
143 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
144 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
145 | | ... | ${dut_tun_ip}
146
147 | TC06: VPP process ESP packet in Tunnel Mode with AES-CBC-256 encryption and SHA-256-128 integrity
148 | | [Documentation]
149 | | ... | [Top] TG-DUT1.
150 | | ... | [Ref] RFC4303.
151 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
152 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-256-128 in tunnel
153 | | ... | mode.
154 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
155 | | [Tags] | SKIP_PATCH
156 | | ${encr_alg}= | Crypto Alg AES CBC 256
157 | | ${auth_alg}= | Integ Alg SHA 256 128
158 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
159 | | When VPP Setup IPsec Manual Keyed Connection
160 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
161 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
162 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
163 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
164 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
165 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
166 | | ... | ${dut_tun_ip}
167
168 | TC07: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA-384-192 integrity
169 | | [Documentation]
170 | | ... | [Top] TG-DUT1.
171 | | ... | [Ref] RFC4303.
172 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
173 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-384-192 in tunnel
174 | | ... | mode.
175 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
176 | | [Tags] | SKIP_PATCH
177 | | ${encr_alg}= | Crypto Alg AES CBC 128
178 | | ${auth_alg}= | Integ Alg SHA 384 192
179 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
180 | | When VPP Setup IPsec Manual Keyed Connection
181 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
182 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
183 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
184 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
185 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
186 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
187 | | ... | ${dut_tun_ip}
188
189 | TC08: VPP process ESP packet in Tunnel Mode with AES-CBC-192 encryption and SHA-384-192 integrity
190 | | [Documentation]
191 | | ... | [Top] TG-DUT1.
192 | | ... | [Ref] RFC4303.
193 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
194 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-384-192 in tunnel
195 | | ... | mode.
196 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
197 | | [Tags] | SKIP_PATCH
198 | | ${encr_alg}= | Crypto Alg AES CBC 192
199 | | ${auth_alg}= | Integ Alg SHA 384 192
200 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
201 | | When VPP Setup IPsec Manual Keyed Connection
202 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
203 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
204 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
205 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
206 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
207 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
208 | | ... | ${dut_tun_ip}
209
210 | TC09: VPP process ESP packet in Tunnel Mode with AES-CBC-256 encryption and SHA-384-192 integrity
211 | | [Documentation]
212 | | ... | [Top] TG-DUT1.
213 | | ... | [Ref] RFC4303.
214 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
215 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-384-192 in tunnel
216 | | ... | mode.
217 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
218 | | ${encr_alg}= | Crypto Alg AES CBC 256
219 | | ${auth_alg}= | Integ Alg SHA 384 192
220 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
221 | | When VPP Setup IPsec Manual Keyed Connection
222 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
223 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
224 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
225 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
226 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
227 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
228 | | ... | ${dut_tun_ip}
229
230 | TC10: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA-512-256 integrity
231 | | [Documentation]
232 | | ... | [Top] TG-DUT1.
233 | | ... | [Ref] RFC4303.
234 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
235 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-512-256 in tunnel
236 | | ... | mode.
237 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
238 | | [Tags] | SKIP_PATCH
239 | | ${encr_alg}= | Crypto Alg AES CBC 128
240 | | ${auth_alg}= | Integ Alg SHA 512 256
241 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
242 | | When VPP Setup IPsec Manual Keyed Connection
243 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
244 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
245 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
246 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
247 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
248 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
249 | | ... | ${dut_tun_ip}
250
251 | TC11: VPP process ESP packet in Tunnel Mode with AES-CBC-192 encryption and SHA-512-256 integrity
252 | | [Documentation]
253 | | ... | [Top] TG-DUT1.
254 | | ... | [Ref] RFC4303.
255 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
256 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-512-256 in tunnel
257 | | ... | mode.
258 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
259 | | [Tags] | SKIP_PATCH
260 | | ${encr_alg}= | Crypto Alg AES CBC 192
261 | | ${auth_alg}= | Integ Alg SHA 512 256
262 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
263 | | When VPP Setup IPsec Manual Keyed Connection
264 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
265 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
266 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
267 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
268 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
269 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
270 | | ... | ${dut_tun_ip}
271
272 | TC12: VPP process ESP packet in Tunnel Mode with AES-CBC-256 encryption and SHA-512-256 integrity
273 | | [Documentation]
274 | | ... | [Top] TG-DUT1.
275 | | ... | [Ref] RFC4303.
276 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
277 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-512-256 in tunnel
278 | | ... | mode.
279 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
280 | | ${encr_alg}= | Crypto Alg AES CBC 256
281 | | ${auth_alg}= | Integ Alg SHA 512 256
282 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
283 | | When VPP Setup IPsec Manual Keyed Connection
284 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
285 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
286 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
287 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
288 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
289 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
290 | | ... | ${dut_tun_ip}