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