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