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