CSIT-662: KWI - KW renaming
[csit.git] / tests / func / honeycomb / mgmt-cfg-pluginacl-apihc-apivat-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 *** Variables ***
15 | &{if_settings}= | enabled=True
16 # Bridge domain settings
17 | ${bd_name}= | bd1
18 | &{bd_settings}= | flood=${True} | forward=${True} | learn=${True}
19 | ... | unknown-unicast-flood=${True} | arp-termination=${False}
20 | &{bd_if_settings}= | split_horizon_group=${0} | bvi=${False}
21 # Names for AC lists
22 | ${acl_name_macip}= | macip
23 | ${acl_name_l3_ip4}= | acl_l3_ip4
24 | ${acl_name_l3_ip6}= | acl_l3_ip6
25 | ${acl_name_l4}= | acl_l4
26 | ${acl_name_mixed}= | acl_mixed
27 | ${acl_name_icmp}= | acl_icmp
28 | ${acl_name_icmpv6}= | acl_icmpv6
29 | ${acl_name_reflex}= | acl_reflex
30
31 *** Settings ***
32 | Resource | resources/libraries/robot/default.robot
33 | Resource | resources/libraries/robot/honeycomb/honeycomb.robot
34 | Resource | resources/libraries/robot/honeycomb/interfaces.robot
35 | Resource | resources/libraries/robot/honeycomb/bridge_domain.robot
36 | Resource | resources/libraries/robot/honeycomb/access_control_lists.robot
37 | Resource | resources/libraries/robot/testing_path.robot
38 | Resource | resources/libraries/robot/traffic.robot
39 | Library | resources.libraries.python.honeycomb.HcAPIKwACL.ACLKeywords
40 | Library | resources.libraries.python.Trace
41 | Library | resources.libraries.python.IPv4Setup
42 | Library | resources.libraries.python.IPv4Util
43 | Library | resources.libraries.python.IPv6Util
44 | Library | resources.libraries.python.Routing
45 | Test Setup | Clear Packet Trace on All DUTs | ${nodes}
46 | Suite Teardown
47 | ... | Restart Honeycomb and VPP | ${node}
48 | Documentation | *Honeycomb access control lists test suite for ACL plugin.*
49 | Force Tags | HC_FUNC
50
51 *** Test Cases ***
52 | TC01: ACL MAC filtering through plugin-acl node - bridged
53 | | [Documentation]
54 | | ... | [Top] TG=DUT1=TG.
55 | | ... | [Enc] Eth-IPv4-TCP.
56 | | ... | [Cfg] (Using Honeycomb API) On DUT1 bridge both interfaces to TG\
57 | | ... | and configure L2 MAC ACL on ingress interface.
58 | | ... | [Ver] Send simple TCP packets from one TG interface to the other,\
59 | | ... | using different MACs. Receive all packets except those with\
60 | | ... | MACs in the filtered ranges.
61 | | [Teardown] | Bridged ACL test teardown
62 | | Given Setup Interfaces And Bridge Domain For plugin-acl Test
63 | | ... | macip | ${acl_name_macip}
64 | | When Honeycomb Creates ACL Chain Through ACL plugin
65 | | ... | ${dut_node} | ${acl_name_macip} | ${acl_settings} | macip=${True}
66 | | And Honeycomb Assigns plugin-acl Chain To Interface
67 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${acl_name_macip}
68 | | ... | ingress | macip=${True}
69 | | When Send TCP or UDP packet and verify received packet | ${tg_node} | ${src_ip} | ${dst_ip}
70 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
71 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
72 | | ... | TCP | ${src_port} | ${dst_port}
73 | | And Run Keyword And Expect Error | TCP/UDP Rx timeout
74 | | ... | Send TCP or UDP packet and verify received packet | ${tg_node} | ${src_ip} | ${dst_ip}
75 | | ... | ${tg_to_dut_if1} | ${classify_src}
76 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
77 | | ... | TCP | ${src_port} | ${dst_port}
78 | | And Run Keyword And Expect Error | TCP/UDP Rx timeout
79 | | ... | Send TCP or UDP packet and verify received packet | ${tg_node} | ${src_ip} | ${dst_ip}
80 | | ... | ${tg_to_dut_if1} | ${classify_src2}
81 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
82 | | ... | TCP | ${src_port} | ${dst_port}
83
84 | TC02: ACL IPv4 filtering through plugin-acl node - bridged
85 | | [Documentation]
86 | | ... | [Top] TG=DUT1=TG.
87 | | ... | [Enc] Eth-IPv4-TCP.
88 | | ... | [Cfg] (Using Honeycomb API) On DUT1 bridge both interfaces to TG\
89 | | ... | and configure L3 IPv4 ACL on ingress interface with src/dst IP
90 | | ... | and protocol number.
91 | | ... | [Ver] Send simple TCP and UDP packets from one TG interface\
92 | | ... | to the other, using different IPv4 IPs. Receive all packets except\
93 | | ... | those with IPs in the filtered ranges and UDP protocol payload.
94 | | [Teardown] | Bridged ACL test teardown
95 | | Given Setup Interfaces And Bridge Domain For plugin-acl Test
96 | | ... | l3_ip4 | ${acl_name_l3_ip4}
97 | | When Honeycomb Creates ACL Chain Through ACL plugin
98 | | ... | ${dut_node} | ${acl_name_l3_ip4} | ${acl_settings}
99 | | And Honeycomb Assigns plugin-acl Chain To Interface
100 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${acl_name_l3_ip4} | ingress
101 | | Then Send TCP or UDP packet and verify received packet | ${tg_node}
102 | | ... | ${src_ip} | ${dst_ip}
103 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
104 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
105 | | ... | UDP | ${src_port} | ${dst_port}
106 | | And Send TCP or UDP packet and verify received packet | ${tg_node}
107 | | ... | ${classify_src} | ${classify_dst}
108 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
109 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
110 | | ... | TCP | ${src_port} | ${dst_port}
111 | | And Run Keyword And Expect Error | TCP/UDP Rx timeout
112 | | ... | Send TCP or UDP packet and verify received packet | ${tg_node}
113 | | ... | ${classify_src} | ${classify_dst}
114 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
115 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
116 | | ... | UDP | ${src_port} | ${dst_port}
117
118 | TC03: ACL IPv6 filtering through plugin-acl node - bridged
119 | | [Documentation]
120 | | ... | [Top] TG=DUT1=TG.
121 | | ... | [Enc] Eth-IPv6-TCP.
122 | | ... | [Cfg] (Using Honeycomb API) On DUT1 bridge both interfaces to TG\
123 | | ... | and configure L3 IPv6 ACL on ingress interface with src/dst IP
124 | | ... | and protocol number.
125 | | ... | [Ver] Send simple TCP and UDP packets from one TG interface\
126 | | ... | to the other, using different IPv6 IPs. Receive all packets except\
127 | | ... | those with IPs in the filtered ranges and UDP protocol payload.
128 | | [Teardown] | Bridged ACL test teardown
129 | | Given Setup interfaces and bridge domain for plugin-acl test
130 | | ... | l3_ip6 | ${acl_name_l3_ip6}
131 | | When Honeycomb Creates ACL Chain Through ACL plugin
132 | | ... | ${dut_node} | ${acl_name_l3_ip6} | ${acl_settings}
133 | | And Honeycomb Assigns plugin-acl Chain To Interface
134 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${acl_name_l3_ip6} | ingress
135 | | Then Send TCP or UDP packet and verify received packet | ${tg_node}
136 | | ... | ${src_ip} | ${dst_ip}
137 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
138 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
139 | | ... | UDP | ${src_port} | ${dst_port}
140 | | And Send TCP or UDP packet and verify received packet | ${tg_node}
141 | | ... | ${classify_src} | ${classify_dst}
142 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
143 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
144 | | ... | TCP | ${src_port} | ${dst_port}
145 | | And Run Keyword And Expect Error | TCP/UDP Rx timeout
146 | | ... | Send TCP or UDP packet and verify received packet | ${tg_node}
147 | | ... | ${classify_src} | ${classify_dst}
148 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
149 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
150 | | ... | UDP | ${src_port} | ${dst_port}
151
152 | TC04: ACL port filtering through plugin-acl node - bridged
153 | | [Documentation]
154 | | ... | [Top] TG=DUT1=TG.
155 | | ... | [Enc] Eth-IPv4-TCP.
156 | | ... | [Cfg] (Using Honeycomb API) On DUT1 bridge both interfaces to TG\
157 | | ... | and and configure L4 port ACL on ingress interface
158 | | ... | with src/dst port ranges.
159 | | ... | [Ver] Send simple TCP and UDP packets from one TG interface\
160 | | ... | to the other, using different ports. Receive all packets except\
161 | | ... | those with ports in the filtered ranges.
162 | | [Teardown] | Bridged ACL test teardown
163 | | Given Setup interfaces and bridge domain for plugin-acl test
164 | | ... | L4 | ${acl_name_l4}
165 | | When Honeycomb Creates ACL Chain Through ACL plugin
166 | | ... | ${dut_node} | ${acl_name_l4} | ${acl_settings}
167 | | And Honeycomb Assigns plugin-acl Chain To Interface
168 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${acl_name_l4} | ingress
169 | | Then Send TCP or UDP packet and verify received packet | ${tg_node}
170 | | ... | ${src_ip} | ${dst_ip}
171 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
172 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
173 | | ... | TCP | ${src_port} | ${dst_port}
174 | | And Run Keyword And Expect Error | TCP/UDP Rx timeout
175 | | ... | Send TCP or UDP packet and verify received packet | ${tg_node}
176 | | ... | ${src_ip} | ${dst_ip}
177 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
178 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
179 | | ... | TCP | ${classify_src} | ${classify_dst}
180 | | And Run Keyword And Expect Error | TCP/UDP Rx timeout
181 | | ... | Send TCP or UDP packet and verify received packet | ${tg_node}
182 | | ... | ${src_ip} | ${dst_ip}
183 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
184 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
185 | | ... | TCP | ${classify_src+5} | ${classify_dst+5}
186
187 | TC05: ACL filtering with IPv4 address and TCP port in one rule - bridged
188 | | [Documentation]
189 | | ... | [Top] TG=DUT1=TG.
190 | | ... | [Enc] Eth-IPv4-TCP.
191 | | ... | [Cfg] (Using Honeycomb API) On DUT1 bridge both interfaces to TG\
192 | | ... | and configure a mixed rule with src/dst IP, TCP protocol
193 | | ... | and port ranges.
194 | | ... | [Ver] Send simple TCP packets from one TG interface to the other,\
195 | | ... | using IPs and ports. Receive all packets except those with\
196 | | ... | both IPs and ports in the filtered ranges.
197 | | [Teardown] | Bridged ACL test teardown
198 | | Given Setup Interfaces And Bridge Domain For plugin-acl Test
199 | | ... | mixed | ${acl_name_mixed}
200 | | When Honeycomb Creates ACL Chain Through ACL plugin
201 | | ... | ${dut_node} | ${acl_name_mixed} | ${acl_settings}
202 | | And Honeycomb Assigns plugin-acl Chain To Interface
203 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${acl_name_mixed} | ingress
204 | | Then Send TCP or UDP packet and verify received packet | ${tg_node} | ${src_ip} | ${dst_ip}
205 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
206 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
207 | | ... | TCP | ${src_port} | ${dst_port}
208 | | Then Send TCP or UDP packet and verify received packet | ${tg_node}
209 | | ... | ${classify_src_ip} | ${classify_dst_ip}
210 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
211 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
212 | | ... | TCP | ${src_port} | ${dst_port}
213 | | And Run Keyword And Expect Error | TCP/UDP Rx timeout
214 | | ... | Send TCP or UDP packet and verify received packet | ${tg_node}
215 | | ... | ${classify_src_ip} | ${classify_dst_ip}
216 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
217 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
218 | | ... | TCP | ${classify_src_port} | ${classify_dst_port}
219
220 | TC06: ACL ICMP packet filtering - bridged
221 | | [Documentation]
222 | | ... | [Top] TG=DUT1=TG.
223 | | ... | [Enc] Eth-IPv4-ICMP.
224 | | ... | [Cfg] (Using Honeycomb API) On DUT1 bridge both interfaces to TG\
225 | | ... | and configure a ICMP protocol filtering by ICMP type and code.
226 | | ... | [Ver] Send ICMP packets from one TG interface\
227 | | ... | to the other, using different codes and types. Receive all packets\
228 | | ... | except those with types and codes in the filtered ranges.
229 | | [Teardown] | Bridged ACL test teardown
230 | | Given Setup interfaces and bridge domain for plugin-acl test
231 | | ... | icmp | ${acl_name_icmp}
232 | | When Honeycomb Creates ACL Chain Through ACL plugin
233 | | ... | ${dut_node} | ${acl_name_icmp} | ${acl_settings}
234 | | And Honeycomb Assigns plugin-acl Chain To Interface
235 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${acl_name_icmp} | ingress
236 | | Then Send ICMP packet with type and code and verify received packet | ${tg_node}
237 | | ... | ${src_ip} | ${dst_ip}
238 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
239 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
240 | | ... | ${icmp_type} | ${icmp_code}
241 | | Then Send ICMP packet with type and code and verify received packet | ${tg_node}
242 | | ... | ${src_ip} | ${dst_ip}
243 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
244 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
245 | | ... | ${classify_type} | ${icmp_code}
246 | | And Run Keyword And Expect Error | ICMP echo Rx timeout
247 | | ... | Send ICMP packet with type and code and verify received packet | ${tg_node}
248 | | ... | ${src_ip} | ${dst_ip}
249 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
250 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
251 | | ... | ${classify_type} | ${classify_code}
252
253 | TC07: ACL ICMPv6 packet filtering - bridged
254 | | [Documentation]
255 | | ... | [Top] TG=DUT1=TG.
256 | | ... | [Enc] Eth-IPv6-ICMP.
257 | | ... | [Cfg] (Using Honeycomb API) On DUT1 bridge both interfaces to TG\
258 | | ... | and configure a ICMPv6 protocol filtering by ICMPv6 type and code.
259 | | ... | [Ver] Send ICMPv6 packets from one TG interface\
260 | | ... | to the other, using different codes and types. Receive all packets\
261 | | ... | except those with the filtered type and code.
262 | | [Teardown] | Bridged ACL test teardown
263 | | Given Setup interfaces and bridge domain for plugin-acl test
264 | | ... | icmpv6 | ${acl_name_icmpv6}
265 | | When Honeycomb Creates ACL Chain Through ACL plugin
266 | | ... | ${dut_node} | ${acl_name_icmpv6} | ${acl_settings}
267 | | And Honeycomb Assigns plugin-acl Chain To Interface
268 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${acl_name_icmpv6} | ingress
269 | | Then Send ICMP packet with type and code and verify received packet | ${tg_node}
270 | | ... | ${src_ip} | ${dst_ip}
271 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
272 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
273 | | ... | ${icmp_type} | ${icmp_code}
274 | | Then Send ICMP packet with type and code and verify received packet | ${tg_node}
275 | | ... | ${src_ip} | ${dst_ip}
276 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
277 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
278 | | ... | ${classify_type} | ${icmp_code}
279 | | And Run Keyword And Expect Error | ICMP echo Rx timeout
280 | | ... | Send ICMP packet with type and code and verify received packet | ${tg_node}
281 | | ... | ${src_ip} | ${dst_ip}
282 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
283 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
284 | | ... | ${classify_type} | ${classify_code}
285
286 | TC08: ACL reflexive IPv4 filtering through plugin-acl node - bridged
287 | | [Documentation]
288 | | ... | [Top] TG=DUT1=TG.
289 | | ... | [Enc] Eth-IPv4-TCP.
290 | | ... | [Cfg] (Using Honeycomb API) On DUT1 bridge both interfaces to TG,\
291 | | ... | configure a "drop all" ACL on ingress and reflexive ACL on egress.
292 | | ... | [Ver] Send a simple TCP packet to VPP interface 1 and do not receive\
293 | | ... | it back. Then send the packet with reversed src/dst IP address\
294 | | ... | to VPP interface 2 and receive it from interface 1(this should create\
295 | | ... | a reflexive "permit" rule) Finally, send the original packet again\
296 | | ... | and receive it from interface 2.
297 | | [Teardown] | Bridged ACL test teardown
298 | | Given Setup Interfaces And Bridge Domain For plugin-acl Test
299 | | ... | reflex | ${acl_name_reflex}
300 | | When Honeycomb Creates ACL Chain Through ACL plugin
301 | | ... | ${dut_node} | ${acl_name_reflex} | ${acl_settings}
302 | | And Honeycomb Assigns plugin-acl Chain To Interface
303 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${acl_name_reflex} | egress
304 | | And Import Variables | resources/test_data/honeycomb/plugin_acl.py
305 | | ... | block_all | block_all
306 | | When Honeycomb Creates ACL Chain Through ACL plugin
307 | | ... | ${dut_node} | block_all | ${acl_settings}
308 | | And Honeycomb Assigns plugin-acl Chain To Interface
309 | | ... | ${dut_node} | ${dut_to_tg_if1} | block_all | ingress
310 | | And Run Keyword And Expect Error | TCP/UDP Rx timeout
311 | | ... | Send TCP or UDP packet and verify received packet | ${tg_node}
312 | | ... | ${classify_src} | ${classify_dst}
313 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
314 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
315 | | ... | TCP | ${src_port} | ${dst_port}
316 | | And Send TCP or UDP packet and verify received packet | ${tg_node}
317 | | ... | ${classify_dst} | ${classify_src}
318 | | ... | ${tg_to_dut_if2} | ${tg_to_dut_if2_mac}
319 | | ... | ${tg_to_dut_if1} | ${dut_to_tg_if2_mac}
320 | | ... | TCP | ${dst_port} | ${src_port}
321 | | And Send TCP or UDP packet and verify received packet | ${tg_node}
322 | | ... | ${classify_src} | ${classify_dst}
323 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
324 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
325 | | ... | TCP | ${src_port} | ${dst_port}
326
327 # Routing section
328 # ===============
329
330 | TC09: ACL IPv4 filtering through plugin-acl node - routed
331 | | [Documentation]
332 | | ... | [Top] TG=DUT1=TG.
333 | | ... | [Enc] Eth-IPv4-TCP.
334 | | ... | [Cfg] (Using Honeycomb API) On DUT1 set IPv4 addresses on both\
335 | | ... | interfaces to TG, add ARP entry and routes, and configure L3 IPv4 ACL\
336 | | ... | on ingress interface with src/dst IP and protocol.
337 | | ... | [Ver] Send simple TCP and UDP packets from one TG interface\
338 | | ... | to the other, using different IPv4 IPs. Receive all packets except\
339 | | ... | those with IPs in the filtered ranges and UDP protocol payload.
340 | | [Teardown] | Routed ACL test teardown - ipv4
341 | | Given Setup Interface IPs And Routes For IPv4 plugin-acl Test
342 | | ... | l3_ip4 | ${acl_name_l3_ip4}
343 | | When Honeycomb Creates ACL Chain Through ACL plugin
344 | | ... | ${dut_node} | ${acl_name_l3_ip4} | ${acl_settings}
345 | | And Honeycomb Assigns plugin-acl Chain To Interface
346 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${acl_name_l3_ip4} | ingress
347 | | Then Send TCP or UDP packet and verify received packet | ${tg_node}
348 | | ... | ${src_ip} | ${dst_ip}
349 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
350 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
351 | | ... | UDP | ${src_port} | ${dst_port}
352 | | And Send TCP or UDP packet and verify received packet | ${tg_node}
353 | | ... | ${classify_src} | ${classify_dst}
354 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
355 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
356 | | ... | TCP | ${src_port} | ${dst_port}
357 | | And Run Keyword And Expect Error | TCP/UDP Rx timeout
358 | | ... | Send TCP or UDP packet and verify received packet | ${tg_node}
359 | | ... | ${classify_src} | ${classify_dst}
360 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
361 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
362 | | ... | UDP | ${src_port} | ${dst_port}
363
364 | TC10: ACL IPv6 filtering through plugin-acl node - routed
365 | | [Documentation]
366 | | ... | [Top] TG=DUT1=TG.
367 | | ... | [Enc] Eth-IPv6-TCP.
368 | | ... | [Cfg] (Using Honeycomb API) On DUT1 set IPv6 addresses on both\
369 | | ... | interfaces to TG, add IP neighbor entry and routes, and configure\
370 | | ... | L3 IPv6 ACL on ingress interface with src/dst IP and next-header.
371 | | ... | [Ver] Send simple TCP and UDP packets from one TG interface\
372 | | ... | to the other, using different IPv6 IPs. Receive all packets except\
373 | | ... | those with IPs in the filtered ranges and UDP protocol payload.
374 | | [Teardown] | Routed ACL test teardown - ipv6
375 | | Given Configure path in 2-node circular topology
376 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
377 | | And Import Variables | resources/test_data/honeycomb/plugin_acl.py
378 | | ... | L3_IP6 | ${acl_name_l3_ip6}
379 | | And Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if1} | up
380 | | And Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if2} | up
381 | | And Honeycomb sets interface IPv6 address | ${dut_node}
382 | | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip} | ${prefix_length}
383 | | And Honeycomb sets interface IPv6 address | ${dut_node}
384 | | ... | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip} | ${prefix_length}
385 | | And VPP RA suppress link layer | ${dut_node} | ${dut_to_tg_if2}
386 | | And Honeycomb adds interface IPv6 neighbor
387 | | ... | ${node} | ${dut_to_tg_if2} | ${gateway} | ${tg_to_dut_if2_mac}
388 | | And VPP Route Add | ${node} | ${dst_net} | ${prefix_length}
389 | | ... | ${gateway} | interface=${dut_to_tg_if2} | use_sw_index=False
390 | | And VPP Route Add | ${node} | ${classify_dst_net} | ${prefix_length}
391 | | ... | ${gateway} | interface=${dut_to_tg_if2} | use_sw_index=False
392 | | When Honeycomb Creates ACL Chain Through ACL plugin
393 | | ... | ${dut_node} | ${acl_name_l3_ip6} | ${acl_settings}
394 | | And Honeycomb Assigns plugin-acl Chain To Interface
395 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${acl_name_l3_ip6} | ingress
396 | | Then Send TCP or UDP packet and verify received packet | ${tg_node}
397 | | ... | ${src_ip} | ${dst_ip}
398 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
399 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
400 | | ... | UDP | ${src_port} | ${dst_port}
401 | | And Send TCP or UDP packet and verify received packet | ${tg_node}
402 | | ... | ${classify_src} | ${classify_dst}
403 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
404 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
405 | | ... | TCP | ${src_port} | ${dst_port}
406 | | And Run Keyword And Expect Error | TCP/UDP Rx timeout
407 | | ... | Send TCP or UDP packet and verify received packet | ${tg_node}
408 | | ... | ${classify_src} | ${classify_dst}
409 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
410 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
411 | | ... | UDP | ${src_port} | ${dst_port}
412
413 | TC11: ACL port filtering through plugin-acl node - routed
414 | | [Documentation]
415 | | ... | [Top] TG=DUT1=TG.
416 | | ... | [Enc] Eth-IPv4-TCP.
417 | | ... | [Cfg] (Using Honeycomb API) On DUT1 set IPv4 addresses on both\
418 | | ... | interfaces to TG, add ARP entry and routes, and configure L4 port ACL\
419 | | ... | on ingress interface with src/dst port ranges.
420 | | ... | [Ver] Send simple TCP and UDP packets from one TG interface\
421 | | ... | to the other, using different ports. Receive all packets except\
422 | | ... | those with ports in the filtered ranges.
423 | | [Teardown] | Routed ACL test teardown - ipv4
424 | | Given Setup Interface IPs And Routes For IPv4 plugin-acl Test
425 | | ... | L4 | ${acl_name_l4}
426 | | When Honeycomb Creates ACL Chain Through ACL plugin
427 | | ... | ${dut_node} | ${acl_name_l4} | ${acl_settings}
428 | | And Honeycomb Assigns plugin-acl Chain To Interface
429 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${acl_name_l4} | ingress
430 | | Then Send TCP or UDP packet and verify received packet | ${tg_node}
431 | | ... | ${src_ip} | ${dst_ip}
432 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
433 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
434 | | ... | TCP | ${src_port} | ${dst_port}
435 | | And Run Keyword And Expect Error | TCP/UDP Rx timeout
436 | | ... | Send TCP or UDP packet and verify received packet | ${tg_node}
437 | | ... | ${src_ip} | ${dst_ip}
438 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
439 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
440 | | ... | TCP | ${classify_src} | ${classify_dst}
441 | | And Run Keyword And Expect Error | TCP/UDP Rx timeout
442 | | ... | Send TCP or UDP packet and verify received packet | ${tg_node}
443 | | ... | ${src_ip} | ${dst_ip}
444 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
445 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
446 | | ... | TCP | ${classify_src+5} | ${classify_dst+5}
447
448 | TC12: ACL filtering with IPv4 address and TCP port in one rule - routed
449 | | [Documentation]
450 | | ... | [Top] TG=DUT1=TG.
451 | | ... | [Enc] Eth-IPv4-TCP.
452 | | ... | [Cfg] (Using Honeycomb API) On DUT1 set IPv4 addresses on both\
453 | | ... | interfaces to TG, add ARP entry and routes and configure a mixed
454 | | ... | rule with src/dst IP, TCP protocol and port ranges.
455 | | ... | [Ver] Send simple TCP packets from one TG interface to the other,\
456 | | ... | using IPs and ports. Receive all packets except those with\
457 | | ... | both IPs and ports in the filtered ranges.
458 | | [Teardown] | Routed ACL test teardown - ipv4
459 | | Given Setup Interface IPs And Routes For IPv4 plugin-acl Test
460 | | ... | mixed | ${acl_name_mixed}
461 | | When Honeycomb Creates ACL Chain Through ACL plugin
462 | | ... | ${dut_node} | ${acl_name_mixed} | ${acl_settings}
463 | | And Honeycomb Assigns plugin-acl Chain To Interface
464 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${acl_name_mixed} | ingress
465 | | Then Send TCP or UDP packet and verify received packet | ${tg_node} | ${src_ip} | ${dst_ip}
466 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
467 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
468 | | ... | TCP | ${src_port} | ${dst_port}
469 | | Then Send TCP or UDP packet and verify received packet | ${tg_node}
470 | | ... | ${classify_src_ip} | ${classify_dst_ip}
471 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
472 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
473 | | ... | TCP | ${src_port} | ${dst_port}
474 | | And Run Keyword And Expect Error | TCP/UDP Rx timeout
475 | | ... | Send TCP or UDP packet and verify received packet | ${tg_node}
476 | | ... | ${classify_src_ip} | ${classify_dst_ip}
477 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
478 | | ... | ${tg_to_dut_if2} | ${dst_mac}
479 | | ... | TCP | ${classify_src_port} | ${classify_dst_port}
480
481 | TC13: ACL ICMP packet filtering - routed
482 | | [Documentation]
483 | | ... | [Top] TG=DUT1=TG.
484 | | ... | [Enc] Eth-IPv4-TCP.
485 | | ... | [Cfg] (Using Honeycomb API) On DUT1 set IPv4 addresses on both\
486 | | ... | interfaces to TG, add ARP entry and routes, and configure ICMP ACL\
487 | | ... | on ingress interface with ICMP type and code.
488 | | ... | [Ver] Send ICMP packets from one TG interface\
489 | | ... | to the other, using different codes and types. Receive all packets\
490 | | ... | except those with the filtered type and code.
491 | | [Teardown] | Routed ACL test teardown - ipv4
492 | | Given Setup Interface IPs And Routes For IPv4 plugin-acl Test
493 | | ... | icmp | ${acl_name_icmp}
494 | | When Honeycomb Creates ACL Chain Through ACL plugin
495 | | ... | ${dut_node} | ${acl_name_icmp} | ${acl_settings}
496 | | And Honeycomb Assigns plugin-acl Chain To Interface
497 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${acl_name_icmp} | ingress
498 | | Then Send ICMP packet with type and code and verify received packet | ${tg_node}
499 | | ... | ${src_ip} | ${dst_ip}
500 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
501 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
502 | | ... | ${icmp_type} | ${icmp_code}
503 | | Then Send ICMP packet with type and code and verify received packet | ${tg_node}
504 | | ... | ${src_ip} | ${dst_ip}
505 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
506 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
507 | | ... | ${classify_type} | ${icmp_code}
508 | | And Run Keyword And Expect Error | ICMP echo Rx timeout
509 | | ... | Send ICMP packet with type and code and verify received packet | ${tg_node}
510 | | ... | ${src_ip} | ${dst_ip}
511 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
512 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
513 | | ... | ${classify_type} | ${classify_code}
514
515 | TC14: ACL ICMPv6 packet filtering - routed
516 | | [Documentation]
517 | | ... | [Top] TG=DUT1=TG.
518 | | ... | [Enc] Eth-IPv4-TCP.
519 | | ... | [Cfg] (Using Honeycomb API) On DUT1 set IPv6 addresses on both\
520 | | ... | interfaces to TG, add ARP entry and routes, and configure ICMP ACL\
521 | | ... | on ingress interface with ICMPv6 type and code.
522 | | ... | [Ver] Send ICMPv6 packets from one TG interface\
523 | | ... | to the other, using different codes and types. Receive all packets\
524 | | ... | except those with the filtered type and code.
525 | | [Teardown] | Routed ACL test teardown - ipv6
526 | | Given Configure path in 2-node circular topology
527 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
528 | | And Import Variables | resources/test_data/honeycomb/plugin_acl.py
529 | | ... | icmpv6 | ${acl_name_icmpv6}
530 | | And Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if1} | up
531 | | And Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if2} | up
532 | | And Honeycomb sets interface IPv6 address | ${dut_node}
533 | | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip} | ${prefix_length}
534 | | And Honeycomb sets interface IPv6 address | ${dut_node}
535 | | ... | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip} | ${prefix_length}
536 | | And Honeycomb adds interface IPv6 neighbor
537 | | ... | ${node} | ${dut_to_tg_if2} | ${gateway} | ${tg_to_dut_if2_mac}
538 | | And VPP RA suppress link layer | ${dut_node} | ${dut_to_tg_if2}
539 | | And VPP Route Add | ${node} | ${dst_net} | ${prefix_length}
540 | | ... | ${gateway} | interface=${dut_to_tg_if2} | use_sw_index=False
541 | | And VPP Route Add | ${node} | ${classify_dst_net} | ${prefix_length}
542 | | ... | ${gateway} | interface=${dut_to_tg_if2} | use_sw_index=False
543 | | When Honeycomb Creates ACL Chain Through ACL plugin
544 | | ... | ${dut_node} | ${acl_name_icmpv6} | ${acl_settings}
545 | | And Honeycomb Assigns plugin-acl Chain To Interface
546 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${acl_name_icmpv6} | ingress
547 | | Then Send ICMP packet with type and code and verify received packet | ${tg_node}
548 | | ... | ${src_ip} | ${dst_ip}
549 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
550 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
551 | | ... | ${icmp_type} | ${icmp_code}
552 | | Then Send ICMP packet with type and code and verify received packet | ${tg_node}
553 | | ... | ${src_ip} | ${dst_ip}
554 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
555 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
556 | | ... | ${classify_type} | ${icmp_code}
557 | | And Run Keyword And Expect Error | ICMP echo Rx timeout
558 | | ... | Send ICMP packet with type and code and verify received packet | ${tg_node}
559 | | ... | ${src_ip} | ${dst_ip}
560 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
561 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
562 | | ... | ${classify_type} | ${classify_code}
563
564 | TC15: ACL reflexive IPv4 filtering through plugin-acl node - routed
565 | | [Documentation]
566 | | ... | [Top] TG=DUT1=TG.
567 | | ... | [Enc] Eth-IPv4-TCP.
568 | | ... | [Cfg] (Using Honeycomb API) On DUT1 set IPv4 addresses on both\
569 | | ... | interfaces to TG, add ARP entries and routes,\
570 | | ... | configure a "drop all" ACL on ingress and reflexive ACL on egress.
571 | | ... | [Ver] Send a simple TCP packet to VPP interface 1 and do not receive\
572 | | ... | it back. Then send the packet with reversed src/dst IP address\
573 | | ... | to VPP interface 2 and receive it from interface 1(this should create\
574 | | ... | a reflexive "permit" rule) Finally, send the original packet again\
575 | | ... | and receive it from interface 2.
576 | | [Teardown] | Routed ACL test teardown - ipv4
577 | | Given Setup Interface IPs And Routes For IPv4 plugin-acl Test
578 | | ... | reflex | ${acl_name_reflex}
579 | | And Add ARP on DUT
580 | | ... | ${node} | ${dut_to_tg_if1} | ${gateway2} | ${tg_to_dut_if1_mac}
581 | | And VPP Route Add
582 | | ... | ${node} | ${src_net} | ${prefix_length} | ${gateway2}
583 | | ... | interface=${dut_to_tg_if1} | use_sw_index=False
584 | | And VPP Route Add
585 | | ... | ${node} | ${classify_src_net} | ${prefix_length} | ${gateway2}
586 | | ... | interface=${dut_to_tg_if1} | use_sw_index=False
587 | | When Honeycomb Creates ACL Chain Through ACL plugin
588 | | ... | ${dut_node} | ${acl_name_reflex} | ${acl_settings}
589 | | And Honeycomb Assigns plugin-acl Chain To Interface
590 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${acl_name_reflex} | egress
591 | | And Import Variables | resources/test_data/honeycomb/plugin_acl.py
592 | | ... | block_all | block_all
593 | | When Honeycomb Creates ACL Chain Through ACL plugin
594 | | ... | ${dut_node} | block_all | ${acl_settings}
595 | | And Honeycomb Assigns plugin-acl Chain To Interface
596 | | ... | ${dut_node} | ${dut_to_tg_if1} | block_all | ingress
597 | | And Run Keyword And Expect Error | TCP/UDP Rx timeout
598 | | ... | Send TCP or UDP packet and verify received packet | ${tg_node}
599 | | ... | ${classify_src} | ${classify_dst}
600 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
601 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
602 | | ... | TCP | ${src_port} | ${dst_port}
603 | | And Send TCP or UDP packet and verify received packet | ${tg_node}
604 | | ... | ${classify_dst} | ${classify_src}
605 | | ... | ${tg_to_dut_if2} | ${tg_to_dut_if2_mac}
606 | | ... | ${tg_to_dut_if1} | ${dut_to_tg_if2_mac}
607 | | ... | TCP | ${dst_port} | ${src_port}
608 | | And Send TCP or UDP packet and verify received packet | ${tg_node}
609 | | ... | ${classify_src} | ${classify_dst}
610 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
611 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
612 | | ... | TCP | ${src_port} | ${dst_port}
613
614 *** Keywords ***
615 | Setup interface IPs and routes for IPv4 plugin-acl test
616 | | [Documentation] | Import test variables, set interfaces up,
617 | | ... | configure IPv4 addresses, add neighbor entry and routes.
618 | | [Arguments] | ${test_data_id} | ${acl_name}
619 | | Configure path in 2-node circular topology
620 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
621 | | Import Variables | resources/test_data/honeycomb/plugin_acl.py
622 | | ... | ${test_data_id} | ${acl_name}
623 | | Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if1} | up
624 | | Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if2} | up
625 | | Honeycomb sets interface IPv4 address with prefix | ${dut_node}
626 | | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip} | ${prefix_length}
627 | | Honeycomb sets interface IPv4 address with prefix | ${dut_node}
628 | | ... | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip} | ${prefix_length}
629 | | And Honeycomb adds interface IPv4 neighbor
630 | | ... | ${node} | ${dut_to_tg_if2} | ${gateway} | ${tg_to_dut_if2_mac}
631 | | VPP Route Add
632 | | ... | ${node} | ${dst_net} | ${prefix_length} | ${gateway}
633 | | ... | interface=${dut_to_tg_if2} | use_sw_index=False
634 | | VPP Route Add
635 | | ... | ${node} | ${classify_dst_net} | ${prefix_length} | ${gateway}
636 | | ... | interface=${dut_to_tg_if2} | use_sw_index=False
637
638 | Setup interfaces and bridge domain for plugin-acl test
639 | | [Documentation] | Import test variables, set interfaces up and bridge them.
640 | | [Arguments] | ${test_data_id} | ${acl_name}
641 | | Configure path in 2-node circular topology
642 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
643 | | Import Variables | resources/test_data/honeycomb/plugin_acl.py
644 | | ... | ${test_data_id} | ${acl_name}
645 | | Honeycomb Sets Interface State | ${dut_node} | ${dut_to_tg_if1} | up
646 | | Honeycomb Sets Interface State | ${dut_node} | ${dut_to_tg_if2} | up
647 | | Honeycomb Creates first L2 Bridge Domain
648 | | ... | ${dut_node} | ${bd_name} | ${bd_settings}
649 | | Honeycomb Adds Interfaces To Bridge Domain
650 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${dut_to_tg_if2}
651 | | ... | ${bd_name} | ${bd_if_settings}
652
653 | Bridged ACL test teardown
654 | | [Documentation] | Log packet trace and ACL settings,
655 | | ... | then clean up bridge domains.
656 | | Show Packet Trace on All DUTs | ${nodes}
657 | | Read plugin-ACL configuration from VAT | ${node}
658 | | Clear plugin-acl Settings | ${node} | ${dut_to_tg_if1}
659 | | Honeycomb Removes All Bridge Domains
660 | | ... | ${node} | ${dut_to_tg_if1} | ${dut_to_tg_if2}
661
662 | Routed ACL test teardown - ipv4
663 | | [Documentation] | Log packet trace and ACL settings,
664 | | ... | then clean up IPv4 addresses and neighbors.
665 | | Show Packet Trace on All DUTs | ${nodes}
666 | | Read plugin-ACL configuration from VAT | ${node}
667 | | Clear plugin-acl Settings | ${node} | ${dut_to_tg_if1}
668 | | Honeycomb removes interface IPv4 addresses | ${node} | ${dut_to_tg_if1}
669 | | Honeycomb clears all interface IPv4 neighbors | ${node} | ${dut_to_tg_if1}
670
671 | Routed ACL test teardown - ipv6
672 | | [Documentation] | Log packet trace and ACL settings,
673 | | ... | then clean up IPv6 addresses and neighbors.
674 | | Show Packet Trace on All DUTs | ${nodes}
675 | | Clear plugin-acl Settings | ${node} | ${dut_to_tg_if1}
676 | | Read plugin-ACL configuration from VAT | ${node}
677 | | Honeycomb removes interface IPv6 addresses | ${node} | ${dut_to_tg_if1}
678 | | Honeycomb clears all interface IPv6 neighbors | ${node} | ${dut_to_tg_if1}