CSIT-1459: Migrate IP libraries from VAT to PAPI
[csit.git] / tests / vpp / func / telemetry / eth2p-ethip6-ip6base-ip6ipfixscale-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 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 | ${tg_to_dut1_ip}= | 12::10
44 | ${prefix_length}= | 64
45 | ${ip_version}= | ip6
46 | ${sessions}= | 45
47
48 # IPv4 addresses used for IPFIX exporter. Export over IPv6 not (yet?) supported.
49 | ${dut1_to_tg_ip4}= | 192.168.1.1
50 | ${tg_to_dut1_ip4}= | 192.168.1.2
51
52 *** Test Cases ***
53 | TC01: DUT reports packet flow with a large number of packets
54 | | [Documentation]
55 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
56 | | ... | address as collector and add classify session with TG source address.
57 | | ... | [Ver] Make TG send packets to DUT1, then listen for IPFIX template
58 | | ... | and data packets, verify that IPFIX reported the received packets.
59 | | ... | [Ref] RFC 7011
60 | | Given Configure path in 3-node circular topology
61 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
62 | | And Set interfaces in 3-node circular topology up
63 | | And VPP Interface Set IP Address | ${dut1_node}
64 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
65 | | And VPP Interface Set IP Address | ${dut1_node}
66 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${24}
67 | | And VPP Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip4}
68 | | ... | ${tg_to_dut1_mac}
69 | | And VPP Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
70 | | ... | ${tg_to_dut1_mac}
71 | | And VPP RA suppress link layer | ${dut1_node} | ${dut1_to_tg}
72 | | ${table_index} | ${skip_n} | ${match_n}=
73 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | src
74 | | And VPP configures classify session L3 | ${dut1_node} | permit
75 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | src
76 | | ... | ${tg_to_dut1_ip}
77 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
78 | | ... | ${table_index} | ip_version=${ip_version}
79 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip4}
80 | | ... | ${dut1_to_tg_ip4} | interval=5
81 | | And Set IPFIX stream | ${dut1_node} | ${1}
82 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
83 | | ... | ${ip_version}
84 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
85 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
86 | | ... | count=20000 | timeout=10
87
88 | TC02: DUT reports packet flow when multiple sessions are configured
89 | | [Documentation]
90 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
91 | | ... | address as collector and add several classify sessions with different
92 | | ... | ports.
93 | | ... | [Ver] Make TG send packets to DUT1 using a range of ports matching
94 | | ... | configured sessions, then listen for IPFIX template and data packets,
95 | | ... | verify that IPFIX reported the received packets for each session.
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}
111 | | ... | src proto l4 src_port dst_port
112 | | :FOR | ${index} | IN RANGE | ${sessions}
113 | | | VPP configures classify session generic | ${dut1_node}
114 | | | ... | acl-hit-next permit | ${table_index} | ${skip_n} | ${match_n}
115 | | | ... | l3 ${ip_version} src ${tg_to_dut1_ip}
116 | | | ... | proto 6 l4 src_port ${index} dst_port ${index}
117 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
118 | | ... | ${table_index} | ip_version=${ip_version}
119 | | And setup IPFIX exporter | ${dut1_node} | ${tg_to_dut1_ip4}
120 | | ... | ${dut1_to_tg_ip4} | interval=5
121 | | ... | mtu=1450 | interval=5
122 | | And Set IPFIX stream | ${dut1_node} | ${1}
123 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
124 | | ... | ${ip_version}
125 | | Then Send session sweep and verify IPFIX | ${tg_node} | ${dut1_node}
126 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${tg_to_dut1_ip} | ${dut1_to_tg_ip}
127 | | ... | ${sessions} | timeout=10 | count=3
128
129 # TODO: DUT reports packet flow when ACL is configured with wildcards