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