csit-func-tc-naming-change - phase 1
[csit.git] / tests / func / telemetry / ipfix / eth2p-ethip4-ip4base-ip4ipfixscale-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/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/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
25 | Test Setup | Func Test Setup
26 | Test Teardown | Func Test Teardown
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 | ${prefix_length}= | 24
40 | ${ip_version}= | ip4
41 | ${sessions}= | 80
42
43 *** Test Cases ***
44 | TC01: DUT reports packet flow with a large number of packets
45 | | [Documentation]
46 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
47 | | ... | address as collector and add classify session with TG source address.
48 | | ... | [Ver] Make TG send packets to DUT1, then listen for IPFIX template
49 | | ... | and data packets, verify that IPFIX reported the received packets.
50 | | ... | [Ref] RFC 7011
51 | | Given Path for 3-node testing is set
52 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
53 | | And Interfaces in 3-node path are up
54 | | And Set Interface Address | ${dut1_node}
55 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
56 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
57 | | ... | ${tg_to_dut1_mac}
58 | | ${table_index} | ${skip_n} | ${match_n}=
59 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | src
60 | | And VPP configures classify session L3 | ${dut1_node} | permit
61 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | src
62 | | ... | ${tg_to_dut1_ip}
63 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
64 | | ... | ${table_index} | ip_version=${ip_version}
65 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip}
66 | | ... | ${dut1_to_tg_ip} | interval=5
67 | | And Set IPFIX stream | ${dut1_node} | ${1}
68 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
69 | | ... | ${ip_version}
70 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
71 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
72 | | ... | count=20000 | timeout=10
73
74 | TC02: DUT reports packet flow when multiple sessions are configured
75 | | [Documentation]
76 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
77 | | ... | address as collector and add several classify sessions with different
78 | | ... | ports.
79 | | ... | [Ver] Make TG send packets to DUT1 using a range of ports matching
80 | | ... | configured sessions, then listen for IPFIX template and data packets,
81 | | ... | verify that IPFIX reported the received packets for each session.
82 | | ... | [Ref] RFC 7011
83 | | Given Path for 3-node testing is set
84 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
85 | | And Interfaces in 3-node path are up
86 | | And Set Interface Address | ${dut1_node}
87 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
88 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
89 | | ... | ${tg_to_dut1_mac}
90 | | ${table_index} | ${skip_n} | ${match_n}=
91 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version}
92 | | ... | src proto l4 src_port dst_port
93 | | :FOR | ${index} | IN RANGE | ${sessions}
94 | | | VPP configures classify session generic | ${dut1_node}
95 | | | ... | acl-hit-next permit | ${table_index} | ${skip_n} | ${match_n}
96 | | | ... | l3 ${ip_version} src ${tg_to_dut1_ip}
97 | | | ... | proto 6 l4 src_port ${index} dst_port ${index}
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}
102 | | ... | mtu=1450 | interval=5
103 | | And Set IPFIX stream | ${dut1_node} | ${1}
104 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
105 | | ... | ${ip_version}
106 | | Then Send session sweep and verify IPFIX | ${tg_node} | ${dut1_node}
107 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
108 | | ... | ${sessions} | timeout=10 | count=3
109
110 # TODO: DUT reports packet flow when ACL is configured with wildcards