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