CSIT-1459: Migrate IP libraries from VAT to PAPI
[csit.git] / tests / vpp / func / telemetry / eth2p-ethip6-ip6base-ip6ipfixbase-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.IPv6Util
17 | Library | resources.libraries.python.telemetry.IPFIXSetup
18 | Library | resources.libraries.python.Trace
19 | ...
20 | Resource | resources/libraries/robot/ip/ip4.robot
21 | Resource | resources/libraries/robot/shared/default.robot
22 | Resource | resources/libraries/robot/shared/interfaces.robot
23 | Resource | resources/libraries/robot/shared/testing_path.robot
24 | Resource | resources/libraries/robot/telemetry/ipfix.robot
25 | ...
26 | Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO
27 | ...
28 | Test Setup | Set up functional test
29 | ...
30 | Test Teardown | Tear down functional test
31 | ...
32 | Documentation | *IPFIX ipv6 test cases*
33 | ...
34 | ... | IPFIX tests use 3-node topology TG - DUT1 - DUT2 - TG with
35 | ... | one link between the nodes. DUT1 is configured with IPv4 and IPV6
36 | ... | routing and static routes. IPFIX is configured on DUT1 with
37 | ... | DUT1->TG interface as collector.Test packets are
38 | ... | sent from TG to or through DUT1. TG listens for flow report packets
39 | ... | and verifies that they contains flow records of test packets sent.
40
41 *** Variables ***
42 | ${dut1_to_tg_ip}= | 10::10
43 | ${dut2_to_dut1_ip}= | 11::10
44 | ${tg_to_dut1_ip}= | 12::10
45 | ${prefix_length}= | 64
46 | ${ip_version}= | ip6
47 | ${port}= | 80
48
49 # IPv4 addresses used for IPFIX exporter. Export over IPv6 not (yet?) supported.
50 | ${dut1_to_tg_ip4}= | 192.168.1.1
51 | ${tg_to_dut1_ip4}= | 192.168.1.2
52
53 *** Test Cases ***
54 | TC01: DUT reports packet flow for traffic by source address
55 | | [Tags] | EXPECTED_FAILING
56 | | [Documentation]
57 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
58 | | ... | address as collector and add classify session with TG source address.
59 | | ... | [Ver] Make TG send a packet to DUT1, then listen for IPFIX template
60 | | ... | and data packets, verify that IPFIX reported the received packet.
61 | | ... | [Ref] RFC 7011
62 | | Given Configure path in 3-node circular topology
63 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
64 | | And Set interfaces in 3-node circular topology up
65 | | And VPP Interface Set IP Address | ${dut1_node}
66 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
67 | | And VPP Interface Set IP Address | ${dut1_node}
68 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
69 | | And VPP Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
70 | | ... | ${tg_to_dut1_mac}
71 | | And VPP Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
72 | | ... | ${tg_to_dut1_mac}
73 | | And VPP RA suppress link layer | ${dut1_node} | ${dut1_to_tg}
74 | | ${table_index} | ${skip_n} | ${match_n}=
75 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | src
76 | | And VPP configures classify session L3 | ${dut1_node} | permit
77 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | src
78 | | ... | ${tg_to_dut1_ip}
79 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
80 | | ... | ${table_index} | ip_version=${ip_version}
81 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip4}
82 | | ... | ${dut1_to_tg_ip4} | interval=5
83 | | And Set IPFIX stream | ${dut1_node} | ${1}
84 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
85 | | ... | ${ip_version}
86 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
87 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
88
89 | TC02: DUT reports packet flow for traffic with local destination address
90 | | [Documentation]
91 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
92 | | ... | address as collector and add classify session with destination
93 | | ... | address of DUT1.
94 | | ... | [Ver] Make TG send a packet to DUT1, then listen for IPFIX template
95 | | ... | and data packets, verify that IPFIX reported the received packet.
96 | | ... | [Ref] RFC 7011
97 | | Given Configure path in 3-node circular topology
98 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
99 | | And Set interfaces in 3-node circular topology up
100 | | And VPP Interface Set IP Address | ${dut1_node}
101 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
102 | | And VPP Interface Set IP Address | ${dut1_node}
103 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
104 | | And VPP Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
105 | | ... | ${tg_to_dut1_mac}
106 | | And VPP Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
107 | | ... | ${tg_to_dut1_mac}
108 | | And VPP RA suppress link layer | ${dut1_node} | ${dut1_to_tg}
109 | | ${table_index} | ${skip_n} | ${match_n}=
110 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | dst
111 | | And VPP configures classify session L3 | ${dut1_node} | permit
112 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | dst
113 | | ... | ${dut1_to_tg_ip}
114 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
115 | | ... | ${table_index} | ip_version=${ip_version}
116 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip4}
117 | | ... | ${dut1_to_tg_ip4} | interval=5
118 | | And Set IPFIX stream | ${dut1_node} | ${1}
119 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
120 | | ... | ${ip_version}
121 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
122 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
123
124 | TC03: DUT reports packet flow for traffic with remote destination address
125 | | [Documentation]
126 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
127 | | ... | address as collector and add classify session with destination
128 | | ... | address of DUT2.
129 | | ... | [Ver] Make TG send a packet to DUT2 through DUT1, then listen
130 | | ... | for IPFIX template and data packets, verify that IPFIX reported
131 | | ... | the received packet.
132 | | ... | [Ref] RFC 7011
133 | | Given Configure path in 3-node circular topology
134 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
135 | | And Set interfaces in 3-node circular topology up
136 | | And VPP Interface Set IP Address | ${dut1_node}
137 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
138 | | And VPP Interface Set IP Address | ${dut1_node}
139 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
140 | | And VPP Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
141 | | ... | ${tg_to_dut1_mac}
142 | | And VPP Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
143 | | ... | ${tg_to_dut1_mac}
144 | | And VPP Add IP Neighbor | ${dut1_node} | ${dut1_to_dut2}
145 | | ... | ${dut2_to_dut1_ip} | ${dut2_to_dut1_mac}
146 | | And VPP RA suppress link layer | ${dut1_node} | ${dut1_to_tg}
147 | | ${table_index} | ${skip_n} | ${match_n}=
148 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | dst
149 | | And VPP configures classify session L3 | ${dut1_node} | permit
150 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | dst
151 | | ... | ${dut2_to_dut1_ip}
152 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
153 | | ... | ${table_index} | ip_version=${ip_version}
154 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip4}
155 | | ... | ${dut1_to_tg_ip4} | interval=5
156 | | And Set IPFIX stream | ${dut1_node} | ${1}
157 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
158 | | ... | ${ip_version}
159 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
160 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip}
161 | | ... | ${dut2_to_dut1_ip}
162
163 | TC04: DUT reports packet flow for traffic by source and destination port
164 | | [Tags] | SKIP_VPP_PATCH
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 Configure path in 3-node circular topology
173 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
174 | | And Set interfaces in 3-node circular topology up
175 | | And VPP Interface Set IP Address | ${dut1_node}
176 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
177 | | And VPP Interface Set IP Address | ${dut1_node}
178 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
179 | | And VPP Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
180 | | ... | ${tg_to_dut1_mac}
181 | | And VPP Add IP Neighbor | ${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 # TODO: DUT reports packet flow when ACL is configured with wildcards