Patch to reset default VPP configuration in perf.
[csit.git] / resources / libraries / robot / performance.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/l2_xconnect.robot
18 | Resource | resources/libraries/robot/ipv4.robot
19 | Resource | resources/libraries/robot/bridge_domain.robot
20 | Resource | resources/libraries/robot/counters.robot
21 | Library | resources.libraries.python.TrafficGenerator
22 | Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl
23 | Documentation | Performance suite keywords
24
25 *** Keywords ***
26 | 3-node circular Topology Variables Setup
27 | | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']}
28 | | ...          | ${nodes['TG']}
29 | | Compute Path
30 | | ${tg_if1} | ${tg}= | Next Interface
31 | | ${dut1_if1} | ${dut1}= | Next Interface
32 | | ${dut1_if2} | ${dut1}= | Next Interface
33 | | ${dut2_if1} | ${dut2}= | Next Interface
34 | | ${dut2_if2} | ${dut2}= | Next Interface
35 | | ${tg_if2} | ${tg}= | Next Interface
36 | | Set Suite Variable | ${tg}
37 | | Set Suite Variable | ${tg_if1}
38 | | Set Suite Variable | ${tg_if2}
39 | | Set Suite Variable | ${dut1}
40 | | Set Suite Variable | ${dut1_if1}
41 | | Set Suite Variable | ${dut1_if2}
42 | | Set Suite Variable | ${dut2}
43 | | Set Suite Variable | ${dut2_if1}
44 | | Set Suite Variable | ${dut2_if2}
45
46 | 3-node circular Topology Variables Setup with DUT interface model
47 | | [Documentation] | Find a path between TG-DUT1-DUT2-TG based on interface
48 | | ...             | model provided as an argument. Set suite variables
49 | | ...             | tg, tg_if1, tg_if2, dut1, dut1_if1, dut1_if2,
50 | | ...             | dut2, dut2_if1, dut2_if2
51 | | [Arguments] | ${iface_model}
52 | | ${iface_model_list}= | Create list | ${iface_model}
53 | | Append Node | ${nodes['TG']}
54 | | Append Node | ${nodes['DUT1']} | filter_list=${iface_model_list}
55 | | Append Node | ${nodes['DUT2']} | filter_list=${iface_model_list}
56 | | Append Node | ${nodes['TG']}
57 | | Compute Path
58 | | ${tg_if1} | ${tg}= | Next Interface
59 | | ${dut1_if1} | ${dut1}= | Next Interface
60 | | ${dut1_if2} | ${dut1}= | Next Interface
61 | | ${dut2_if1} | ${dut2}= | Next Interface
62 | | ${dut2_if2} | ${dut2}= | Next Interface
63 | | ${tg_if2} | ${tg}= | Next Interface
64 | | Set Suite Variable | ${tg}
65 | | Set Suite Variable | ${tg_if1}
66 | | Set Suite Variable | ${tg_if2}
67 | | Set Suite Variable | ${dut1}
68 | | Set Suite Variable | ${dut1_if1}
69 | | Set Suite Variable | ${dut1_if2}
70 | | Set Suite Variable | ${dut2}
71 | | Set Suite Variable | ${dut2_if1}
72 | | Set Suite Variable | ${dut2_if2}
73
74 | IPv4 forwarding initialized in a 3-node circular topology
75 | | [Documentation] | Custom setup of IPv4 addresses on all DUT nodes and TG
76 | | Set Interface State | ${dut1} | ${dut1_if1} | up
77 | | Set Interface State | ${dut1} | ${dut1_if2} | up
78 | | Set Interface State | ${dut2} | ${dut2_if1} | up
79 | | Set Interface State | ${dut2} | ${dut2_if2} | up
80 | | ${tg1_if1_mac}= | Get Interface MAC | ${tg} | ${tg_if1}
81 | | ${tg1_if2_mac}= | Get Interface MAC | ${tg} | ${tg_if2}
82 | | ${dut1_if1_mac}= | Get Interface MAC | ${dut1} | ${dut1_if1}
83 | | ${dut1_if2_mac}= | Get Interface MAC | ${dut1} | ${dut1_if2}
84 | | ${dut2_if1_mac}= | Get Interface MAC | ${dut2} | ${dut1_if1}
85 | | ${dut2_if2_mac}= | Get Interface MAC | ${dut2} | ${dut1_if2}
86 | | dut1_v4.set_arp | ${dut1_if1} | 10.10.10.2 | ${tg1_if1_mac}
87 | | dut1_v4.set_arp | ${dut1_if2} | 1.1.1.2 | ${dut2_if1_mac}
88 | | dut2_v4.set_arp | ${dut2_if1} | 1.1.1.1 | ${dut1_if2_mac}
89 | | dut2_v4.set_arp | ${dut2_if2} | 20.20.20.2 | ${tg1_if2_mac}
90 | | dut1_v4.set_ip | ${dut1_if1} | 10.10.10.1 | 24
91 | | dut1_v4.set_ip | ${dut1_if2} | 1.1.1.1 | 30
92 | | dut2_v4.set_ip | ${dut2_if1} | 1.1.1.2 | 30
93 | | dut2_v4.set_ip | ${dut2_if2} | 20.20.20.1 | 24
94 | | dut1_v4.set_route | 20.20.20.0 | 24 | 1.1.1.2 | ${dut1_if2}
95 | | dut2_v4.set_route | 10.10.10.0 | 24 | 1.1.1.1 | ${dut2_if1}
96 | | All Vpp Interfaces Ready Wait | ${nodes}
97
98 | L2 xconnect initialized in a 3-node circular topology
99 | | [Documentation] | Custom setup of L2 xconnect topology
100 | | L2 setup xconnect on DUT | ${dut1} | ${dut1_if1} | ${dut1_if2}
101 | | L2 setup xconnect on DUT | ${dut2} | ${dut2_if1} | ${dut2_if2}
102 | | All Vpp Interfaces Ready Wait | ${nodes}
103
104 | L2 bridge domain initialized in a 3-node circular topology
105 | | [Documentation] | Custom setup of L2 bridge topology
106 | | Vpp l2bd forwarding setup | ${dut1} | ${dut1_if1} | ${dut1_if2}
107 | | Vpp l2bd forwarding setup | ${dut2} | ${dut2_if1} | ${dut2_if2}
108 | | All Vpp Interfaces Ready Wait | ${nodes}
109
110 | 3-node Performance Suite Setup
111 | | [Arguments] | ${topology_type}
112 | | Reset startup configuration of VPP on all DUTs
113 | | Update All Interface Data On All Nodes | ${nodes}
114 | | 3-node circular Topology Variables Setup
115 | | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2}
116 | | ...                          | ${dut1} | ${dut1_if1} | ${dut1_if2}
117 | | ...                          | ${dut2} | ${dut2_if1} | ${dut2_if2}
118 | | ...                          | ${topology_type}
119
120 3-node Performance Suite Setup with DUT's NIC model
121 | | [Arguments] | ${topology_type} | ${nic_model}
122 | | Reset startup configuration of VPP on all DUTs
123 | | Update All Interface Data On All Nodes | ${nodes}
124 | | 3-node circular Topology Variables Setup with DUT interface model
125 | | ... | ${nic_model}
126 | | Initialize traffic generator | ${tg} | ${tg_if1} | ${tg_if2}
127 | | ...                          | ${dut1} | ${dut1_if1} | ${dut1_if2}
128 | | ...                          | ${dut2} | ${dut2_if1} | ${dut2_if2}
129 | | ...                          | ${topology_type}
130
131 | 3-node Performance Suite Teardown
132 | | Teardown traffic generator | ${tg}
133
134 | Find NDR using linear search and pps
135 | | [Documentation] | Find throughput by using RFC2544 linear search
136 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
137 | | ...         | ${topology_type} | ${min_rate} | ${max_rate}
138 | | Set Duration | 60
139 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
140 | | Set Search Linear Step | ${step_rate}
141 | | Set Search Frame Size | ${framesize}
142 | | Set Search Rate Type pps
143 | | Linear Search | ${start_rate} | ${topology_type}
144 | | ${rate_per_stream}= | Verify Search Result
145 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
146
147 | Find NDR using binary search and pps
148 | | [Documentation] | Find throughput by using RFC2544 binary search
149 | | [Arguments] | ${framesize} | ${binary_min} | ${binary_max}
150 | | ...         | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
151 | | Set Duration | 60
152 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
153 | | Set Search Rate Type pps
154 | | Set Binary Convergence Threshold | ${threshold}
155 | | Binary Search | ${binary_min} | ${binary_max} | ${topology_type}
156 | | ${rate_per_stream}= | Verify Search Result
157 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
158
159 | Find NDR using combined search and pps
160 | | [Documentation] | Find throughput by using RFC2544 combined search
161 | | ...             | (linear + binary)
162 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
163 | | ...         | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
164 | | Set Duration | 60
165 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
166 | | Set Search Linear Step | ${step_rate}
167 | | Set Search Frame Size | ${framesize}
168 | | Set Search Rate Type pps
169 | | Set Binary Convergence Threshold | ${threshold}
170 | | Combined Search | ${start_rate} | ${topology_type}
171 | | ${rate_per_stream}= | Verify Search Result
172 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
173
174 | Display result of NDR search
175 | | [Documentation] | Display result of NDR search in packet per seconds (total
176 | | ...             | and per stream) and Gbps
177 | | [Arguments] | ${rate_per_stream} | ${framesize} | ${nr_streams}
178 | | ${rate_total}= | Evaluate | ${rate_per_stream}*${nr_streams}
179 | | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9)
180 | | Set Test Message | FINAL_RATE: ${rate_total} pps
181 | | Set Test Message | (${nr_streams}x ${rate_per_stream} pps) | append=yes
182 | | Set Test Message | FINAL_BANDWIDTH: ${bandwidth_total} Gbps | append=yes
183
184
185 | Traffic should pass with no loss
186 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
187 | | Send traffic on | ${tg} | ${duration}
188 | | ...             | ${rate} | ${framesize} | ${topology_type}
189 | | No traffic loss occurred