VAT-to-PAPI: Trace
[csit.git] / tests / vpp / func / telemetry / eth2p-ethip4-ip4base-ip4ipfixscale-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.telemetry.IPFIXSetup
17 | Library | resources.libraries.python.Trace
18 | ...
19 | Resource | resources/libraries/robot/ip/ip4.robot
20 | Resource | resources/libraries/robot/shared/default.robot
21 | Resource | resources/libraries/robot/shared/interfaces.robot
22 | Resource | resources/libraries/robot/shared/testing_path.robot
23 | Resource | resources/libraries/robot/telemetry/ipfix.robot
24 | ...
25 | Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO | SKIP_VPP_PATCH
26 | ... | EXPECTED_FAILING
27 | ...
28 | Test Setup | Set up functional test
29 | ...
30 | Test Teardown | Tear down functional test
31 | ...
32 | Documentation | *IPFIX ipv4 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
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 DUT1. TG listens for flow report packets
39 | ... | and verifies that they contains flow record of test packets sent.
40
41 *** Variables ***
42 | ${dut1_to_tg_ip}= | 192.168.1.1
43 | ${tg_to_dut1_ip}= | 192.168.1.2
44 | ${prefix_length}= | 24
45 | ${ip_version}= | ip4
46 | ${sessions}= | 80
47
48 *** Test Cases ***
49 | TC01: DUT reports packet flow with a large number of packets
50 | | [Documentation]
51 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
52 | | ... | address as collector and add classify session with TG source address.
53 | | ... | [Ver] Make TG send packets to DUT1, then listen for IPFIX template
54 | | ... | and data packets, verify that IPFIX reported the received packets.
55 | | ... | [Ref] RFC 7011
56 | | Given Configure path in 3-node circular topology
57 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
58 | | And Set interfaces in 3-node circular topology up
59 | | And VPP Interface Set IP Address | ${dut1_node}
60 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
61 | | And VPP Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
62 | | ... | ${tg_to_dut1_mac}
63 | | ${table_index} | ${skip_n} | ${match_n}=
64 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | src
65 | | And VPP configures classify session L3 | ${dut1_node} | permit
66 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | src
67 | | ... | ${tg_to_dut1_ip}
68 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
69 | | ... | ${table_index} | ip_version=${ip_version}
70 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip}
71 | | ... | ${dut1_to_tg_ip} | interval=5
72 | | And Set IPFIX stream | ${dut1_node} | ${1}
73 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
74 | | ... | ${ip_version}
75 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
76 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
77 | | ... | count=20000 | timeout=10
78
79 | TC02: DUT reports packet flow when multiple sessions are configured
80 | | [Documentation]
81 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
82 | | ... | address as collector and add several classify sessions with different
83 | | ... | ports.
84 | | ... | [Ver] Make TG send packets to DUT1 using a range of ports matching
85 | | ... | configured sessions, then listen for IPFIX template and data packets,
86 | | ... | verify that IPFIX reported the received packets for each session.
87 | | ... | [Ref] RFC 7011
88 | | Given Configure path in 3-node circular topology
89 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
90 | | And Set interfaces in 3-node circular topology up
91 | | And VPP Interface Set IP Address | ${dut1_node}
92 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
93 | | And VPP Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
94 | | ... | ${tg_to_dut1_mac}
95 | | ${table_index} | ${skip_n} | ${match_n}=
96 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version}
97 | | ... | src proto l4 src_port dst_port
98 | | :FOR | ${index} | IN RANGE | ${sessions}
99 | | | VPP configures classify session generic | ${dut1_node}
100 | | | ... | acl-hit-next permit | ${table_index} | ${skip_n} | ${match_n}
101 | | | ... | l3 ${ip_version} src ${tg_to_dut1_ip}
102 | | | ... | proto 6 l4 src_port ${index} dst_port ${index}
103 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
104 | | ... | ${table_index} | ip_version=${ip_version}
105 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip}
106 | | ... | ${dut1_to_tg_ip}
107 | | ... | mtu=1450 | interval=5
108 | | And Set IPFIX stream | ${dut1_node} | ${1}
109 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
110 | | ... | ${ip_version}
111 | | Then Send session sweep and verify IPFIX | ${tg_node} | ${dut1_node}
112 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
113 | | ... | ${sessions} | timeout=10 | count=3
114
115 # TODO: DUT reports packet flow when ACL is configured with wildcards