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