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