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