ad0d32294817e970742ff49e62ce6027605690d1
[csit.git] / tests / vpp / func / ip6 / eth2p-ethip6-ip6base-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.IPUtil
17 | Library | resources.libraries.python.Trace
18 | ...
19 | Resource | resources/libraries/robot/ip/ip6.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 | *IPv6 routing with ingress ACL test cases*
34 | ...
35 | ... | Encapsulations: Eth-IPv6 on links TG-DUT1, TG-DUT2, DUT1-DUT2. IPv6
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 IPv6
38 | ... | routing and static routes. DUT1 is configured with iACL on link to TG,
39 | ... | iACL classification and permit action are configured on a per test
40 | ... | case basis. Test ICMPv6 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 accepted, or if received verifies packet IPv6
43 | ... | src-addr, dst-addr and MAC addresses.
44
45 *** Variables ***
46 | ${dut1_to_tg_ip}= | 3ffe:62::1
47 | ${dut1_to_dut2_ip}= | 3ffe:63::1
48 | ${dut1_to_dut2_ip_GW}= | 3ffe:63::2
49 | ${dut2_to_dut1_ip}= | 3ffe:72::1
50 | ${dut2_to_tg_ip}= | 3ffe:73::1
51 | ${test_dst_ip}= | 3ffe:64::1
52 | ${test_src_ip}= | 3ffe:61::1
53 | ${non_drop_dst_ip}= | 3ffe:54::1
54 | ${non_drop_src_ip}= | 3ffe:51::1
55 | ${prefix_length}= | 64
56 | ${ip_version}= | ip6
57 | ${l2_table}= | l2
58
59 *** Test Cases ***
60 | TC01: DUT with iACL IPv6 src-addr and dst-addr accepts matching pkts
61 | | [Documentation]
62 | | ... | On DUT1 add source and destination IPv6 addresses to classify table\
63 | | ... | with 'permit'.
64 | | Given Configure path in 3-node circular topology
65 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
66 | | And Set interfaces in 3-node circular topology up
67 | | And VPP Interface Set IP Address
68 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
69 | | And VPP Interface Set IP Address
70 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
71 | | And VPP Add IP Neighbor
72 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
73 | | ... | ${tg_to_dut2_mac}
74 | | And Vpp Route Add
75 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
76 | | ... | gateway=${dut1_to_dut2_ip_GW} | interface=${dut1_to_dut2}
77 | | And Vpp Route Add
78 | | ... | ${dut1_node} | ${non_drop_dst_ip} | ${prefix_length}
79 | | ... | gateway=${dut1_to_dut2_ip_GW} | interface=${dut1_to_dut2}
80 | | And Configure L2XC
81 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
82 | | And Vpp All Ra Suppress Link Layer | ${nodes}
83 | | Then Send packet and verify headers | ${tg_node}
84 | | ... | ${non_drop_src_ip} | ${non_drop_dst_ip} | ${tg_to_dut1}
85 | | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2}
86 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
87 | | And Send packet and verify headers | ${tg_node}
88 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
89 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut2}
90 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
91 | | ${table_index_1} | ${skip_n_1} | ${match_n_1}=
92 | | ... | When Vpp Creates Classify Table L3 | ${dut1_node}
93 | | ... | ${ip_version} | src | ${test_src_ip}
94 | | ${table_index_2} | ${skip_n_2} | ${match_n_2}=
95 | | ... | And Vpp Creates Classify Table L3 | ${dut1_node} | ${ip_version}
96 | | ... | dst | ${test_dst_ip}
97 | | And Vpp Configures Classify Session L3
98 | | ... | ${dut1_node} | permit | ${table_index_1}
99 | | ... | ${ip_version} | src | ${test_src_ip}
100 | | And Vpp Configures Classify Session L3
101 | | ... | ${dut1_node} | permit | ${table_index_2}
102 | | ... | ${ip_version} | dst | ${test_dst_ip}
103 | | And Vpp Enable Input Acl Interface
104 | | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index_1}
105 | | And Vpp Enable Input Acl Interface
106 | | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index_2}
107 | | Then Send packet and verify headers | ${tg_node}
108 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
109 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut2}
110 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
111 | | And Send packet and verify headers | ${tg_node}
112 | | ... | ${non_drop_src_ip} | ${non_drop_dst_ip} | ${tg_to_dut1}
113 | | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2}
114 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
115
116 | TC02: DUT with iACL IPv6 TCP src-ports and dst-ports accepts matching pkts
117 | | [Documentation]
118 | | ... | On DUT1 add TCP source and destination ports to classify table\
119 | | ... | with 'permit'.
120 | | Given Configure path in 3-node circular topology
121 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
122 | | And Set interfaces in 3-node circular topology up
123 | | And VPP Interface Set IP Address
124 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
125 | | And VPP Interface Set IP Address
126 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip}
127 | | ... | ${prefix_length}
128 | | And VPP Add IP Neighbor
129 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
130 | | ... | ${tg_to_dut2_mac}
131 | | And Vpp Route Add
132 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
133 | | ... | gateway=${dut1_to_dut2_ip_GW} | interface=${dut1_to_dut2}
134 | | And Configure L2XC
135 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
136 | | And Vpp All Ra Suppress Link Layer | ${nodes}
137 | | Then Send TCP or UDP packet and verify received packet | ${tg_node}
138 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
139 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 110 | 25
140 | | And Send TCP or UDP packet and verify received packet | ${tg_node}
141 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
142 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20
143 | | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | TCP
144 | | ... | source + destination
145 | | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 80 | 20
146 | | ${table_index} | ${skip_n} | ${match_n}=
147 | | ... | When Vpp Creates Classify Table Hex | ${dut1_node} | ${hex_mask}
148 | | And Vpp Configures Classify Session Hex
149 | | ... | ${dut1_node} | permit | ${table_index} | ${hex_value}
150 | | And Vpp Enable Input Acl Interface
151 | | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index}
152 | | Then Send TCP or UDP packet and verify received packet | ${tg_node}
153 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
154 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 80 | 20
155 | | And Send TCP or UDP packet and verify received packet | ${tg_node}
156 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
157 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | TCP | 110 | 25
158
159 | TC03: DUT with iACL IPv6 UDP src-ports and dst-ports accepts matching pkts
160 | | [Documentation]
161 | | ... | On DUT1 add UDP source and destination ports to classify table\
162 | | ... | with 'permit'.
163 | | Given Configure path in 3-node circular topology
164 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
165 | | And Set interfaces in 3-node circular topology up
166 | | And VPP Interface Set IP Address
167 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
168 | | And VPP Interface Set IP Address
169 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip}
170 | | ... | ${prefix_length}
171 | | And VPP Add IP Neighbor
172 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
173 | | ... | ${tg_to_dut2_mac}
174 | | And Vpp Route Add
175 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
176 | | ... | gateway=${dut1_to_dut2_ip_GW} | interface=${dut1_to_dut2}
177 | | And Configure L2XC
178 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
179 | | And Vpp All Ra Suppress Link Layer | ${nodes}
180 | | Then Send TCP or UDP packet and verify received packet | ${tg_node}
181 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
182 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 110 | 25
183 | | And Send TCP or UDP packet and verify received packet | ${tg_node}
184 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
185 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20
186 | | ${hex_mask}= | Compute Classify Hex Mask | ${ip_version} | UDP
187 | | ... | source + destination
188 | | ${hex_value}= | Compute Classify Hex Value | ${hex_mask} | 80 | 20
189 | | ${table_index} | ${skip_n} | ${match_n}=
190 | | ... | When Vpp Creates Classify Table Hex | ${dut1_node} | ${hex_mask}
191 | | And Vpp Configures Classify Session Hex
192 | | ... | ${dut1_node} | permit | ${table_index} | ${hex_value}
193 | | And Vpp Enable Input Acl Interface
194 | | ... | ${dut1_node} | ${dut1_to_tg} | ${ip_version} | ${table_index}
195 | | Then Send TCP or UDP packet and verify received packet | ${tg_node}
196 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
197 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 80 | 20
198 | | And Send TCP or UDP packet and verify received packet | ${tg_node}
199 | | ... | ${test_src_ip} | ${test_dst_ip} | ${tg_to_dut1} | ${tg_to_dut1_mac}
200 | | ... | ${tg_to_dut2} | ${dut1_to_tg_mac} | UDP | 110 | 25