4f1dd5f4089b994e48c07030a66ea4bdefc2f836
[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 | Suite Setup | Run Keywords | Setup all TGs before traffic script
28 | ...         | AND          | Update All Interface Data On All Nodes | ${nodes}
29 | Test Setup | Setup all DUTs before test
30 | Test Teardown | Run Keywords | Show packet trace on all DUTs | ${nodes}
31 | ...           | AND          | Vpp Show Errors | ${nodes['DUT1']}
32 | ...           | AND          | Show vpp trace dump on all DUTs
33 | Documentation | *IPFIX ipv6 test cases*
34 | ...
35 | ... | IPFIX tests use 3-node topology TG - DUT1 - DUT2 - TG with
36 | ... | one link between the nodes. DUT1 is configured with IPv4 and IPV6
37 | ... | routing and static routes. IPFIX is configured on DUT1 with
38 | ... | DUT1->TG interface as collector.Test packets are
39 | ... | sent from TG to or through DUT1. TG listens for flow report packets
40 | ... | and verifies that they contains flow records of test packets sent.
41
42 *** Variables ***
43 | ${dut1_to_tg_ip}= | 10::10
44 | ${dut2_to_dut1_ip}= | 11::10
45 | ${tg_to_dut1_ip}= | 12::10
46 | ${prefix_length}= | 64
47 | ${ip_version}= | ip6
48 | ${port}= | 80
49 | ${sessions}= | 45
50
51 # IPv4 addresses used for IPFIX exporter. Export over IPv6 not (yet?) supported.
52 | ${dut1_to_tg_ip4}= | 192.168.1.1
53 | ${tg_to_dut1_ip4}= | 16.0.0.1
54
55 *** Test Cases ***
56 | TC01: DUT reports packet flow for traffic by source address
57 | | [Documentation]
58 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
59 | | ... | address as collector and add classify session with TG source address.
60 | | ... | [Ver] Make TG send a packet to DUT1, then listen for IPFIX template
61 | | ... | and data packets, verify that IPFIX reported the received packet.
62 | | ... | [Ref] RFC 7011
63 | | Given Path for 3-node testing is set
64 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
65 | | And Interfaces in 3-node path are up
66 | | And Set Interface Address | ${dut1_node}
67 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
68 | | And Set Interface Address | ${dut1_node}
69 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
70 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
71 | | ... | ${tg_to_dut1_mac}
72 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
73 | | ... | ${tg_to_dut1_mac}
74 | | And VPP RA suppress link layer | ${dut1_node} | ${dut1_to_tg}
75 | | ${table_index} | ${skip_n} | ${match_n}=
76 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | src
77 | | And VPP configures classify session L3 | ${dut1_node} | permit
78 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | src
79 | | ... | ${tg_to_dut1_ip}
80 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
81 | | ... | ${table_index} | ip_version=${ip_version}
82 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip4}
83 | | ... | ${dut1_to_tg_ip4} | interval=5
84 | | And Set IPFIX stream | ${dut1_node} | ${1}
85 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
86 | | ... | ${ip_version}
87 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
88 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
89
90 | TC02: DUT reports packet flow for traffic with local destination address
91 | | [Documentation]
92 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
93 | | ... | address as collector and add classify session with destination
94 | | ... | address of DUT1.
95 | | ... | [Ver] Make TG send a packet to DUT1, then listen for IPFIX template
96 | | ... | and data packets, verify that IPFIX reported the received packet.
97 | | ... | [Ref] RFC 7011
98 | | Given Path for 3-node testing is set
99 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
100 | | And Interfaces in 3-node path are up
101 | | And Set Interface Address | ${dut1_node}
102 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
103 | | And Set Interface Address | ${dut1_node}
104 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
105 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
106 | | ... | ${tg_to_dut1_mac}
107 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
108 | | ... | ${tg_to_dut1_mac}
109 | | And VPP RA suppress link layer | ${dut1_node} | ${dut1_to_tg}
110 | | ${table_index} | ${skip_n} | ${match_n}=
111 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | dst
112 | | And VPP configures classify session L3 | ${dut1_node} | permit
113 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | dst
114 | | ... | ${dut1_to_tg_ip}
115 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
116 | | ... | ${table_index} | ip_version=${ip_version}
117 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip4}
118 | | ... | ${dut1_to_tg_ip4} | interval=5
119 | | And Set IPFIX stream | ${dut1_node} | ${1}
120 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
121 | | ... | ${ip_version}
122 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
123 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
124
125 | TC03: DUT reports packet flow for traffic with remote destination address
126 | | [Documentation]
127 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
128 | | ... | address as collector and add classify session with destination
129 | | ... | address of DUT2.
130 | | ... | [Ver] Make TG send a packet to DUT2 through DUT1, then listen
131 | | ... | for IPFIX template and data packets, verify that IPFIX reported
132 | | ... | the received packet.
133 | | ... | [Ref] RFC 7011
134 | | Given Path for 3-node testing is set
135 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
136 | | And Interfaces in 3-node path are up
137 | | And Set Interface Address | ${dut1_node}
138 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
139 | | And Set Interface Address | ${dut1_node}
140 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
141 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
142 | | ... | ${tg_to_dut1_mac}
143 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
144 | | ... | ${tg_to_dut1_mac}
145 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip}
146 | | ... | ${dut2_to_dut1_mac}
147 | | And VPP RA suppress link layer | ${dut1_node} | ${dut1_to_tg}
148 | | ${table_index} | ${skip_n} | ${match_n}=
149 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | dst
150 | | And VPP configures classify session L3 | ${dut1_node} | permit
151 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | dst
152 | | ... | ${dut2_to_dut1_ip}
153 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
154 | | ... | ${table_index} | ip_version=${ip_version}
155 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip4}
156 | | ... | ${dut1_to_tg_ip4} | interval=5
157 | | And Set IPFIX stream | ${dut1_node} | ${1}
158 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
159 | | ... | ${ip_version}
160 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
161 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip}
162 | | ... | ${dut2_to_dut1_ip}
163
164 | TC04: DUT reports packet flow for traffic by source and destination port
165 | | [Documentation]
166 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
167 | | ... | address as collector and add classify session with TG source address
168 | | ... | and source and destination ports.
169 | | ... | [Ver] Make TG send a packet to DUT1, then listen for IPFIX template
170 | | ... | and data packets, verify that IPFIX reported the received packet.
171 | | ... | [Ref] RFC 7011
172 | | Given Path for 3-node testing is set
173 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
174 | | And Interfaces in 3-node path are up
175 | | And Set Interface Address | ${dut1_node}
176 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
177 | | And Set Interface Address | ${dut1_node}
178 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
179 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
180 | | ... | ${tg_to_dut1_mac}
181 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
182 | | ... | ${tg_to_dut1_mac}
183 | | And VPP RA suppress link layer | ${dut1_node} | ${dut1_to_tg}
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_ip4}
194 | | ... | ${dut1_to_tg_ip4} | 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 | TC05: 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 Set Interface Address | ${dut1_node}
215 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
216 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
217 | | ... | ${tg_to_dut1_mac}
218 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
219 | | ... | ${tg_to_dut1_mac}
220 | | And VPP RA suppress link layer | ${dut1_node} | ${dut1_to_tg}
221 | | ${table_index} | ${skip_n} | ${match_n}=
222 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | src
223 | | And VPP configures classify session L3 | ${dut1_node} | permit
224 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | src
225 | | ... | ${tg_to_dut1_ip}
226 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
227 | | ... | ${table_index} | ip_version=${ip_version}
228 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip4}
229 | | ... | ${dut1_to_tg_ip4} | interval=5
230 | | And Set IPFIX stream | ${dut1_node} | ${1}
231 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
232 | | ... | ${ip_version}
233 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
234 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
235 | | ... | count=20000 | timeout=10
236
237 | TC06: DUT reports packet flow when multiple sessions are configured
238 | | [Documentation]
239 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
240 | | ... | address as collector and add several classify sessions with different
241 | | ... | ports.
242 | | ... | [Ver] Make TG send packets to DUT1 using a range of ports matching
243 | | ... | configured sessions, then listen for IPFIX template and data packets,
244 | | ... | verify that IPFIX reported the received packets for each session.
245 | | ... | [Ref] RFC 7011
246 | | Given Path for 3-node testing is set
247 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
248 | | And Interfaces in 3-node path are up
249 | | And Set Interface Address | ${dut1_node}
250 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
251 | | And Set Interface Address | ${dut1_node}
252 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
253 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
254 | | ... | ${tg_to_dut1_mac}
255 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
256 | | ... | ${tg_to_dut1_mac}
257 | | And VPP RA suppress link layer | ${dut1_node} | ${dut1_to_tg}
258 | | ${table_index} | ${skip_n} | ${match_n}=
259 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version}
260 | | ... | src proto l4 src_port dst_port
261 | | :FOR | ${index} | IN RANGE | ${sessions}
262 | | | VPP configures classify session generic | ${dut1_node}
263 | | | ... | acl-hit-next permit | ${table_index} | ${skip_n} | ${match_n}
264 | | | ... | l3 ${ip_version} src ${tg_to_dut1_ip}
265 | | | ... | proto 6 l4 src_port ${index} dst_port ${index}
266 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
267 | | ... | ${table_index} | ip_version=${ip_version}
268 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip4}
269 | | ... | ${dut1_to_tg_ip4} | interval=5
270 | | ... | mtu=1450 | interval=5
271 | | And Set IPFIX stream | ${dut1_node} | ${1}
272 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
273 | | ... | ${ip_version}
274 | | Then Send session sweep and verify IPFIX | ${tg_node} | ${dut1_node}
275 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
276 | | ... | ${sessions} | timeout=10 | count=3
277
278 # TODO: DUT reports packet flow when ACL is configured with wildcards