018447fe2d8524c916460406bdd8de5c09dd3558
[csit.git] / tests / func / ipsec / ipsec_transport_mode_ipv4.robot
1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Resource | resources/libraries/robot/ipsec.robot
16 | Library | resources.libraries.python.Trace
17 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | 3_NODE_DOUBLE_LINK_TOPO
18 | ...        | VM_ENV | HW_ENV
19 | Test Setup | Run Keywords | Setup all DUTs before test
20 | ...        | AND          | Setup all TGs before traffic script
21 | ...        | AND          | Setup Topology for IPv4 IPsec testing
22 | Test Teardown | Run Keywords | VPP IPsec Show | ${dut_node}
23 | ...           | AND          | Show Packet Trace on All DUTs | ${nodes}
24 | ...           | AND          | Show vpp trace dump on all DUTs
25 | Documentation | *IPv4 IPsec transport mode test suite.*
26 | ...
27 | ... | *[Top] Network topologies:* TG-DUT1 2-node topology with one link\
28 | ... | between nodes.
29 | ... | *[Cfg] DUT configuration:* On DUT1 create loopback interface, configure\
30 | ... | loopback an physical interface IPv4 addresses, static ARP record, route\
31 | ... | and IPsec manual keyed connection in transport mode.
32 | ... | *[Ver] TG verification:* ESP packet is sent from TG to DUT1. ESP packet\
33 | ... | is received on TG from DUT1.
34 | ... | *[Ref] Applicable standard specifications:* RFC4303.
35
36 *** Variables ***
37 | ${tg_spi}= | ${1000}
38 | ${dut_spi}= | ${1001}
39 | ${ESP_PROTO}= | ${50}
40 | ${tg_if_ip4}= | 192.168.100.2
41 | ${dut_if_ip4}= | 192.168.100.3
42 | ${tg_lo_ip4}= | 192.168.3.3
43 | ${dut_lo_ip4}= | 192.168.4.4
44 | ${ip4_plen}= | ${24}
45
46 *** Test Cases ***
47 | TC01: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity
48 | | [Documentation]
49 | | ... | [Top] TG-DUT1.
50 | | ... | [Ref] RFC4303.
51 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
52 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport
53 | | ... | mode.
54 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
55 | | ${encr_alg}= | Crypto Alg AES CBC 128
56 | | ${auth_alg}= | Integ Alg SHA1 96
57 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
58 | | When VPP Setup IPsec Manual Keyed Connection
59 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
60 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
61 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
62 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
63 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
64
65 | TC02: VPP process ESP packet in Transport 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 transport
71 | | ... | mode.
72 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
73 | | [Tags] | SKIP_PATCH
74 | | ${encr_alg}= | Crypto Alg AES CBC 192
75 | | ${auth_alg}= | Integ Alg SHA1 96
76 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
77 | | When VPP Setup IPsec Manual Keyed Connection
78 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
79 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${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_tun_ip} | ${dut_tun_ip}
83
84 | TC03: VPP process ESP packet in Transport Mode with AES-CBC-256 encryption and SHA1-96 integrity
85 | | [Documentation]
86 | | ... | [Top] TG-DUT1.
87 | | ... | [Ref] RFC4303.
88 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
89 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA1-96 in transport
90 | | ... | 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_tun_ip} | ${tg_tun_ip}
99 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
100 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
101 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
102
103 | TC04: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA-256-128 integrity
104 | | [Documentation]
105 | | ... | [Top] TG-DUT1.
106 | | ... | [Ref] RFC4303.
107 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
108 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-256-128 in transport
109 | | ... | mode.
110 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
111 | | [Tags] | SKIP_PATCH
112 | | ${encr_alg}= | Crypto Alg AES CBC 128
113 | | ${auth_alg}= | Integ Alg SHA 256 128
114 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
115 | | When VPP Setup IPsec Manual Keyed Connection
116 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
117 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
118 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
119 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
120 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
121
122 | TC05: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA-256-128 integrity
123 | | [Documentation]
124 | | ... | [Top] TG-DUT1.
125 | | ... | [Ref] RFC4303.
126 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
127 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-256-128 in transport
128 | | ... | mode.
129 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
130 | | ${encr_alg}= | Crypto Alg AES CBC 192
131 | | ${auth_alg}= | Integ Alg SHA 256 128
132 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
133 | | When VPP Setup IPsec Manual Keyed Connection
134 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
135 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
136 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
137 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
138 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
139
140 | TC06: VPP process ESP packet in Transport Mode with AES-CBC-256 encryption and SHA-256-128 integrity
141 | | [Documentation]
142 | | ... | [Top] TG-DUT1.
143 | | ... | [Ref] RFC4303.
144 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
145 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-256-128 in transport
146 | | ... | mode.
147 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
148 | | [Tags] | SKIP_PATCH
149 | | ${encr_alg}= | Crypto Alg AES CBC 256
150 | | ${auth_alg}= | Integ Alg SHA 256 128
151 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
152 | | When VPP Setup IPsec Manual Keyed Connection
153 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
154 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
155 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
156 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
157 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
158
159 | TC07: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA-384-192 integrity
160 | | [Documentation]
161 | | ... | [Top] TG-DUT1.
162 | | ... | [Ref] RFC4303.
163 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
164 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-384-192 in transport
165 | | ... | mode.
166 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
167 | | [Tags] | SKIP_PATCH
168 | | ${encr_alg}= | Crypto Alg AES CBC 128
169 | | ${auth_alg}= | Integ Alg SHA 384 192
170 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
171 | | When VPP Setup IPsec Manual Keyed Connection
172 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
173 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
174 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
175 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
176 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
177
178 | TC08: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA-384-192 integrity
179 | | [Documentation]
180 | | ... | [Top] TG-DUT1.
181 | | ... | [Ref] RFC4303.
182 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
183 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-384-192 in transport
184 | | ... | mode.
185 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
186 | | [Tags] | SKIP_PATCH
187 | | ${encr_alg}= | Crypto Alg AES CBC 192
188 | | ${auth_alg}= | Integ Alg SHA 384 192
189 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
190 | | When VPP Setup IPsec Manual Keyed Connection
191 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
192 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
193 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
194 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
195 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
196
197 | TC09: VPP process ESP packet in Transport Mode with AES-CBC-256 encryption and SHA-384-192 integrity
198 | | [Documentation]
199 | | ... | [Top] TG-DUT1.
200 | | ... | [Ref] RFC4303.
201 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
202 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-384-192 in transport
203 | | ... | mode.
204 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
205 | | ${encr_alg}= | Crypto Alg AES CBC 256
206 | | ${auth_alg}= | Integ Alg SHA 384 192
207 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
208 | | When VPP Setup IPsec Manual Keyed Connection
209 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
210 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
211 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
212 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
213 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
214
215 | TC10: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA-512-256 integrity
216 | | [Documentation]
217 | | ... | [Top] TG-DUT1.
218 | | ... | [Ref] RFC4303.
219 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
220 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-512-256 in transport
221 | | ... | mode.
222 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
223 | | [Tags] | SKIP_PATCH
224 | | ${encr_alg}= | Crypto Alg AES CBC 128
225 | | ${auth_alg}= | Integ Alg SHA 512 256
226 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
227 | | When VPP Setup IPsec Manual Keyed Connection
228 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
229 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
230 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
231 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
232 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
233
234 | TC11: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA-512-256 integrity
235 | | [Documentation]
236 | | ... | [Top] TG-DUT1.
237 | | ... | [Ref] RFC4303.
238 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
239 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-512-256 in transport
240 | | ... | mode.
241 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
242 | | [Tags] | SKIP_PATCH
243 | | ${encr_alg}= | Crypto Alg AES CBC 192
244 | | ${auth_alg}= | Integ Alg SHA 512 256
245 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
246 | | When VPP Setup IPsec Manual Keyed Connection
247 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
248 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
249 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
250 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
251 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
252
253 | TC12: VPP process ESP packet in Transport Mode with AES-CBC-256 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-256 and integrity algorithm SHA-512-256 in transport
259 | | ... | mode.
260 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
261 | | ${encr_alg}= | Crypto Alg AES CBC 256
262 | | ${auth_alg}= | Integ Alg SHA 512 256
263 | | Given IPsec Generate Keys | ${encr_alg} | ${auth_alg}
264 | | When VPP Setup IPsec Manual Keyed Connection
265 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
266 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
267 | | Then Send and Receive IPsec Packet | ${tg_node} | ${tg_if} | ${dut_if_mac}
268 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
269 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.