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