7f6207e3db42d03c612a60d00dd29b80f917679c
[csit.git] / tests / vpp / func / crypto / sw_device / eth2p-ethip4ipsectnlsw-ip4base-func.robot
1 # Copyright (c) 2017 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/crypto/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 | IPSEC | IPSEC_SW
19 | ...
20 | Test Setup | Set up IPSec SW device functional test | IPv4
21 | ...
22 | Test Teardown | Tear down IPSec SW device functional test
23 | ...
24 | Documentation | *IPv4 SW cryptodev IPsec tunnel mode test suite.*
25 | ...
26 | ... | *[Top] Network topologies:* TG-DUT1 2-node topology with one link\
27 | ... | between nodes.
28 | ... | *[Cfg] DUT configuration:* With enabled SW crytodev on DUT1 create\
29 | ... | loopback interface, configure loopback and physical interface IPv4\
30 | ... | addresses, static ARP record, route and IPsec manual keyed connection\
31 | ... | 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 | | ...
55 | | ${encr_alg}= | Crypto Alg AES CBC 128
56 | | ${auth_alg}= | Integ Alg SHA1 96
57 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
58 | | When Configure manual keyed connection for IPSec
59 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
60 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
61 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
62 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
63 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
64 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
65 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
66 | | ... | ${dut_tun_ip}
67
68 | TC02: VPP process ESP packet in Tunnel Mode with AES-CBC-192 encryption and SHA1-96 integrity
69 | | [Documentation]
70 | | ... | [Top] TG-DUT1.
71 | | ... | [Ref] RFC4303.
72 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
73 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA1-96 in tunnel mode.
74 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
75 | | ...
76 | | [Tags] | SKIP_PATCH
77 | | ...
78 | | ${encr_alg}= | Crypto Alg AES CBC 192
79 | | ${auth_alg}= | Integ Alg SHA1 96
80 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
81 | | When Configure manual keyed connection for IPSec
82 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
83 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
84 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
85 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
86 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
87 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
88 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
89 | | ... | ${dut_tun_ip}
90
91 | TC03: VPP process ESP packet in Tunnel Mode with AES-CBC-256 encryption and SHA1-96 integrity
92 | | [Documentation]
93 | | ... | [Top] TG-DUT1.
94 | | ... | [Ref] RFC4303.
95 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
96 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA1-96 in tunnel mode.
97 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
98 | | ...
99 | | [Tags] | SKIP_PATCH
100 | | ...
101 | | ${encr_alg}= | Crypto Alg AES CBC 256
102 | | ${auth_alg}= | Integ Alg SHA1 96
103 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
104 | | When Configure manual keyed connection for IPSec
105 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
106 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
107 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
108 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
109 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
110 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
111 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
112 | | ... | ${dut_tun_ip}
113
114 | TC04: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA-256-128 integrity
115 | | [Documentation]
116 | | ... | [Top] TG-DUT1.
117 | | ... | [Ref] RFC4303.
118 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
119 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-256-128 in tunnel\
120 | | ... | mode.
121 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
122 | | ...
123 | | [Tags] | SKIP_PATCH
124 | | ...
125 | | ${encr_alg}= | Crypto Alg AES CBC 128
126 | | ${auth_alg}= | Integ Alg SHA 256 128
127 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
128 | | When Configure manual keyed connection for IPSec
129 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
130 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
131 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
132 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
133 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
134 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
135 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
136 | | ... | ${dut_tun_ip}
137
138 | TC05: VPP process ESP packet in Tunnel Mode with AES-CBC-192 encryption and SHA-256-128 integrity
139 | | [Documentation]
140 | | ... | [Top] TG-DUT1.
141 | | ... | [Ref] RFC4303.
142 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
143 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-256-128 in tunnel\
144 | | ... | mode.
145 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
146 | | ...
147 | | ${encr_alg}= | Crypto Alg AES CBC 192
148 | | ${auth_alg}= | Integ Alg SHA 256 128
149 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
150 | | When Configure manual keyed connection for IPSec
151 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
152 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
153 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
154 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
155 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
156 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
157 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
158 | | ... | ${dut_tun_ip}
159
160 | TC06: VPP process ESP packet in Tunnel Mode with AES-CBC-256 encryption and SHA-256-128 integrity
161 | | [Documentation]
162 | | ... | [Top] TG-DUT1.
163 | | ... | [Ref] RFC4303.
164 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
165 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-256-128 in tunnel\
166 | | ... | mode.
167 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
168 | | ...
169 | | [Tags] | SKIP_PATCH
170 | | ...
171 | | ${encr_alg}= | Crypto Alg AES CBC 256
172 | | ${auth_alg}= | Integ Alg SHA 256 128
173 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
174 | | When Configure manual keyed connection for IPSec
175 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
176 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
177 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
178 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
179 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
180 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
181 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
182 | | ... | ${dut_tun_ip}
183
184 | TC07: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA-384-192 integrity
185 | | [Documentation]
186 | | ... | [Top] TG-DUT1.
187 | | ... | [Ref] RFC4303.
188 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
189 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-384-192 in tunnel\
190 | | ... | mode.
191 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
192 | | ...
193 | | [Tags] | SKIP_PATCH
194 | | ...
195 | | ${encr_alg}= | Crypto Alg AES CBC 128
196 | | ${auth_alg}= | Integ Alg SHA 384 192
197 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
198 | | When Configure manual keyed connection for IPSec
199 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
200 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
201 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
202 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
203 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
204 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
205 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
206 | | ... | ${dut_tun_ip}
207
208 | TC08: VPP process ESP packet in Tunnel Mode with AES-CBC-192 encryption and SHA-384-192 integrity
209 | | [Documentation]
210 | | ... | [Top] TG-DUT1.
211 | | ... | [Ref] RFC4303.
212 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
213 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-384-192 in tunnel\
214 | | ... | mode.
215 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
216 | | ...
217 | | [Tags] | SKIP_PATCH
218 | | ...
219 | | ${encr_alg}= | Crypto Alg AES CBC 192
220 | | ${auth_alg}= | Integ Alg SHA 384 192
221 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
222 | | When Configure manual keyed connection for IPSec
223 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
224 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
225 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
226 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
227 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
228 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
229 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
230 | | ... | ${dut_tun_ip}
231
232 | TC09: VPP process ESP packet in Tunnel Mode with AES-CBC-256 encryption and SHA-384-192 integrity
233 | | [Documentation]
234 | | ... | [Top] TG-DUT1.
235 | | ... | [Ref] RFC4303.
236 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
237 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-384-192 in tunnel\
238 | | ... | mode.
239 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
240 | | ...
241 | | ${encr_alg}= | Crypto Alg AES CBC 256
242 | | ${auth_alg}= | Integ Alg SHA 384 192
243 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
244 | | When Configure manual keyed connection for IPSec
245 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
246 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
247 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
248 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
249 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
250 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
251 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
252 | | ... | ${dut_tun_ip}
253
254 | TC10: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA-512-256 integrity
255 | | [Documentation]
256 | | ... | [Top] TG-DUT1.
257 | | ... | [Ref] RFC4303.
258 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
259 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-512-256 in tunnel\
260 | | ... | mode.
261 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
262 | | ...
263 | | [Tags] | SKIP_PATCH
264 | | ...
265 | | ${encr_alg}= | Crypto Alg AES CBC 128
266 | | ${auth_alg}= | Integ Alg SHA 512 256
267 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
268 | | When Configure manual keyed connection for IPSec
269 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
270 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
271 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
272 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
273 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
274 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
275 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
276 | | ... | ${dut_tun_ip}
277
278 | TC11: VPP process ESP packet in Tunnel Mode with AES-CBC-192 encryption and SHA-512-256 integrity
279 | | [Documentation]
280 | | ... | [Top] TG-DUT1.
281 | | ... | [Ref] RFC4303.
282 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
283 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-512-256 in tunnel\
284 | | ... | mode.
285 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
286 | | ...
287 | | [Tags] | SKIP_PATCH
288 | | ...
289 | | ${encr_alg}= | Crypto Alg AES CBC 192
290 | | ${auth_alg}= | Integ Alg SHA 512 256
291 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
292 | | When Configure manual keyed connection for IPSec
293 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
294 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
295 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
296 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
297 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
298 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
299 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
300 | | ... | ${dut_tun_ip}
301
302 | TC12: VPP process ESP packet in Tunnel Mode with AES-CBC-256 encryption and SHA-512-256 integrity
303 | | [Documentation]
304 | | ... | [Top] TG-DUT1.
305 | | ... | [Ref] RFC4303.
306 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
307 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-512-256 in tunnel\
308 | | ... | mode.
309 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
310 | | ...
311 | | ${encr_alg}= | Crypto Alg AES CBC 256
312 | | ${auth_alg}= | Integ Alg SHA 512 256
313 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
314 | | When Configure manual keyed connection for IPSec
315 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
316 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
317 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
318 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
319 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
320 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
321 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
322 | | ... | ${dut_tun_ip}
323
324 | TC13: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA1-96 integrity - different encryption alogrithms used
325 | | [Documentation]
326 | | ... | [Top] TG-DUT1.
327 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
328 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel mode.
329 | | ... | [Ver] Send an ESP packet encrypted by encryption key different from\
330 | | ... | encryption key stored on VPP node from TG to VPP node and expect no\
331 | | ... | response to be received on TG.
332 | | ... | [Ref] RFC4303.
333 | | ...
334 | | ${encr_alg}= | Crypto Alg AES CBC 128
335 | | ${auth_alg}= | Integ Alg SHA1 96
336 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
337 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
338 | | When Configure manual keyed connection for IPSec
339 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
340 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
341 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
342 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
343 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
344 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
345 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key} | ${tg_spi}
346 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
347 | | ... | ${dut_tun_ip}
348
349 | TC14: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA1-96 integrity - different integrity alogrithms used
350 | | [Documentation]
351 | | ... | [Top] TG-DUT1.
352 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
353 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel mode.
354 | | ... | [Ver] Send an ESP packet authenticated by integrity key different\
355 | | ... | from integrity key stored on VPP node from TG to VPP node and expect\
356 | | ... | no response to be received on TG.
357 | | ... | [Ref] RFC4303.
358 | | ...
359 | | ${encr_alg}= | Crypto Alg AES CBC 128
360 | | ${auth_alg}= | Integ Alg SHA1 96
361 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
362 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
363 | | When Configure manual keyed connection for IPSec
364 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
365 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
366 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
367 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
368 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
369 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
370 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key2} | ${tg_spi}
371 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
372 | | ... | ${dut_tun_ip}
373
374 | TC15: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA1-96 integrity - different encryption and integrity alogrithms used
375 | | [Documentation]
376 | | ... | [Top] TG-DUT1.
377 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
378 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel mode.
379 | | ... | [Ver] Send an ESP packet authenticated by integrity key and encrypted\
380 | | ... | by encryption key different from integrity and encryption keys stored\
381 | | ... | on VPP node from TG to VPP node and expect no response to be received\
382 | | ... | on TG.
383 | | ... | [Ref] RFC4303.
384 | | ...
385 | | ${encr_alg}= | Crypto Alg AES CBC 128
386 | | ${auth_alg}= | Integ Alg SHA1 96
387 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
388 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
389 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
390 | | When Configure manual keyed connection for IPSec
391 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
392 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
393 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
394 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
395 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
396 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
397 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key2} | ${tg_spi}
398 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
399 | | ... | ${dut_tun_ip}
400
401 | TC16: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA1-96 integrity with update SA keys
402 | | [Documentation]
403 | | ... | [Top] TG-DUT1.
404 | | ... | [Ref] RFC4303.
405 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
406 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel\
407 | | ... | mode. Then update SA keys - use new keys.
408 | | ... | [Ver] Send and receive ESP packet between TG and VPP node before\
409 | | ... | and after SA keys update.
410 | | ...
411 | | [Tags] | EXPECTED_FAILING
412 | | ...
413 | | ${encr_alg}= | Crypto Alg AES CBC 128
414 | | ${auth_alg}= | Integ Alg SHA1 96
415 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
416 | | When Configure manual keyed connection for IPSec
417 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
418 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
419 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
420 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
421 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
422 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
423 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
424 | | ... | ${dut_tun_ip}
425 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
426 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
427 | | When Update IPSec SA keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
428 | | ... | ${new_encr_key} | ${new_auth_key}
429 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
430 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
431 | | ... | ${encr_alg} | ${new_encr_key} | ${auth_alg} | ${new_auth_key}
432 | | ... | ${tg_spi} | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
433 | | ... | ${dut_tun_ip}
434
435 | TC17: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA1-96 integrity with update SA keys - different encryption alogrithms used
436 | | [Documentation]
437 | | ... | [Top] TG-DUT1.
438 | | ... | [Ref] RFC4303.
439 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
440 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel
441 | | ... | mode. Then update SA keys - use new keys.
442 | | ... | [Ver] Send an ESP packet encrypted by encryption key different from\
443 | | ... | encryption key stored on VPP node from TG to VPP node and expect no\
444 | | ... | response to be received on TG before and after SA keys update.
445 | | ...
446 | | [Tags] | EXPECTED_FAILING
447 | | ...
448 | | ${encr_alg}= | Crypto Alg AES CBC 128
449 | | ${auth_alg}= | Integ Alg SHA1 96
450 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
451 | | When Configure manual keyed connection for IPSec
452 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
453 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
454 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
455 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
456 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
457 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
458 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
459 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key} | ${tg_spi}
460 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
461 | | ... | ${dut_tun_ip}
462 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
463 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
464 | | When Update IPSec SA keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
465 | | ... | ${new_encr_key} | ${new_auth_key}
466 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
467 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
468 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
469 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${new_auth_key} | ${tg_spi}
470 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
471 | | ... | ${dut_tun_ip}
472
473 | TC18: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA1-96 integrity with update SA keys - different integrity alogrithms used
474 | | [Documentation]
475 | | ... | [Top] TG-DUT1.
476 | | ... | [Ref] RFC4303.
477 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
478 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel\
479 | | ... | mode. Then update SA keys - use new keys.
480 | | ... | [Ver] Send an ESP packet authenticated by integrity key different\
481 | | ... | from integrity key stored on VPP node from TG to VPP node and expect\
482 | | ... | no response to be received on TG before and after SA keys update.
483 | | ...
484 | | [Tags] | EXPECTED_FAILING
485 | | ...
486 | | ${encr_alg}= | Crypto Alg AES CBC 128
487 | | ${auth_alg}= | Integ Alg SHA1 96
488 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
489 | | When Configure manual keyed connection for IPSec
490 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
491 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
492 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
493 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
494 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
495 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
496 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
497 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key2} | ${tg_spi}
498 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
499 | | ... | ${dut_tun_ip}
500 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
501 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
502 | | When Update IPSec SA keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
503 | | ... | ${new_encr_key} | ${new_auth_key}
504 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
505 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
506 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
507 | | ... | ${encr_alg} | ${new_encr_key} | ${auth_alg} | ${auth_key2} | ${tg_spi}
508 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
509 | | ... | ${dut_tun_ip}
510
511 | TC19: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA1-96 integrity with update SA keys - different encryption and integrity alogrithms used
512 | | [Documentation]
513 | | ... | [Top] TG-DUT1.
514 | | ... | [Ref] RFC4303.
515 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
516 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel\
517 | | ... | mode. Then update SA keys - use new keys.
518 | | ... | [Ver] Send an ESP packet authenticated by integrity key and encrypted\
519 | | ... | by encryption key different from integrity and encryption keys stored\
520 | | ... | on VPP node from TG to VPP node and expect no response to be received\
521 | | ... | on TG before and after SA keys update.
522 | | ...
523 | | [Tags] | EXPECTED_FAILING
524 | | ...
525 | | ${encr_alg}= | Crypto Alg AES CBC 128
526 | | ${auth_alg}= | Integ Alg SHA1 96
527 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
528 | | When Configure manual keyed connection for IPSec
529 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
530 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
531 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
532 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
533 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
534 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
535 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
536 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
537 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key2} | ${tg_spi}
538 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
539 | | ... | ${dut_tun_ip}
540 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
541 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
542 | | When Update IPSec SA keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
543 | | ... | ${new_encr_key} | ${new_auth_key}
544 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
545 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
546 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
547 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key2} | ${tg_spi}
548 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
549 | | ... | ${dut_tun_ip}
550
551 *** Keywords ***
552 | Get Second Random String
553 | | [Arguments] | ${req_alg} | ${req_type}
554 | | ...
555 | | ${req_key_len}= | Run Keyword | Get ${req_type} Alg Key Len | ${req_alg}
556 | | ${key}= | Set Variable If | '${req_type}' == 'Crypto' | ${encr_key}
557 | | ... | '${req_type}' == 'Integ' | ${auth_key}
558 | | :FOR | ${index} | IN RANGE | 100
559 | | | ${req_key}= | Generate Random String | ${req_key_len}
560 | | | Return From Keyword If | '${req_key}' != '${key}' | ${req_key}