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