Func test reorg - decrease exec time per vpp patch
[csit.git] / tests / func / ipsec / eth2p-ethip6ipsectpt-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 transport 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 transport 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 Transport 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 transport
52 | | ... | mode.
53 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
54 | | ${encr_alg}= | Crypto Alg AES CBC 128
55 | | ${auth_alg}= | Integ Alg SHA1 96
56 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
57 | | When VPP Setup IPsec Manual Keyed Connection
58 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
59 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${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_tun_ip} | ${dut_tun_ip}
63
64 | TC02: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA1-96 integrity
65 | | [Documentation]
66 | | ... | [Top] TG-DUT1.
67 | | ... | [Ref] RFC4303.
68 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
69 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA1-96 in transport
70 | | ... | 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_tun_ip} | ${tg_tun_ip}
79 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
80 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
81 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
82
83 | TC03: VPP process ESP packet in Transport Mode with AES-CBC-256 encryption and SHA1-96 integrity
84 | | [Documentation]
85 | | ... | [Top] TG-DUT1.
86 | | ... | [Ref] RFC4303.
87 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
88 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA1-96 in transport
89 | | ... | mode.
90 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
91 | | [Tags] | SKIP_PATCH
92 | | ${encr_alg}= | Crypto Alg AES CBC 256
93 | | ${auth_alg}= | Integ Alg SHA1 96
94 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
95 | | When VPP Setup IPsec Manual Keyed Connection
96 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
97 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
98 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
99 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
100 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
101
102 | TC04: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA-256-128 integrity
103 | | [Documentation]
104 | | ... | [Top] TG-DUT1.
105 | | ... | [Ref] RFC4303.
106 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
107 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-256-128 in transport
108 | | ... | mode.
109 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
110 | | [Tags] | SKIP_PATCH
111 | | ${encr_alg}= | Crypto Alg AES CBC 128
112 | | ${auth_alg}= | Integ Alg SHA 256 128
113 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
114 | | When VPP Setup IPsec Manual Keyed Connection
115 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
116 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
117 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
118 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
119 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
120
121 | TC05: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA-256-128 integrity
122 | | [Documentation]
123 | | ... | [Top] TG-DUT1.
124 | | ... | [Ref] RFC4303.
125 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
126 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-256-128 in transport
127 | | ... | mode.
128 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
129 | | ${encr_alg}= | Crypto Alg AES CBC 192
130 | | ${auth_alg}= | Integ Alg SHA 256 128
131 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
132 | | When VPP Setup IPsec Manual Keyed Connection
133 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
134 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
135 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
136 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
137 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
138
139 | TC06: VPP process ESP packet in Transport Mode with AES-CBC-256 encryption and SHA-256-128 integrity
140 | | [Documentation]
141 | | ... | [Top] TG-DUT1.
142 | | ... | [Ref] RFC4303.
143 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
144 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-256-128 in transport
145 | | ... | mode.
146 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
147 | | [Tags] | SKIP_PATCH
148 | | ${encr_alg}= | Crypto Alg AES CBC 256
149 | | ${auth_alg}= | Integ Alg SHA 256 128
150 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
151 | | When VPP Setup IPsec Manual Keyed Connection
152 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
153 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
154 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
155 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
156 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
157
158 | TC07: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA-384-192 integrity
159 | | [Documentation]
160 | | ... | [Top] TG-DUT1.
161 | | ... | [Ref] RFC4303.
162 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
163 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-384-192 in transport
164 | | ... | mode.
165 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
166 | | [Tags] | SKIP_PATCH
167 | | ${encr_alg}= | Crypto Alg AES CBC 128
168 | | ${auth_alg}= | Integ Alg SHA 384 192
169 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
170 | | When VPP Setup IPsec Manual Keyed Connection
171 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
172 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
173 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
174 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
175 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
176
177 | TC08: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA-384-192 integrity
178 | | [Documentation]
179 | | ... | [Top] TG-DUT1.
180 | | ... | [Ref] RFC4303.
181 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
182 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-384-192 in transport
183 | | ... | mode.
184 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
185 | | [Tags] | SKIP_PATCH
186 | | ${encr_alg}= | Crypto Alg AES CBC 192
187 | | ${auth_alg}= | Integ Alg SHA 384 192
188 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
189 | | When VPP Setup IPsec Manual Keyed Connection
190 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
191 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
192 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
193 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
194 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
195
196 | TC09: VPP process ESP packet in Transport Mode with AES-CBC-256 encryption and SHA-384-192 integrity
197 | | [Documentation]
198 | | ... | [Top] TG-DUT1.
199 | | ... | [Ref] RFC4303.
200 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
201 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-384-192 in transport
202 | | ... | mode.
203 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
204 | | ${encr_alg}= | Crypto Alg AES CBC 256
205 | | ${auth_alg}= | Integ Alg SHA 384 192
206 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
207 | | When VPP Setup IPsec Manual Keyed Connection
208 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
209 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
210 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
211 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
212 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
213
214 | TC10: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA-512-256 integrity
215 | | [Documentation]
216 | | ... | [Top] TG-DUT1.
217 | | ... | [Ref] RFC4303.
218 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
219 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-512-256 in transport
220 | | ... | mode.
221 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
222 | | [Tags] | SKIP_PATCH
223 | | ${encr_alg}= | Crypto Alg AES CBC 128
224 | | ${auth_alg}= | Integ Alg SHA 512 256
225 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
226 | | When VPP Setup IPsec Manual Keyed Connection
227 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
228 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
229 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
230 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
231 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
232
233 | TC11: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA-512-256 integrity
234 | | [Documentation]
235 | | ... | [Top] TG-DUT1.
236 | | ... | [Ref] RFC4303.
237 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
238 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-512-256 in transport
239 | | ... | mode.
240 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
241 | | [Tags] | SKIP_PATCH
242 | | ${encr_alg}= | Crypto Alg AES CBC 192
243 | | ${auth_alg}= | Integ Alg SHA 512 256
244 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
245 | | When VPP Setup IPsec Manual Keyed Connection
246 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
247 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${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_tun_ip} | ${dut_tun_ip}
251
252 | TC12: VPP process ESP packet in Transport Mode with AES-CBC-256 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-256 and integrity algorithm SHA-512-256 in transport
258 | | ... | mode.
259 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
260 | | ${encr_alg}= | Crypto Alg AES CBC 256
261 | | ${auth_alg}= | Integ Alg SHA 512 256
262 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
263 | | When VPP Setup IPsec Manual Keyed Connection
264 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
265 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${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_tun_ip} | ${dut_tun_ip}
269
270 | TC13: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity - different encryption alogrithms used
271 | | [Documentation]
272 | | ... | [Top] TG-DUT1.
273 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
274 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
275 | | ... | mode.
276 | | ... | [Ver] Send an ESP packet encrypted by encryption key different from\
277 | | ... | encryption key stored on VPP node from TG to VPP node and expect no\
278 | | ... | response to be received on TG.
279 | | ... | [Ref] RFC4303.
280 | | ${encr_alg}= | Crypto Alg AES CBC 128
281 | | ${auth_alg}= | Integ Alg SHA1 96
282 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
283 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
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_tun_ip} | ${tg_tun_ip}
287 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
288 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
289 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key} | ${tg_spi}
290 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
291
292 | TC14: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity - different integrity alogrithms used
293 | | [Documentation]
294 | | ... | [Top] TG-DUT1.
295 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
296 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
297 | | ... | mode.
298 | | ... | [Ver] Send an ESP packet authenticated by integrity key different\
299 | | ... | from integrity key stored on VPP node from TG to VPP node and expect\
300 | | ... | no 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 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
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_tun_ip} | ${tg_tun_ip}
309 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
310 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
311 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key2} | ${tg_spi}
312 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
313
314 | TC15: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity - different encryption and 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 transport\
319 | | ... | mode.
320 | | ... | [Ver] Send an ESP packet authenticated by integrity key and encrypted\
321 | | ... | by encryption key different from integrity and encryption keys stored\
322 | | ... | on VPP node from TG to VPP node and expect no response to be received\
323 | | ... | 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 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
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_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_key2} | ${auth_alg} | ${auth_key2} | ${tg_spi}
336 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
337
338 | TC16: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity with update SA keys
339 | | [Documentation]
340 | | ... | [Top] TG-DUT1.
341 | | ... | [Ref] RFC4303.
342 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
343 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
344 | | ... | mode. Then update SA keys - use new keys.
345 | | ... | [Ver] Send and receive ESP packet between TG and VPP node before\
346 | | ... | and after SA keys update.
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 | | When VPP Setup IPsec Manual Keyed Connection
351 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
352 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
353 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
354 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
355 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
356 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
357 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
358 | | When VPP Update IPsec SA Keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
359 | | ... | ${new_encr_key} | ${new_auth_key}
360 | | Then Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
361 | | ... | ${encr_alg} | ${new_encr_key} | ${auth_alg} | ${new_auth_key}
362 | | ... | ${tg_spi} | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
363
364 | TC17: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity with update SA keys - different encryption alogrithms used
365 | | [Documentation]
366 | | ... | [Top] TG-DUT1.
367 | | ... | [Ref] RFC4303.
368 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
369 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
370 | | ... | mode. Then update SA keys - use new keys.
371 | | ... | [Ver] Send an ESP packet encrypted by encryption key different from\
372 | | ... | encryption key stored on VPP node from TG to VPP node and expect no\
373 | | ... | response to be received on TG before 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_tun_ip} | ${tg_tun_ip}
380 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
381 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
382 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
383 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key} | ${tg_spi}
384 | | ... | ${dut_spi} | ${tg_tun_ip} | ${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 Run Keyword And Expect Error | ESP packet Rx timeout
390 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
391 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${new_auth_key} | ${tg_spi}
392 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
393
394 | TC18: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity with update SA keys - different integrity 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 transport\
400 | | ... | mode. Then update SA keys - use new keys.
401 | | ... | [Ver] Send an ESP packet authenticated by integrity key different\
402 | | ... | from integrity key stored on VPP node from TG to VPP node and expect\
403 | | ... | no 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_tun_ip} | ${tg_tun_ip}
410 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
411 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
412 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
413 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key2} | ${tg_spi}
414 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
415 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
416 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
417 | | When VPP Update IPsec SA Keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
418 | | ... | ${new_encr_key} | ${new_auth_key}
419 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
420 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
421 | | ... | ${encr_alg} | ${new_encr_key} | ${auth_alg} | ${auth_key2} | ${tg_spi}
422 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
423
424 | TC19: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity with update SA keys - different encryption and 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 transport\
430 | | ... | mode. Then update SA keys - use new keys.
431 | | ... | [Ver] Send an ESP packet authenticated by integrity key and encrypted\
432 | | ... | by encryption key different from integrity and encryption keys stored\
433 | | ... | on VPP node from TG to VPP node and expect no response to be received\
434 | | ... | on TG before and after SA keys update.
435 | | ${encr_alg}= | Crypto Alg AES CBC 128
436 | | ${auth_alg}= | Integ Alg SHA1 96
437 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
438 | | When VPP Setup IPsec Manual Keyed Connection
439 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
440 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
441 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
442 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
443 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
444 | | ... | Send And Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
445 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key2} | ${tg_spi}
446 | | ... | ${dut_spi} | ${tg_tun_ip} | ${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} | ${encr_key2} | ${auth_alg} | ${auth_key2} | ${tg_spi}
454 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
455
456 *** Keywords ***
457 | Get Second Random String
458 | | [Arguments] | ${req_alg} | ${req_type}
459 | | ${req_key_len}= | Run Keyword | Get ${req_type} Alg Key Len | ${req_alg}
460 | | ${key}= | Set Variable If | '${req_type}' == 'Crypto' | ${encr_key}
461 | | ...                       | '${req_type}' == 'Integ' | ${auth_key}
462 | | :FOR | ${index} | IN RANGE | 100
463 | | | ${req_key}= | Generate Random String | ${req_key_len}
464 | | | Return From Keyword If | '${req_key}' != '${key}' | ${req_key}