CSIT-509: Add perf tests for vlan + l2 + vhost
[csit.git] / tests / func / telemetry / ipfix_ipv6.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/interfaces.robot
17 | Resource | resources/libraries/robot/testing_path.robot
18 | Resource | resources/libraries/robot/ipv4.robot
19 | Resource | resources/libraries/robot/telemetry/ipfix.robot
20 | Library | resources.libraries.python.Classify.Classify
21 | Library | resources.libraries.python.telemetry.IPFIXSetup
22 | Library | resources.libraries.python.IPv6Setup
23 | Library | resources.libraries.python.Trace
24
25 | Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO | EXPECTED_FAILING
26 # TODO: Remove EXPECTED_FAILING tag once functionality is implemented (VPP-204)
27 | Test Setup | Func Test Setup
28 | Test Teardown | Func Test Teardown
29 | Documentation | *IPFIX ipv6 test cases*
30 | ...
31 | ... | IPFIX tests use 3-node topology TG - DUT1 - DUT2 - TG with
32 | ... | one link between the nodes. DUT1 is configured with IPv4 and IPV6
33 | ... | routing and static routes. IPFIX is configured on DUT1 with
34 | ... | DUT1->TG interface as collector.Test packets are
35 | ... | sent from TG to or through DUT1. TG listens for flow report packets
36 | ... | and verifies that they contains flow records of test packets sent.
37
38 *** Variables ***
39 | ${dut1_to_tg_ip}= | 10::10
40 | ${dut2_to_dut1_ip}= | 11::10
41 | ${tg_to_dut1_ip}= | 12::10
42 | ${prefix_length}= | 64
43 | ${ip_version}= | ip6
44 | ${port}= | 80
45 | ${sessions}= | 45
46
47 # IPv4 addresses used for IPFIX exporter. Export over IPv6 not (yet?) supported.
48 | ${dut1_to_tg_ip4}= | 192.168.1.1
49 | ${tg_to_dut1_ip4}= | 192.168.1.2
50
51 *** Test Cases ***
52 | TC01: DUT reports packet flow for traffic by source address
53 | | [Documentation]
54 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
55 | | ... | address as collector and add classify session with TG source address.
56 | | ... | [Ver] Make TG send a packet to DUT1, then listen for IPFIX template
57 | | ... | and data packets, verify that IPFIX reported the received packet.
58 | | ... | [Ref] RFC 7011
59 | | Given Path for 3-node testing is set
60 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
61 | | And Interfaces in 3-node path are up
62 | | And Set Interface Address | ${dut1_node}
63 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
64 | | And Set Interface Address | ${dut1_node}
65 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
66 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
67 | | ... | ${tg_to_dut1_mac}
68 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
69 | | ... | ${tg_to_dut1_mac}
70 | | And VPP RA suppress link layer | ${dut1_node} | ${dut1_to_tg}
71 | | ${table_index} | ${skip_n} | ${match_n}=
72 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | src
73 | | And VPP configures classify session L3 | ${dut1_node} | permit
74 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | src
75 | | ... | ${tg_to_dut1_ip}
76 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
77 | | ... | ${table_index} | ip_version=${ip_version}
78 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip4}
79 | | ... | ${dut1_to_tg_ip4} | interval=5
80 | | And Set IPFIX stream | ${dut1_node} | ${1}
81 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
82 | | ... | ${ip_version}
83 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
84 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
85
86 | TC02: DUT reports packet flow for traffic with local destination address
87 | | [Documentation]
88 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
89 | | ... | address as collector and add classify session with destination
90 | | ... | address of DUT1.
91 | | ... | [Ver] Make TG send a packet to DUT1, then listen for IPFIX template
92 | | ... | and data packets, verify that IPFIX reported the received packet.
93 | | ... | [Ref] RFC 7011
94 | | Given Path for 3-node testing is set
95 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
96 | | And Interfaces in 3-node path are up
97 | | And Set Interface Address | ${dut1_node}
98 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
99 | | And Set Interface Address | ${dut1_node}
100 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
101 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
102 | | ... | ${tg_to_dut1_mac}
103 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
104 | | ... | ${tg_to_dut1_mac}
105 | | And VPP RA suppress link layer | ${dut1_node} | ${dut1_to_tg}
106 | | ${table_index} | ${skip_n} | ${match_n}=
107 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | dst
108 | | And VPP configures classify session L3 | ${dut1_node} | permit
109 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | dst
110 | | ... | ${dut1_to_tg_ip}
111 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
112 | | ... | ${table_index} | ip_version=${ip_version}
113 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip4}
114 | | ... | ${dut1_to_tg_ip4} | interval=5
115 | | And Set IPFIX stream | ${dut1_node} | ${1}
116 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
117 | | ... | ${ip_version}
118 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
119 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
120
121 | TC03: DUT reports packet flow for traffic with remote destination address
122 | | [Documentation]
123 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
124 | | ... | address as collector and add classify session with destination
125 | | ... | address of DUT2.
126 | | ... | [Ver] Make TG send a packet to DUT2 through DUT1, then listen
127 | | ... | for IPFIX template and data packets, verify that IPFIX reported
128 | | ... | the received packet.
129 | | ... | [Ref] RFC 7011
130 | | Given Path for 3-node testing is set
131 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
132 | | And Interfaces in 3-node path are up
133 | | And Set Interface Address | ${dut1_node}
134 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
135 | | And Set Interface Address | ${dut1_node}
136 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
137 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
138 | | ... | ${tg_to_dut1_mac}
139 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
140 | | ... | ${tg_to_dut1_mac}
141 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip}
142 | | ... | ${dut2_to_dut1_mac}
143 | | And VPP RA suppress link layer | ${dut1_node} | ${dut1_to_tg}
144 | | ${table_index} | ${skip_n} | ${match_n}=
145 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | dst
146 | | And VPP configures classify session L3 | ${dut1_node} | permit
147 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | dst
148 | | ... | ${dut2_to_dut1_ip}
149 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
150 | | ... | ${table_index} | ip_version=${ip_version}
151 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip4}
152 | | ... | ${dut1_to_tg_ip4} | interval=5
153 | | And Set IPFIX stream | ${dut1_node} | ${1}
154 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
155 | | ... | ${ip_version}
156 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
157 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip}
158 | | ... | ${dut2_to_dut1_ip}
159
160 | TC04: DUT reports packet flow for traffic by source and destination port
161 | | [Documentation]
162 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
163 | | ... | address as collector and add classify session with TG source address
164 | | ... | and source and destination ports.
165 | | ... | [Ver] Make TG send a packet to DUT1, then listen for IPFIX template
166 | | ... | and data packets, verify that IPFIX reported the received packet.
167 | | ... | [Ref] RFC 7011
168 | | Given Path for 3-node testing is set
169 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
170 | | And Interfaces in 3-node path are up
171 | | And Set Interface Address | ${dut1_node}
172 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
173 | | And Set Interface Address | ${dut1_node}
174 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
175 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
176 | | ... | ${tg_to_dut1_mac}
177 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
178 | | ... | ${tg_to_dut1_mac}
179 | | And VPP RA suppress link layer | ${dut1_node} | ${dut1_to_tg}
180 | | ${table_index} | ${skip_n} | ${match_n}=
181 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version}
182 | | ... | src proto l4 src_port dst_port
183 | | And VPP configures classify session generic | ${dut1_node}
184 | | ... | acl-hit-next permit | ${table_index} | ${skip_n} | ${match_n}
185 | | ... | l3 ${ip_version} src ${tg_to_dut1_ip}
186 | | ... | proto 6 l4 src_port ${port} dst_port ${port}
187 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
188 | | ... | ${table_index} | ip_version=${ip_version}
189 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip4}
190 | | ... | ${dut1_to_tg_ip4} | interval=5
191 | | And Set IPFIX stream | ${dut1_node} | ${1}
192 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
193 | | ... | ${ip_version}
194 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
195 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
196 | | ... | port=${port}
197
198 | TC05: DUT reports packet flow with a large number of packets
199 | | [Documentation]
200 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
201 | | ... | address as collector and add classify session with TG source address.
202 | | ... | [Ver] Make TG send packets to DUT1, then listen for IPFIX template
203 | | ... | and data packets, verify that IPFIX reported the received packets.
204 | | ... | [Ref] RFC 7011
205 | | Given Path for 3-node testing is set
206 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
207 | | And Interfaces in 3-node path are up
208 | | And Set Interface Address | ${dut1_node}
209 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
210 | | And Set Interface Address | ${dut1_node}
211 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
212 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
213 | | ... | ${tg_to_dut1_mac}
214 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
215 | | ... | ${tg_to_dut1_mac}
216 | | And VPP RA suppress link layer | ${dut1_node} | ${dut1_to_tg}
217 | | ${table_index} | ${skip_n} | ${match_n}=
218 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | src
219 | | And VPP configures classify session L3 | ${dut1_node} | permit
220 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | src
221 | | ... | ${tg_to_dut1_ip}
222 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
223 | | ... | ${table_index} | ip_version=${ip_version}
224 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip4}
225 | | ... | ${dut1_to_tg_ip4} | interval=5
226 | | And Set IPFIX stream | ${dut1_node} | ${1}
227 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
228 | | ... | ${ip_version}
229 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
230 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
231 | | ... | count=20000 | timeout=10
232
233 | TC06: DUT reports packet flow when multiple sessions are configured
234 | | [Documentation]
235 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
236 | | ... | address as collector and add several classify sessions with different
237 | | ... | ports.
238 | | ... | [Ver] Make TG send packets to DUT1 using a range of ports matching
239 | | ... | configured sessions, then listen for IPFIX template and data packets,
240 | | ... | verify that IPFIX reported the received packets for each session.
241 | | ... | [Ref] RFC 7011
242 | | Given Path for 3-node testing is set
243 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
244 | | And Interfaces in 3-node path are up
245 | | And Set Interface Address | ${dut1_node}
246 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
247 | | And Set Interface Address | ${dut1_node}
248 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
249 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
250 | | ... | ${tg_to_dut1_mac}
251 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
252 | | ... | ${tg_to_dut1_mac}
253 | | And VPP RA suppress link layer | ${dut1_node} | ${dut1_to_tg}
254 | | ${table_index} | ${skip_n} | ${match_n}=
255 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version}
256 | | ... | src proto l4 src_port dst_port
257 | | :FOR | ${index} | IN RANGE | ${sessions}
258 | | | VPP configures classify session generic | ${dut1_node}
259 | | | ... | acl-hit-next permit | ${table_index} | ${skip_n} | ${match_n}
260 | | | ... | l3 ${ip_version} src ${tg_to_dut1_ip}
261 | | | ... | proto 6 l4 src_port ${index} dst_port ${index}
262 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
263 | | ... | ${table_index} | ip_version=${ip_version}
264 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip4}
265 | | ... | ${dut1_to_tg_ip4} | interval=5
266 | | ... | mtu=1450 | interval=5
267 | | And Set IPFIX stream | ${dut1_node} | ${1}
268 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
269 | | ... | ${ip_version}
270 | | Then Send session sweep and verify IPFIX | ${tg_node} | ${dut1_node}
271 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
272 | | ... | ${sessions} | timeout=10 | count=3
273
274 # TODO: DUT reports packet flow when ACL is configured with wildcards