c1c279198a385bda32543a08e2baab0830506d94
[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 | TC16: VPP process ESP packet in Tunnel Mode with AES-CBC-128 encryption and SHA1-96 integrity with update SA keys
366 | | [Documentation]
367 | | ... | [Top] TG-DUT1.
368 | | ... | [Ref] RFC4303.
369 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
370 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel\
371 | | ... | mode. Then update SA keys - use new keys.
372 | | ... | [Ver] Send and receive ESP packet between TG and VPP node before\
373 | | ... | and after SA keys update.
374 | | ${encr_alg}= | Crypto Alg AES CBC 128
375 | | ${auth_alg}= | Integ Alg SHA1 96
376 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
377 | | When VPP Setup IPsec Manual Keyed Connection
378 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
379 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
380 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
381 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
382 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
383 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
384 | | ... | ${dut_tun_ip}
385 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
386 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
387 | | When VPP Update IPsec SA Keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
388 | | ... | ${new_encr_key} | ${new_auth_key}
389 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
390 | | ... | ${encr_alg} | ${new_encr_key} | ${auth_alg} | ${new_auth_key}
391 | | ... | ${tg_spi} | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
392 | | ... | ${dut_tun_ip}
393
394 | 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
395 | | [Documentation]
396 | | ... | [Top] TG-DUT1.
397 | | ... | [Ref] RFC4303.
398 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
399 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel
400 | | ... | mode. Then update SA keys - use new keys.
401 | | ... | [Ver] Send an ESP packet encrypted by encryption key different from\
402 | | ... | encryption key stored on VPP node from TG to VPP node and expect no\
403 | | ... | response to be received on TG before and after SA keys update.
404 | | ${encr_alg}= | Crypto Alg AES CBC 128
405 | | ${auth_alg}= | Integ Alg SHA1 96
406 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
407 | | When VPP Setup IPsec Manual Keyed Connection
408 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
409 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
410 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
411 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
412 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
413 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
414 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key} | ${tg_spi}
415 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
416 | | ... | ${dut_tun_ip}
417 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
418 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
419 | | When VPP Update IPsec SA Keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
420 | | ... | ${new_encr_key} | ${new_auth_key}
421 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
422 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
423 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${new_auth_key} | ${tg_spi}
424 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
425 | | ... | ${dut_tun_ip}
426
427 | 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
428 | | [Documentation]
429 | | ... | [Top] TG-DUT1.
430 | | ... | [Ref] RFC4303.
431 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
432 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel\
433 | | ... | mode. Then update SA keys - use new keys.
434 | | ... | [Ver] Send an ESP packet authenticated by integrity key different\
435 | | ... | from integrity key stored on VPP node from TG to VPP node and expect\
436 | | ... | no response to be received on TG before and after SA keys update.
437 | | ${encr_alg}= | Crypto Alg AES CBC 128
438 | | ${auth_alg}= | Integ Alg SHA1 96
439 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
440 | | When VPP Setup IPsec Manual Keyed Connection
441 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
442 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
443 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
444 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
445 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
446 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
447 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key2} | ${tg_spi}
448 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
449 | | ... | ${dut_tun_ip}
450 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
451 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
452 | | When VPP Update IPsec SA Keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
453 | | ... | ${new_encr_key} | ${new_auth_key}
454 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
455 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
456 | | ... | ${encr_alg} | ${new_encr_key} | ${auth_alg} | ${auth_key2} | ${tg_spi}
457 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
458 | | ... | ${dut_tun_ip}
459
460 | 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
461 | | [Documentation]
462 | | ... | [Top] TG-DUT1.
463 | | ... | [Ref] RFC4303.
464 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
465 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in tunnel\
466 | | ... | mode. Then update SA keys - use new keys.
467 | | ... | [Ver] Send an ESP packet authenticated by integrity key and encrypted\
468 | | ... | by encryption key different from integrity and encryption keys stored\
469 | | ... | on VPP node from TG to VPP node and expect no response to be received\
470 | | ... | on TG before and after SA keys update.
471 | | ${encr_alg}= | Crypto Alg AES CBC 128
472 | | ${auth_alg}= | Integ Alg SHA1 96
473 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
474 | | When VPP Setup IPsec Manual Keyed Connection
475 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
476 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_src_ip} | ${tg_src_ip}
477 | | ... | ${dut_tun_ip} | ${tg_tun_ip}
478 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
479 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
480 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
481 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
482 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key2} | ${tg_spi}
483 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
484 | | ... | ${dut_tun_ip}
485 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
486 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
487 | | When VPP Update IPsec SA Keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
488 | | ... | ${new_encr_key} | ${new_auth_key}
489 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
490 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
491 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key2} | ${tg_spi}
492 | | ... | ${dut_spi} | ${tg_src_ip} | ${dut_src_ip} | ${tg_tun_ip}
493 | | ... | ${dut_tun_ip}
494
495 *** Keywords ***
496 | Get Second Random String
497 | | [Arguments] | ${req_alg} | ${req_type}
498 | | ${req_key_len}= | Run Keyword | Get ${req_type} Alg Key Len | ${req_alg}
499 | | ${key}= | Set Variable If | '${req_type}' == 'Crypto' | ${encr_key}
500 | | ...                       | '${req_type}' == 'Integ' | ${auth_key}
501 | | :FOR | ${index} | IN RANGE | 100
502 | | | ${req_key}= | Generate Random String | ${req_key_len}
503 | | | Return From Keyword If | '${req_key}' != '${key}' | ${req_key}