CSIT-251 IPv6 IPFIX - baseline tests
[csit.git] / tests / func / ipfix / 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/ipfix.robot
20 | Library | resources.libraries.python.Classify.Classify
21 | Library | resources.libraries.python.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
50 # IPv4 addresses used for IPFIX exporter. Export over IPv6 not (yet?) supported.
51 | ${dut1_to_tg_ip4}= | 192.168.1.1
52 | ${tg_to_dut1_ip4}= | 16.0.0.1
53
54 *** Test Cases ***
55 | TC01: DUT reports packet flow for traffic by source address
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 Path for 3-node testing is set
63 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
64 | | And Interfaces in 3-node path are up
65 | | And Set Interface Address | ${dut1_node}
66 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
67 | | And Set Interface Address | ${dut1_node}
68 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
69 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
70 | | ... | ${tg_to_dut1_mac}
71 | | And Add ARP on DUT | ${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 Path for 3-node testing is set
98 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
99 | | And Interfaces in 3-node path are up
100 | | And Set Interface Address | ${dut1_node}
101 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
102 | | And Set Interface Address | ${dut1_node}
103 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
104 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
105 | | ... | ${tg_to_dut1_mac}
106 | | And Add ARP on DUT | ${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 Path for 3-node testing is set
134 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
135 | | And Interfaces in 3-node path are up
136 | | And Set Interface Address | ${dut1_node}
137 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
138 | | And Set Interface Address | ${dut1_node}
139 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
140 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
141 | | ... | ${tg_to_dut1_mac}
142 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
143 | | ... | ${tg_to_dut1_mac}
144 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip}
145 | | ... | ${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 | | [Documentation]
165 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
166 | | ... | address as collector and add classify session with TG source address
167 | | ... | and source and destination ports.
168 | | ... | [Ver] Make TG send a packet to DUT1, then listen for IPFIX template
169 | | ... | and data packets, verify that IPFIX reported the received packet.
170 | | ... | [Ref] RFC 7011
171 | | Given Path for 3-node testing is set
172 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
173 | | And Interfaces in 3-node path are up
174 | | And Set Interface Address | ${dut1_node}
175 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
176 | | And Set Interface Address | ${dut1_node}
177 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
178 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
179 | | ... | ${tg_to_dut1_mac}
180 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
181 | | ... | ${tg_to_dut1_mac}
182 | | And VPP RA suppress link layer | ${dut1_node} | ${dut1_to_tg}
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_ip4}
193 | | ... | ${dut1_to_tg_ip4} | 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