43c4a3732c1c4c0d9141f680ee1345a9944065c1
[csit.git] / tests / suites / ipv4 / ipv4_iacl_untagged.robot
1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Resource | resources/libraries/robot/default.robot
16 | Resource | resources/libraries/robot/counters.robot
17 | Resource | resources/libraries/robot/interfaces.robot
18 | Resource | resources/libraries/robot/testing_path.robot
19 | Resource | resources/libraries/robot/ipv4.robot
20 | Resource | resources/libraries/robot/l2_xconnect.robot
21 | Resource | resources/libraries/robot/traffic.robot
22 | Library | resources.libraries.python.Classify.Classify
23 | Library | resources.libraries.python.Trace
24
25 | Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO
26 | Suite Setup | Run Keywords | Setup all TGs before traffic script
27 | ...         | AND          | Update All Interface Data On All Nodes | ${nodes}
28 | Test Setup | Setup all DUTs before test
29 | Test Teardown | Run Keywords | Show packet trace on all DUTs | ${nodes}
30 | ...           | AND          | Vpp Show Errors | ${nodes['DUT1']}
31
32 *** Variables ***
33 | ${dut1_to_tg_ip}= | 192.168.1.1
34 | ${dut1_to_dut2_ip}= | 192.168.2.1
35 | ${dut1_to_dut2_ip_GW}= | 192.168.2.2
36 | ${test_dst_ip}= | 32.0.0.1
37 | ${test_src_ip}= | 16.0.0.1
38 | ${non_drop_dst_ip}= | 33.0.0.1
39 | ${non_drop_src_ip}= | 15.0.0.1
40 | ${prefix_length}= | 24
41 | ${ip_version}= | ip4
42
43 *** Test Cases ***
44 | VPP drops packets based on IPv4 source addresses
45 | | [Documentation] | Create classify table on VPP, add source IP address
46 | | ...             | of traffic into table and setup 'deny' traffic
47 | | ...             | and check if traffic is dropped.
48 | | Given Path for 3-node testing is set
49 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
50 | | And Interfaces in 3-node path are up
51 | | And Set Interface Address | ${dut1_node}
52 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
53 | | And Set Interface Address | ${dut1_node}
54 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
55 | | And Add Arp On Dut
56 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
57 | | ... | ${tg_to_dut2_mac}
58 | | And Vpp Route Add
59 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
60 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2}
61 | | And L2 setup xconnect on DUT
62 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
63 | | Then Send Packet And Check Headers | ${tg_node}
64 | | ... | ${non_drop_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
65 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut2}
66 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
67 | | And Send Packet And Check Headers | ${tg_node}
68 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
69 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut2}
70 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
71 | | ${table_index} | ${skip_n} | ${match_n}= | When Vpp Create Classify Table
72 | | ... | ${dut1_node} | ${ip_version} | src
73 | | And Vpp Configure Classify Session
74 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
75 | | ... | ${ip_version} | src | ${test_src_ip}
76 | | And Vpp Enable Input Acl Interface
77 | | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index}
78 | | Then Send packet from Port to Port should failed | ${tg_node}
79 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
80 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut2}
81 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
82 | | And Send Packet And Check Headers | ${tg_node}
83 | | ... | ${non_drop_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
84 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut2}
85 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
86
87 | VPP drops packets based on IPv4 destination addresses
88 | | [Documentation] | Create classify table on VPP, add destination IP address
89 | | ...             | of traffic into table and setup 'deny' traffic
90 | | ...             | and check if traffic is dropped.
91 | | Given Path for 3-node testing is set
92 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
93 | | And Interfaces in 3-node path are up
94 | | And Set Interface Address | ${dut1_node}
95 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
96 | | And Set Interface Address | ${dut1_node}
97 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
98 | | And Add Arp On Dut
99 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
100 | | ... | ${tg_to_dut2_mac}
101 | | And Vpp Route Add
102 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
103 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2}
104 | | And Vpp Route Add
105 | | ... | ${dut1_node} | ${non_drop_dst_ip} | ${prefix_length}
106 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2}
107 | | And L2 setup xconnect on DUT
108 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
109 | | Then Send Packet And Check Headers | ${tg_node}
110 | | ... | ${test_src_ip} | ${non_drop_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
111 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut2}
112 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
113 | | And Send Packet And Check Headers | ${tg_node}
114 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
115 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut2}
116 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
117 | | ${table_index} | ${skip_n} | ${match_n}= | When Vpp Create Classify Table
118 | | ... | ${dut1_node} | ${ip_version} | dst
119 | | And Vpp Configure Classify Session
120 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
121 | | ... | ${ip_version} | dst | ${test_dst_ip}
122 | | And Vpp Enable Input Acl Interface
123 | | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index}
124 | | Then Send packet from Port to Port should failed | ${tg_node}
125 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
126 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut2}
127 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
128 | | And Send Packet And Check Headers | ${tg_node}
129 | | ... | ${test_src_ip} | ${non_drop_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
130 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut2}
131 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
132
133 | VPP drops packets based on IPv4 src-addr and dst-addr
134 | | [Documentation] | Create classify table on VPP, add source and destination
135 | | ...             | IP address of traffic into table and setup 'deny' traffic
136 | | ...             | and check if traffic is dropped.
137 | | Given Path for 3-node testing is set
138 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
139 | | And Interfaces in 3-node path are up
140 | | And Set Interface Address | ${dut1_node}
141 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
142 | | And Set Interface Address | ${dut1_node}
143 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
144 | | And Add Arp On Dut
145 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
146 | | ... | ${tg_to_dut2_mac}
147 | | And Vpp Route Add
148 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
149 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2}
150 | | And Vpp Route Add
151 | | ... | ${dut1_node} | ${non_drop_dst_ip} | ${prefix_length}
152 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2}
153 | | And L2 setup xconnect on DUT
154 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
155 | | Then Send Packet And Check Headers | ${tg_node}
156 | | ... | ${non_drop_src_ip} | ${non_drop_dst_ip} | ${tg_to_dut1}
157 | | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2}
158 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
159 | | And Send Packet And Check Headers | ${tg_node}
160 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
161 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut2}
162 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
163 | | ${table_index_1} | ${skip_n_1} | ${match_n_1}=
164 | | ... | When Vpp Create Classify Table | ${dut1_node} | ${ip_version} | src
165 | | ${table_index_2} | ${skip_n_2} | ${match_n_2}=
166 | | ... | And Vpp Create Classify Table | ${dut1_node} | ${ip_version} | dst
167 | | And Vpp Configure Classify Session
168 | | ... | ${dut1_node} | deny | ${table_index_1} | ${skip_n_1} | ${match_n_2}
169 | | ... | ${ip_version} | src | ${test_src_ip}
170 | | And Vpp Configure Classify Session
171 | | ... | ${dut1_node} | deny | ${table_index_2} | ${skip_n_2} | ${match_n_2}
172 | | ... | ${ip_version} | dst | ${test_dst_ip}
173 | | And Vpp Enable Input Acl Interface
174 | | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index_1}
175 | | And Vpp Enable Input Acl Interface
176 | | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index_2}
177 | | Then Send packet from Port to Port should failed | ${tg_node}
178 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
179 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut2}
180 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
181 | | And Send Packet And Check Headers | ${tg_node}
182 | | ... | ${non_drop_src_ip} | ${non_drop_dst_ip} | ${tg_to_dut1}
183 | | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2}
184 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
185
186 | VPP drops packets based on IPv4 protocol (TCP)
187 | | [Documentation] | Create classify table on VPP, add mask for TCP port
188 | | ...             | into table and setup 'deny' traffic
189 | | ...             | and check if TCP traffic is dropped.
190 | | Given Path for 3-node testing is set
191 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
192 | | And Interfaces in 3-node path are up
193 | | And Set Interface Address | ${dut1_node}
194 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
195 | | And Set Interface Address | ${dut1_node}
196 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
197 | | And Add Arp On Dut
198 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
199 | | ... | ${tg_to_dut2_mac}
200 | | And Vpp Route Add
201 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
202 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2}
203 | | And L2 setup xconnect on DUT
204 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
205 | | Then Send TCP or UDP packet | ${tg_node}
206 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
207 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20
208 | | And Send TCP or UDP packet | ${tg_node}
209 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
210 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20
211 | | ${table_index} | ${skip_n} | ${match_n}= | When Vpp Create Classify Table Hex
212 | | ... | ${dut1_node} | 0000000000000000000000000000000000000000000000FF
213 | | And Vpp Configure Classify Session Hex
214 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
215 | | ... | 000000000000000000000000000000000000000000000006
216 | | And Vpp Enable Input Acl Interface
217 | | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index}
218 | | Then Send TCP or UDP packet should failed | ${tg_node}
219 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
220 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20
221 | | And Send TCP or UDP packet | ${tg_node}
222 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
223 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20
224
225 | VPP drops packets based on IPv4 protocol (UDP)
226 | | [Documentation] | Create classify table on VPP, add mask for UDP port
227 | | ...             | into table and setup 'deny' traffic
228 | | ...             | and check if UDP traffic is dropped.
229 | | Given Path for 3-node testing is set
230 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
231 | | And Interfaces in 3-node path are up
232 | | And Set Interface Address | ${dut1_node}
233 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
234 | | And Set Interface Address | ${dut1_node}
235 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
236 | | And Add Arp On Dut
237 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
238 | | ... | ${tg_to_dut2_mac}
239 | | And Vpp Route Add
240 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
241 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2}
242 | | And L2 setup xconnect on DUT
243 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
244 | | Then Send TCP or UDP packet | ${tg_node}
245 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
246 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20
247 | | And Send TCP or UDP packet | ${tg_node}
248 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
249 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20
250 | | ${table_index} | ${skip_n} | ${match_n}= | When Vpp Create Classify Table Hex
251 | | ... | ${dut1_node} | 0000000000000000000000000000000000000000000000FF
252 | | And Vpp Configure Classify Session Hex
253 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
254 | | ... | 000000000000000000000000000000000000000000000011
255 | | And Vpp Enable Input Acl Interface
256 | | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index}
257 | | Then Send TCP or UDP packet should failed | ${tg_node}
258 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
259 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20
260 | | And Send TCP or UDP packet | ${tg_node}
261 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
262 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20
263
264 | VPP drops packets based on IPv4 TCP src ports
265 | | [Documentation] | Create classify table on VPP, add source TCP port
266 | | ...             | of traffic into table and setup 'deny' traffic
267 | | ...             | and check if traffic is dropped.
268 | | Given Path for 3-node testing is set
269 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
270 | | And Interfaces in 3-node path are up
271 | | And Set Interface Address | ${dut1_node}
272 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
273 | | And Set Interface Address | ${dut1_node}
274 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
275 | | And Add Arp On Dut
276 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
277 | | ... | ${tg_to_dut2_mac}
278 | | And Vpp Route Add
279 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
280 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2}
281 | | And L2 setup xconnect on DUT
282 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
283 | | Then Send TCP or UDP packet | ${tg_node}
284 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
285 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 110 | 20
286 | | And Send TCP or UDP packet | ${tg_node}
287 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
288 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20
289 | | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | TCP | source
290 | | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 80 | 0
291 | | ${table_index} | ${skip_n} | ${match_n}= | When Vpp Create Classify Table Hex
292 | | ... | ${dut1_node} | ${hex_mask}
293 | | And Vpp Configure Classify Session Hex
294 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
295 | | ... | ${hex_value}
296 | | And Vpp Enable Input Acl Interface
297 | | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index}
298 | | Then Send TCP or UDP packet should failed | ${tg_node}
299 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
300 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20
301 | | And Send TCP or UDP packet | ${tg_node}
302 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
303 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 110 | 20
304
305 | VPP drops packets based on IPv4 TCP dst ports
306 | | [Documentation] | Create classify table on VPP, add destination TCP port
307 | | ...             | of traffic into table and setup 'deny' traffic
308 | | ...             | and check if traffic is dropped.
309 | | Given Path for 3-node testing is set
310 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
311 | | And Interfaces in 3-node path are up
312 | | And Set Interface Address | ${dut1_node}
313 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
314 | | And Set Interface Address | ${dut1_node}
315 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
316 | | And Add Arp On Dut
317 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
318 | | ... | ${tg_to_dut2_mac}
319 | | And Vpp Route Add
320 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
321 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2}
322 | | And L2 setup xconnect on DUT
323 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
324 | | Then Send TCP or UDP packet | ${tg_node}
325 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
326 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 20 | 110
327 | | And Send TCP or UDP packet | ${tg_node}
328 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
329 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 20 | 80
330 | | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | TCP | destination
331 | | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 0 | 80
332 | | ${table_index} | ${skip_n} | ${match_n}= | When Vpp Create Classify Table Hex
333 | | ... | ${dut1_node} | ${hex_mask}
334 | | And Vpp Configure Classify Session Hex
335 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
336 | | ... | ${hex_value}
337 | | And Vpp Enable Input Acl Interface
338 | | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index}
339 | | Then Send TCP or UDP packet should failed | ${tg_node}
340 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
341 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 20 | 80
342 | | And Send TCP or UDP packet | ${tg_node}
343 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
344 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 20 | 110
345
346 | VPP drops packets based on IPv4 TCP src + dst ports
347 | | [Documentation] | Create classify table on VPP, add source and destination
348 | | ...             | TCP port of traffic into table and setup 'deny' traffic
349 | | ...             | and check if traffic is dropped.
350 | | Given Path for 3-node testing is set
351 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
352 | | And Interfaces in 3-node path are up
353 | | And Set Interface Address | ${dut1_node}
354 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
355 | | And Set Interface Address | ${dut1_node}
356 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
357 | | And Add Arp On Dut
358 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
359 | | ... | ${tg_to_dut2_mac}
360 | | And Vpp Route Add
361 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
362 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2}
363 | | And L2 setup xconnect on DUT
364 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
365 | | Then Send TCP or UDP packet | ${tg_node}
366 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
367 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 110 | 25
368 | | And Send TCP or UDP packet | ${tg_node}
369 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
370 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20
371 | | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | TCP
372 | | ...                                      | source + destination
373 | | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 80 | 20
374 | | ${table_index} | ${skip_n} | ${match_n}= | When Vpp Create Classify Table Hex
375 | | ... | ${dut1_node} | ${hex_mask}
376 | | And Vpp Configure Classify Session Hex
377 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
378 | | ... | ${hex_value}
379 | | And Vpp Enable Input Acl Interface
380 | | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index}
381 | | Then Send TCP or UDP packet should failed | ${tg_node}
382 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
383 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20
384 | | And Send TCP or UDP packet | ${tg_node}
385 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
386 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 110 | 25
387
388 | VPP drops packets based on IPv4 UDP src ports
389 | | [Documentation] | Create classify table on VPP, add source UDP port
390 | | ...             | of traffic into table and setup 'deny' traffic
391 | | ...             | and check if traffic is dropped.
392 | | Given Path for 3-node testing is set
393 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
394 | | And Interfaces in 3-node path are up
395 | | And Set Interface Address | ${dut1_node}
396 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
397 | | And Set Interface Address | ${dut1_node}
398 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
399 | | And Add Arp On Dut
400 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
401 | | ... | ${tg_to_dut2_mac}
402 | | And Vpp Route Add
403 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
404 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2}
405 | | And L2 setup xconnect on DUT
406 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
407 | | Then Send TCP or UDP packet | ${tg_node}
408 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
409 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 110 | 20
410 | | And Send TCP or UDP packet | ${tg_node}
411 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
412 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20
413 | | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | UDP | source
414 | | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 80 | 0
415 | | ${table_index} | ${skip_n} | ${match_n}= | When Vpp Create Classify Table Hex
416 | | ... | ${dut1_node} | ${hex_mask}
417 | | And Vpp Configure Classify Session Hex
418 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
419 | | ... | ${hex_value}
420 | | And Vpp Enable Input Acl Interface
421 | | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index}
422 | | Then Send TCP or UDP packet should failed | ${tg_node}
423 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
424 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20
425 | | And Send TCP or UDP packet | ${tg_node}
426 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
427 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 110 | 20
428
429 | VPP drops packets based on IPv4 UDP dst ports
430 | | [Documentation] | Create classify table on VPP, add destination UDP port
431 | | ...             | of traffic into table and setup 'deny' traffic
432 | | ...             | and check if traffic is dropped.
433 | | Given Path for 3-node testing is set
434 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
435 | | And Interfaces in 3-node path are up
436 | | And Set Interface Address | ${dut1_node}
437 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
438 | | And Set Interface Address | ${dut1_node}
439 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
440 | | And Add Arp On Dut
441 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
442 | | ... | ${tg_to_dut2_mac}
443 | | And Vpp Route Add
444 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
445 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2}
446 | | And L2 setup xconnect on DUT
447 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
448 | | Then Send TCP or UDP packet | ${tg_node}
449 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
450 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 20 | 110
451 | | And Send TCP or UDP packet | ${tg_node}
452 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
453 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 20 | 80
454 | | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | UDP | destination
455 | | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 0 | 80
456 | | ${table_index} | ${skip_n} | ${match_n}= | When Vpp Create Classify Table Hex
457 | | ... | ${dut1_node} | ${hex_mask}
458 | | And Vpp Configure Classify Session Hex
459 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
460 | | ... | ${hex_value}
461 | | And Vpp Enable Input Acl Interface
462 | | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index}
463 | | Then Send TCP or UDP packet should failed | ${tg_node}
464 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
465 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 20 | 80
466 | | And Send TCP or UDP packet | ${tg_node}
467 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
468 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 20 | 110
469
470 | VPP drops packets based on IPv4 UDP src + dst ports
471 | | [Documentation] | Create classify table on VPP, add source and destination
472 | | ...             | UDP port of traffic into table and setup 'deny' traffic
473 | | ...             | and check if traffic is dropped.
474 | | Given Path for 3-node testing is set
475 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
476 | | And Interfaces in 3-node path are up
477 | | And Set Interface Address | ${dut1_node}
478 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
479 | | And Set Interface Address | ${dut1_node}
480 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
481 | | And Add Arp On Dut
482 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
483 | | ... | ${tg_to_dut2_mac}
484 | | And Vpp Route Add
485 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
486 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2}
487 | | And L2 setup xconnect on DUT
488 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
489 | | Then Send TCP or UDP packet | ${tg_node}
490 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
491 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 110 | 25
492 | | And Send TCP or UDP packet | ${tg_node}
493 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
494 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20
495 | | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | UDP
496 | | ...                                      | source + destination
497 | | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 80 | 20
498 | | ${table_index} | ${skip_n} | ${match_n}= | When Vpp Create Classify Table Hex
499 | | ... | ${dut1_node} | ${hex_mask}
500 | | And Vpp Configure Classify Session Hex
501 | | ... | ${dut1_node} | deny | ${table_index} | ${skip_n} | ${match_n}
502 | | ... | ${hex_value}
503 | | And Vpp Enable Input Acl Interface
504 | | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index}
505 | | Then Send TCP or UDP packet should failed | ${tg_node}
506 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
507 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20
508 | | And Send TCP or UDP packet | ${tg_node}
509 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
510 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 110 | 25