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