CSIT-383: IPSEC IPv4 negative test cases
[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 Errors on All DUTs
25 | ...           | AND          | Show Vpp Trace Dump on All DUTs
26 | Documentation | *IPv4 IPsec tunnel mode test suite.*
27 | ...
28 | ... | *[Top] Network topologies:* TG-DUT1 2-node topology with one link\
29 | ... | between nodes.
30 | ... | *[Cfg] DUT configuration:* On DUT1 create loopback interface, configure\
31 | ... | loopback an physical interface IPv4 addresses, static ARP record, route\
32 | ... | and IPsec manual keyed connection in tunnel mode.
33 | ... | *[Ver] TG verification:* ESP packet is sent from TG to DUT1. ESP packet\
34 | ... | is received on TG from DUT1.
35 | ... | *[Ref] Applicable standard specifications:* RFC4303.
36
37 *** Variables ***
38 | ${tg_spi}= | ${1000}
39 | ${dut_spi}= | ${1001}
40 | ${ESP_PROTO}= | ${50}
41 | ${tg_if_ip4}= | 192.168.100.2
42 | ${dut_if_ip4}= | 192.168.100.3
43 | ${tg_lo_ip4}= | 192.168.3.3
44 | ${dut_lo_ip4}= | 192.168.4.4
45 | ${ip4_plen}= | ${24}
46
47 *** Test Cases ***
48 | TC01: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA1-96 integrity
49 | | [Documentation]
50 | | ... | [Top] TG-DUT1.
51 | | ... | [Ref] RFC4303.
52 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
53 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel mode.
54 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
55 | | ${encr_alg}= | Crypto Alg AES CBC 128
56 | | ${auth_alg}= | Integ Alg SHA1 96
57 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
58 | | When VPP Setup IPsec Manual Keyed Connection
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 And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
63 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
64 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
65 | | ... | ${dut_tun_ip}
66
67 | TC02: VPP process ESP packet in Tunnel Mode with AES-CBC-192 encryption and SHA1-96 integrity
68 | | [Documentation]
69 | | ... | [Top] TG-DUT1.
70 | | ... | [Ref] RFC4303.
71 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
72 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA1-96 in tunnel mode.
73 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
74 | | [Tags] | SKIP_PATCH
75 | | ${encr_alg}= | Crypto Alg AES CBC 192
76 | | ${auth_alg}= | Integ Alg SHA1 96
77 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
78 | | When VPP Setup IPsec Manual Keyed Connection
79 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
80 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
81 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
82 | | Then Send And Receive IPsec Packet | ${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 IPsec Generate Keys | ${encr_alg} | ${auth_alg}
98 | | When VPP Setup IPsec Manual Keyed Connection
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 And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
103 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
104 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
105 | | ... | ${dut_tun_ip}
106
107 | TC04: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA-256-128 integrity
108 | | [Documentation]
109 | | ... | [Top] TG-DUT1.
110 | | ... | [Ref] RFC4303.
111 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
112 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-256-128 in tunnel\
113 | | ... | mode.
114 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
115 | | [Tags] | SKIP_PATCH
116 | | ${encr_alg}= | Crypto Alg AES CBC 128
117 | | ${auth_alg}= | Integ Alg SHA 256 128
118 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
119 | | When VPP Setup IPsec Manual Keyed Connection
120 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
121 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
122 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
123 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
124 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
125 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
126 | | ... | ${dut_tun_ip}
127
128 | TC05: VPP process ESP packet in Tunnel Mode with AES-CBC-192 encryption and SHA-256-128 integrity
129 | | [Documentation]
130 | | ... | [Top] TG-DUT1.
131 | | ... | [Ref] RFC4303.
132 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
133 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-256-128 in tunnel\
134 | | ... | mode.
135 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
136 | | ${encr_alg}= | Crypto Alg AES CBC 192
137 | | ${auth_alg}= | Integ Alg SHA 256 128
138 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
139 | | When VPP Setup IPsec Manual Keyed Connection
140 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
141 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
142 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
143 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
144 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
145 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
146 | | ... | ${dut_tun_ip}
147
148 | TC06: VPP process ESP packet in Tunnel Mode with AES-CBC-256 encryption and SHA-256-128 integrity
149 | | [Documentation]
150 | | ... | [Top] TG-DUT1.
151 | | ... | [Ref] RFC4303.
152 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
153 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-256-128 in tunnel\
154 | | ... | mode.
155 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
156 | | [Tags] | SKIP_PATCH
157 | | ${encr_alg}= | Crypto Alg AES CBC 256
158 | | ${auth_alg}= | Integ Alg SHA 256 128
159 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
160 | | When VPP Setup IPsec Manual Keyed Connection
161 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
162 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
163 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
164 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
165 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
166 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
167 | | ... | ${dut_tun_ip}
168
169 | TC07: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA-384-192 integrity
170 | | [Documentation]
171 | | ... | [Top] TG-DUT1.
172 | | ... | [Ref] RFC4303.
173 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
174 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-384-192 in tunnel\
175 | | ... | mode.
176 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
177 | | [Tags] | SKIP_PATCH
178 | | ${encr_alg}= | Crypto Alg AES CBC 128
179 | | ${auth_alg}= | Integ Alg SHA 384 192
180 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
181 | | When VPP Setup IPsec Manual Keyed Connection
182 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
183 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
184 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
185 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
186 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
187 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
188 | | ... | ${dut_tun_ip}
189
190 | TC08: VPP process ESP packet in Tunnel Mode with AES-CBC-192 encryption and SHA-384-192 integrity
191 | | [Documentation]
192 | | ... | [Top] TG-DUT1.
193 | | ... | [Ref] RFC4303.
194 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
195 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-384-192 in tunnel\
196 | | ... | mode.
197 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
198 | | [Tags] | SKIP_PATCH
199 | | ${encr_alg}= | Crypto Alg AES CBC 192
200 | | ${auth_alg}= | Integ Alg SHA 384 192
201 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
202 | | When VPP Setup IPsec Manual Keyed Connection
203 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
204 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
205 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
206 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
207 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
208 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
209 | | ... | ${dut_tun_ip}
210
211 | TC09: VPP process ESP packet in Tunnel Mode with AES-CBC-256 encryption and SHA-384-192 integrity
212 | | [Documentation]
213 | | ... | [Top] TG-DUT1.
214 | | ... | [Ref] RFC4303.
215 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
216 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-384-192 in tunnel\
217 | | ... | mode.
218 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
219 | | ${encr_alg}= | Crypto Alg AES CBC 256
220 | | ${auth_alg}= | Integ Alg SHA 384 192
221 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
222 | | When VPP Setup IPsec Manual Keyed Connection
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 And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
227 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
228 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
229 | | ... | ${dut_tun_ip}
230
231 | TC10: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA-512-256 integrity
232 | | [Documentation]
233 | | ... | [Top] TG-DUT1.
234 | | ... | [Ref] RFC4303.
235 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
236 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-512-256 in tunnel\
237 | | ... | mode.
238 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
239 | | [Tags] | SKIP_PATCH
240 | | ${encr_alg}= | Crypto Alg AES CBC 128
241 | | ${auth_alg}= | Integ Alg SHA 512 256
242 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
243 | | When VPP Setup IPsec Manual Keyed Connection
244 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
245 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
246 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
247 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
248 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
249 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
250 | | ... | ${dut_tun_ip}
251
252 | TC11: VPP process ESP packet in Tunnel Mode with AES-CBC-192 encryption and SHA-512-256 integrity
253 | | [Documentation]
254 | | ... | [Top] TG-DUT1.
255 | | ... | [Ref] RFC4303.
256 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
257 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-512-256 in tunnel\
258 | | ... | mode.
259 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
260 | | [Tags] | SKIP_PATCH
261 | | ${encr_alg}= | Crypto Alg AES CBC 192
262 | | ${auth_alg}= | Integ Alg SHA 512 256
263 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
264 | | When VPP Setup IPsec Manual Keyed Connection
265 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
266 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
267 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
268 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
269 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
270 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
271 | | ... | ${dut_tun_ip}
272
273 | TC12: VPP process ESP packet in Tunnel Mode with AES-CBC-256 encryption and SHA-512-256 integrity
274 | | [Documentation]
275 | | ... | [Top] TG-DUT1.
276 | | ... | [Ref] RFC4303.
277 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
278 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-512-256 in tunnel\
279 | | ... | mode.
280 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
281 | | ${encr_alg}= | Crypto Alg AES CBC 256
282 | | ${auth_alg}= | Integ Alg SHA 512 256
283 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
284 | | When VPP Setup IPsec Manual Keyed Connection
285 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
286 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
287 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
288 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
289 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
290 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
291 | | ... | ${dut_tun_ip}
292
293 | TC13: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA1-96 integrity - different encryption alogrithms used
294 | | [Documentation]
295 | | ... | [Top] TG-DUT1.
296 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
297 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel mode.
298 | | ... | [Ver] Send an ESP packet encrypted by encryption key different from\
299 | | ... | encryption key stored on VPP node from TG to VPP node and expect no\
300 | | ... | response to be received on TG.
301 | | ... | [Ref] RFC4303.
302 | | ${encr_alg}= | Crypto Alg AES CBC 128
303 | | ${auth_alg}= | Integ Alg SHA1 96
304 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
305 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
306 | | When VPP Setup IPsec Manual Keyed Connection
307 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
308 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
309 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
310 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
311 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
312 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key} | ${tg_spi}
313 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
314 | | ... | ${dut_tun_ip}
315
316 | TC14: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA1-96 integrity - different integrity alogrithms used
317 | | [Documentation]
318 | | ... | [Top] TG-DUT1.
319 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
320 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel mode.
321 | | ... | [Ver] Send an ESP packet authenticated by integrity key different\
322 | | ... | from integrity key stored on VPP node from TG to VPP node and expect\
323 | | ... | no response to be received on TG.
324 | | ... | [Ref] RFC4303.
325 | | ${encr_alg}= | Crypto Alg AES CBC 128
326 | | ${auth_alg}= | Integ Alg SHA1 96
327 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
328 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
329 | | When VPP Setup IPsec Manual Keyed Connection
330 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
331 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
332 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
333 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
334 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
335 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key2} | ${tg_spi}
336 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
337 | | ... | ${dut_tun_ip}
338
339 | TC15: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA1-96 integrity - different encryption and integrity alogrithms used
340 | | [Documentation]
341 | | ... | [Top] TG-DUT1.
342 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
343 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel mode.
344 | | ... | [Ver] Send an ESP packet authenticated by integrity key and encrypted\
345 | | ... | by encryption key different from integrity and encryption keys stored\
346 | | ... | on VPP node from TG to VPP node and expect no response to be received\
347 | | ... | on TG.
348 | | ... | [Ref] RFC4303.
349 | | ${encr_alg}= | Crypto Alg AES CBC 128
350 | | ${auth_alg}= | Integ Alg SHA1 96
351 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
352 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
353 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
354 | | When VPP Setup IPsec Manual Keyed Connection
355 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
356 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
357 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
358 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
359 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
360 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key2} | ${tg_spi}
361 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
362 | | ... | ${dut_tun_ip}
363
364 *** Keywords ***
365 | Get Second Random String
366 | | [Arguments] | ${req_alg} | ${req_type}
367 | | ${req_key_len}= | Run Keyword | Get ${req_type} Alg Key Len | ${req_alg}
368 | | :FOR | ${index} | IN RANGE | 100
369 | | | ${req_key}= | Generate Random String | ${req_key_len}
370 | | | Return From Keyword If | '${req_key}' != '${encr_key}' | ${req_key}