VAT-to-PAPI: Trace
[csit.git] / tests / vpp / func / telemetry / eth2p-ethip4-ip4base-ip4ipfixbase-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.telemetry.IPFIXSetup
17 | Library | resources.libraries.python.Trace
18 | ...
19 | Resource | resources/libraries/robot/ip/ip4.robot
20 | Resource | resources/libraries/robot/shared/default.robot
21 | Resource | resources/libraries/robot/shared/interfaces.robot
22 | Resource | resources/libraries/robot/shared/testing_path.robot
23 | Resource | resources/libraries/robot/telemetry/ipfix.robot
24 | ...
25 | Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO
26 | ...
27 | Test Setup | Set up functional test
28 | ...
29 | Test Teardown | Tear down functional test
30 | ...
31 | Documentation | *IPFIX ipv4 test cases*
32 | ...
33 | ... | IPFIX tests use 3-node topology TG - DUT1 - DUT2 - TG with
34 | ... | one link between the nodes. DUT1 is configured with IPv4
35 | ... | routing and static routes. IPFIX is configured on DUT1 with
36 | ... | DUT1->TG interface as collector. Test packets are
37 | ... | sent from TG to DUT1. TG listens for flow report packets
38 | ... | and verifies that they contains flow record of test packets sent.
39
40 *** Variables ***
41 | ${dut1_to_tg_ip}= | 192.168.1.1
42 | ${tg_to_dut1_ip}= | 192.168.1.2
43 | ${dut2_to_dut1_ip}= | 192.168.2.1
44 | ${prefix_length}= | 24
45 | ${ip_version}= | ip4
46 | ${port}= | 80
47
48 *** Test Cases ***
49 | TC01: DUT sends IPFIX template and data packets
50 | | [Documentation]
51 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
52 | | ... | address as collector and a basic classify session.
53 | | ... | [Ver] Make TG listen for IPFIX template and data packets, verify
54 | | ... | that packet is received and correct. No packets are sent from TG.
55 | | ... | [Ref] RFC 7011
56 | | Given Configure path in 3-node circular topology
57 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
58 | | And Set interfaces in 3-node circular topology up
59 | | And VPP Interface Set IP Address | ${dut1_node}
60 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
61 | | And VPP Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
62 | | ... | ${tg_to_dut1_mac}
63 | | ${table_index} | ${skip_n} | ${match_n}=
64 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | src
65 | | And VPP configures classify session L3 | ${dut1_node} | permit
66 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | src
67 | | ... | ${tg_to_dut1_ip}
68 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
69 | | ... | ${table_index} | ip_version=${ip_version}
70 | | And Setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip}
71 | | ... | ${dut1_to_tg_ip} | interval=5
72 | | And Set IPFIX stream | ${dut1_node} | ${1}
73 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
74 | | ... | ${ip_version}
75 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
76 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
77 | | ... | count=0
78
79 | TC02: DUT reports packet flow for traffic by source address
80 | | [Documentation]
81 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
82 | | ... | address as collector and add classify session with TG source address.
83 | | ... | [Ver] Make TG send a packet to DUT1, then listen for IPFIX template
84 | | ... | and data packets, verify that IPFIX reported the received packet.
85 | | ... | [Ref] RFC 7011
86 | | Given Configure path in 3-node circular topology
87 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
88 | | And Set interfaces in 3-node circular topology up
89 | | And VPP Interface Set IP Address | ${dut1_node}
90 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
91 | | And VPP Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
92 | | ... | ${tg_to_dut1_mac}
93 | | ${table_index} | ${skip_n} | ${match_n}=
94 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | src
95 | | And VPP configures classify session L3 | ${dut1_node} | permit
96 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | src
97 | | ... | ${tg_to_dut1_ip}
98 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
99 | | ... | ${table_index} | ip_version=${ip_version}
100 | | And Setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip}
101 | | ... | ${dut1_to_tg_ip} | interval=5
102 | | And Set IPFIX stream | ${dut1_node} | ${1}
103 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
104 | | ... | ${ip_version}
105 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
106 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
107
108 | TC03: DUT reports packet flow for traffic with local destination address
109 | | [Documentation]
110 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
111 | | ... | address as collector and add classify session with destination
112 | | ... | address of DUT1.
113 | | ... | [Ver] Make TG send a packet to DUT1, then listen for IPFIX template
114 | | ... | and data packets, verify that IPFIX reported the received packet.
115 | | ... | [Ref] RFC 7011
116 | | Given Configure path in 3-node circular topology
117 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
118 | | And Set interfaces in 3-node circular topology up
119 | | And VPP Interface Set IP Address | ${dut1_node}
120 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
121 | | And VPP Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
122 | | ... | ${tg_to_dut1_mac}
123 | | ${table_index} | ${skip_n} | ${match_n}=
124 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | dst
125 | | And VPP configures classify session L3 | ${dut1_node} | permit
126 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | dst
127 | | ... | ${dut1_to_tg_ip}
128 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
129 | | ... | ${table_index} | ip_version=${ip_version}
130 | | And Setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip}
131 | | ... | ${dut1_to_tg_ip} | interval=5
132 | | And Set IPFIX stream | ${dut1_node} | ${1}
133 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
134 | | ... | ${ip_version}
135 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
136 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
137
138 | TC04: DUT reports packet flow for traffic with remote destination address
139 | | [Documentation]
140 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
141 | | ... | address as collector and add classify session with destination
142 | | ... | address of DUT2.
143 | | ... | [Ver] Make TG send a packet to DUT2 through DUT1, then listen
144 | | ... | for IPFIX template and data packets, verify that IPFIX reported
145 | | ... | the received packet.
146 | | ... | [Ref] RFC 7011
147 | | Given Configure path in 3-node circular topology
148 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
149 | | And Set interfaces in 3-node circular topology up
150 | | And VPP Interface Set IP Address | ${dut1_node}
151 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
152 | | And VPP Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
153 | | ... | ${tg_to_dut1_mac}
154 | | And VPP Add IP Neighbor | ${dut1_node} | ${dut1_to_dut2}
155 | | ... | ${dut2_to_dut1_ip} | ${dut2_to_dut1_mac}
156 | | ${table_index} | ${skip_n} | ${match_n}=
157 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | dst
158 | | And VPP configures classify session L3 | ${dut1_node} | permit
159 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | dst
160 | | ... | ${dut2_to_dut1_ip}
161 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
162 | | ... | ${table_index} | ip_version=${ip_version}
163 | | And Setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip}
164 | | ... | ${dut1_to_tg_ip} | interval=5
165 | | And Set IPFIX stream | ${dut1_node} | ${1}
166 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
167 | | ... | ${ip_version}
168 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
169 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut2_to_dut1_ip}
170
171 | TC05: DUT reports packet flow for traffic by source and destination port
172 | | [Tags] | SKIP_VPP_PATCH
173 | | [Documentation]
174 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
175 | | ... | address as collector and add classify session with TG source address
176 | | ... | and source and destination ports.
177 | | ... | [Ver] Make TG send a packet to DUT1, then listen for IPFIX template
178 | | ... | and data packets, verify that IPFIX reported the received packet.
179 | | ... | [Ref] RFC 7011
180 | | Given Configure path in 3-node circular topology
181 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
182 | | And Set interfaces in 3-node circular topology up
183 | | And VPP Interface Set IP Address | ${dut1_node}
184 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
185 | | And VPP Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
186 | | ... | ${tg_to_dut1_mac}
187 | | ${table_index} | ${skip_n} | ${match_n}=
188 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version}
189 | | ... | src proto l4 src_port dst_port
190 | | And VPP configures classify session generic | ${dut1_node}
191 | | ... | acl-hit-next permit | ${table_index} | ${skip_n} | ${match_n}
192 | | ... | l3 ${ip_version} src ${tg_to_dut1_ip}
193 | | ... | proto 6 l4 src_port ${port} dst_port ${port}
194 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
195 | | ... | ${table_index} | ip_version=${ip_version}
196 | | And Setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip}
197 | | ... | ${dut1_to_tg_ip} | interval=5
198 | | And Set IPFIX stream | ${dut1_node} | ${1}
199 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
200 | | ... | ${ip_version}
201 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
202 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
203 | | ... | port=${port}
204
205 # TODO: DUT reports packet flow when ACL is configured with wildcards