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