48e37832d9cc776b628a8e6fe54d507c8933f811
[csit.git] / tests / func / ipsec / ipsec_tunnel_mode_ipv6.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 IPv6 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 | *IPv6 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 IPv6 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_ip6}= | 3ffe:5f::1
42 | ${dut_if_ip6}= | 3ffe:5f::2
43 | ${tg_lo_ip6}= | 3ffe:60::3
44 | ${dut_lo_ip6}= | 3ffe:60::4
45 | ${ip6_plen}= | ${64}
46 | ${ip6_plen_rt}= | ${128}
47
48 *** Test Cases ***
49 | TC01: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA1-96 integrity
50 | | [Documentation]
51 | | ... | [Top] TG-DUT1.
52 | | ... | [Ref] RFC4303.
53 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
54 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel mode.
55 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
56 | | ${encr_alg}= | Crypto Alg AES CBC 128
57 | | ${auth_alg}= | Integ Alg SHA1 96
58 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
59 | | When VPP Setup IPsec Manual Keyed Connection
60 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
61 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
62 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
63 | | Then Send And Receive IPsec Packet | ${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 | | [Tags] | SKIP_PATCH
76 | | ${encr_alg}= | Crypto Alg AES CBC 192
77 | | ${auth_alg}= | Integ Alg SHA1 96
78 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
79 | | When VPP Setup IPsec Manual Keyed Connection
80 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
81 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
82 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
83 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
84 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
85 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
86 | | ... | ${dut_tun_ip}
87
88 | TC03: VPP process ESP packet in Tunnel Mode with AES-CBC-256 encryption and SHA1-96 integrity
89 | | [Documentation]
90 | | ... | [Top] TG-DUT1.
91 | | ... | [Ref] RFC4303.
92 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
93 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA1-96 in tunnel mode.
94 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
95 | | [Tags] | SKIP_PATCH
96 | | ${encr_alg}= | Crypto Alg AES CBC 256
97 | | ${auth_alg}= | Integ Alg SHA1 96
98 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
99 | | When VPP Setup IPsec Manual Keyed Connection
100 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
101 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
102 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
103 | | Then Send And Receive IPsec Packet | ${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 IPsec Generate Keys | ${encr_alg} | ${auth_alg}
120 | | When VPP Setup IPsec Manual Keyed Connection
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 And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
125 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
126 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
127 | | ... | ${dut_tun_ip}
128
129 | TC05: VPP process ESP packet in Tunnel Mode with AES-CBC-192 encryption and SHA-256-128 integrity
130 | | [Documentation]
131 | | ... | [Top] TG-DUT1.
132 | | ... | [Ref] RFC4303.
133 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
134 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-256-128 in tunnel
135 | | ... | mode.
136 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
137 | | ${encr_alg}= | Crypto Alg AES CBC 192
138 | | ${auth_alg}= | Integ Alg SHA 256 128
139 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
140 | | When VPP Setup IPsec Manual Keyed Connection
141 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
142 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
143 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
144 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
145 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
146 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
147 | | ... | ${dut_tun_ip}
148
149 | TC06: VPP process ESP packet in Tunnel Mode with AES-CBC-256 encryption and SHA-256-128 integrity
150 | | [Documentation]
151 | | ... | [Top] TG-DUT1.
152 | | ... | [Ref] RFC4303.
153 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
154 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-256-128 in tunnel
155 | | ... | mode.
156 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
157 | | [Tags] | SKIP_PATCH
158 | | ${encr_alg}= | Crypto Alg AES CBC 256
159 | | ${auth_alg}= | Integ Alg SHA 256 128
160 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
161 | | When VPP Setup IPsec Manual Keyed Connection
162 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
163 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
164 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
165 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
166 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
167 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
168 | | ... | ${dut_tun_ip}
169
170 | TC07: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA-384-192 integrity
171 | | [Documentation]
172 | | ... | [Top] TG-DUT1.
173 | | ... | [Ref] RFC4303.
174 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
175 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-384-192 in tunnel
176 | | ... | mode.
177 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
178 | | [Tags] | SKIP_PATCH
179 | | ${encr_alg}= | Crypto Alg AES CBC 128
180 | | ${auth_alg}= | Integ Alg SHA 384 192
181 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
182 | | When VPP Setup IPsec Manual Keyed Connection
183 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
184 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
185 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
186 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
187 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
188 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
189 | | ... | ${dut_tun_ip}
190
191 | TC08: VPP process ESP packet in Tunnel Mode with AES-CBC-192 encryption and SHA-384-192 integrity
192 | | [Documentation]
193 | | ... | [Top] TG-DUT1.
194 | | ... | [Ref] RFC4303.
195 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
196 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-384-192 in tunnel
197 | | ... | mode.
198 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
199 | | [Tags] | SKIP_PATCH
200 | | ${encr_alg}= | Crypto Alg AES CBC 192
201 | | ${auth_alg}= | Integ Alg SHA 384 192
202 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
203 | | When VPP Setup IPsec Manual Keyed Connection
204 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
205 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
206 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
207 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
208 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
209 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
210 | | ... | ${dut_tun_ip}
211
212 | TC09: VPP process ESP packet in Tunnel Mode with AES-CBC-256 encryption and SHA-384-192 integrity
213 | | [Documentation]
214 | | ... | [Top] TG-DUT1.
215 | | ... | [Ref] RFC4303.
216 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
217 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-384-192 in tunnel
218 | | ... | mode.
219 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
220 | | ${encr_alg}= | Crypto Alg AES CBC 256
221 | | ${auth_alg}= | Integ Alg SHA 384 192
222 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
223 | | When VPP Setup IPsec Manual Keyed Connection
224 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
225 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
226 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
227 | | Then Send And Receive IPsec Packet | ${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 | TC10: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA-512-256 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-128 and integrity algorithm SHA-512-256 in tunnel
238 | | ... | mode.
239 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
240 | | [Tags] | SKIP_PATCH
241 | | ${encr_alg}= | Crypto Alg AES CBC 128
242 | | ${auth_alg}= | Integ Alg SHA 512 256
243 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
244 | | When VPP Setup IPsec Manual Keyed Connection
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 And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
249 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
250 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
251 | | ... | ${dut_tun_ip}
252
253 | TC11: VPP process ESP packet in Tunnel Mode with AES-CBC-192 encryption and SHA-512-256 integrity
254 | | [Documentation]
255 | | ... | [Top] TG-DUT1.
256 | | ... | [Ref] RFC4303.
257 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
258 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-512-256 in tunnel
259 | | ... | mode.
260 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
261 | | [Tags] | SKIP_PATCH
262 | | ${encr_alg}= | Crypto Alg AES CBC 192
263 | | ${auth_alg}= | Integ Alg SHA 512 256
264 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
265 | | When VPP Setup IPsec Manual Keyed Connection
266 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
267 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
268 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
269 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
270 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
271 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
272 | | ... | ${dut_tun_ip}
273
274 | TC12: VPP process ESP packet in Tunnel Mode with AES-CBC-256 encryption and SHA-512-256 integrity
275 | | [Documentation]
276 | | ... | [Top] TG-DUT1.
277 | | ... | [Ref] RFC4303.
278 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
279 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-512-256 in tunnel
280 | | ... | mode.
281 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
282 | | ${encr_alg}= | Crypto Alg AES CBC 256
283 | | ${auth_alg}= | Integ Alg SHA 512 256
284 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
285 | | When VPP Setup IPsec Manual Keyed Connection
286 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
287 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
288 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
289 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
290 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
291 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
292 | | ... | ${dut_tun_ip}
293
294 | TC13: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA1-96 integrity - different encryption alogrithms used
295 | | [Documentation]
296 | | ... | [Top] TG-DUT1.
297 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
298 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel mode.
299 | | ... | [Ver] Send an ESP packet encrypted by encryption key different from\
300 | | ... | encryption key stored on VPP node from TG to VPP node and expect no\
301 | | ... | response to be received on TG.
302 | | ... | [Ref] RFC4303.
303 | | ${encr_alg}= | Crypto Alg AES CBC 128
304 | | ${auth_alg}= | Integ Alg SHA1 96
305 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
306 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
307 | | When VPP Setup IPsec Manual Keyed Connection
308 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
309 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
310 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
311 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
312 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
313 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key} | ${tg_spi}
314 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
315 | | ... | ${dut_tun_ip}
316
317 | TC14: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA1-96 integrity - different integrity alogrithms used
318 | | [Documentation]
319 | | ... | [Top] TG-DUT1.
320 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
321 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel mode.
322 | | ... | [Ver] Send an ESP packet authenticated by integrity key different\
323 | | ... | from integrity key stored on VPP node from TG to VPP node and expect\
324 | | ... | no response to be received on TG.
325 | | ... | [Ref] RFC4303.
326 | | ${encr_alg}= | Crypto Alg AES CBC 128
327 | | ${auth_alg}= | Integ Alg SHA1 96
328 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
329 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
330 | | When VPP Setup IPsec Manual Keyed Connection
331 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
332 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
333 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
334 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
335 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
336 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key2} | ${tg_spi}
337 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
338 | | ... | ${dut_tun_ip}
339
340 | TC15: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA1-96 integrity - different encryption and integrity alogrithms used
341 | | [Documentation]
342 | | ... | [Top] TG-DUT1.
343 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
344 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel mode.
345 | | ... | [Ver] Send an ESP packet authenticated by integrity key and encrypted\
346 | | ... | by encryption key different from integrity and encryption keys stored\
347 | | ... | on VPP node from TG to VPP node and expect no response to be received\
348 | | ... | on TG.
349 | | ... | [Ref] RFC4303.
350 | | ${encr_alg}= | Crypto Alg AES CBC 128
351 | | ${auth_alg}= | Integ Alg SHA1 96
352 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
353 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
354 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
355 | | When VPP Setup IPsec Manual Keyed Connection
356 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
357 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
358 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
359 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
360 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
361 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key2} | ${tg_spi}
362 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
363 | | ... | ${dut_tun_ip}
364
365 *** Keywords ***
366 | Get Second Random String
367 | | [Arguments] | ${req_alg} | ${req_type}
368 | | ${req_key_len}= | Run Keyword | Get ${req_type} Alg Key Len | ${req_alg}
369 | | :FOR | ${index} | IN RANGE | 100
370 | | | ${req_key}= | Generate Random String | ${req_key_len}
371 | | | Return From Keyword If | '${req_key}' != '${encr_key}' | ${req_key}