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