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