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