perf: add TCP Nginx+LDPRELOAD suites
[csit.git] / resources / libraries / robot / hoststack / hoststack.robot
1 # Copyright (c) 2021 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.InterfaceUtil
16 | Library | resources.libraries.python.IPUtil
17 | Library | resources.libraries.python.HoststackUtil
18 | Library | resources.libraries.python.NginxUtil
19 | Library | resources.libraries.python.NsimUtil
20 | Library | resources.tools.ab.ABTools
21 | Variables | resources/libraries/python/Constants.py
22 | Resource | resources/libraries/robot/ip/ip4.robot
23 | Resource | resources/libraries/robot/nsim/nsim.robot
24 | Resource | resources/libraries/robot/nginx/default.robot
25 |
26 | Documentation | L2 keywords to set up VPP to test hoststack.
27
28 *** Variables ***
29 | ${quic_crypto_engine}= | nocrypto
30 | ${quic_fifo_size}= | 4M
31 | &{vpp_hoststack_attr}=
32 | ... | rxq=${1}
33 | ... | rxd=${256}
34 | ... | txd=${256}
35 | ... | phy_cores=${1}
36 | ... | vpp_api_socket=${SOCKSVR_PATH}
37 | ... | api_seg_global_size=2G
38 | ... | api_seg_api_size=1G
39 | ... | tcp_cc_algo=cubic
40 | ... | sess_evt_q_seg_size=64M
41 | ... | sess_evt_q_length=16384
42 | ... | sess_prealloc_sess=1024
43 | ... | sess_v4_tbl_buckets=20000
44 | ... | sess_v4_tbl_mem=64M
45 | ... | sess_v4_hopen_buckets=20000
46 | ... | sess_v4_hopen_mem=64M
47 | ... | sess_lendpt_buckets=250000
48 | ... | sess_lendpt_mem=512M
49 | &{vpp_echo_server_attr}=
50 | ... | role=server
51 | ... | cpu_cnt=${1}
52 | ... | cfg_vpp_feature=${None}
53 | ... | namespace=default
54 | ... | vpp_api_socket=${vpp_hoststack_attr}[vpp_api_socket]
55 | ... | json_output=json
56 | ... | uri_protocol=quic
57 | ... | uri_ip4_addr=${EMPTY}
58 | ... | uri_port=1234
59 | ... | nthreads=1
60 | ... | mq_size=${vpp_hoststack_attr}[sess_evt_q_length]
61 | ... | nclients=1
62 | ... | quic_streams=1
63 | ... | time=sconnect:lastbyte
64 | ... | fifo_size=4M
65 | ... | rx_bytes=0
66 | ... | tx_bytes=0
67 | ... | rx_results_diff=${False}
68 | ... | tx_results_diff=${False}
69 | &{vpp_echo_client_attr}=
70 | ... | role=client
71 | ... | cpu_cnt=${1}
72 | ... | cfg_vpp_feature=${None}
73 | ... | namespace=default
74 | ... | vpp_api_socket=${vpp_hoststack_attr}[vpp_api_socket]
75 | ... | json_output=json
76 | ... | uri_protocol=quic
77 | ... | uri_ip4_addr=${EMPTY}
78 | ... | uri_port=1234
79 | ... | nthreads=1
80 | ... | mq_size=${vpp_hoststack_attr}[sess_evt_q_length]
81 | ... | nclients=1
82 | ... | quic_streams=1
83 | ... | time=sconnect:lastbyte
84 | ... | fifo_size=4M
85 | ... | rx_bytes=0
86 | ... | tx_bytes=0
87 | ... | rx_results_diff=${False}
88 | ... | tx_results_diff=${False}
89 | &{iperf3_server_attr}=
90 | ... | role=server
91 | ... | cpu_cnt=${1}
92 | ... | cfg_vpp_feature=${Empty}
93 | ... | namespace=default
94 | ... | vcl_config=vcl_iperf3.conf
95 | ... | ld_preload=${True}
96 | ... | transparent_tls=${False}
97 | ... | json=${True}
98 | ... | ip_version=${4}
99 | &{iperf3_client_attr}=
100 | ... | role=client
101 | ... | cpu_cnt=${1}
102 | ... | cfg_vpp_feature=${Empty}
103 | ... | namespace=default
104 | ... | vcl_config=vcl_iperf3.conf
105 | ... | ld_preload=${True}
106 | ... | transparent_tls=${False}
107 | ... | json=${True}
108 | ... | ip_version=${4}
109 | ... | ip_address=${EMPTY}
110 | ... | parallel=${1}
111 | ... | time=${20}
112 | &{nginx_server_attr}=
113 | ... | role=server
114 | ... | cpu_cnt=${1}
115 | ... | cfg_vpp_feature=${Empty}
116 | ... | namespace=default
117 | ... | vcl_config=vcl_iperf3.conf
118 | ... | ld_preload=${True}
119 | ... | transparent_tls=${False}
120 | ... | json=${True}
121 | ... | ip_version=${4}
122
123 *** Keywords ***
124 | Set VPP Hoststack Attributes
125 | | [Documentation]
126 | | ... | Set the VPP HostStack attributes in the vpp_hoststack_attr dictionary.
127 | |
128 | | ... | *Arguments:*
129 | | ... | - ${rxq} - Number of Rx Queues Type: int
130 | | ... | - ${rxd} - Number of Rx Descriptors Type: int
131 | | ... | - ${txd} - Number of Tx Descriptors Type: int
132 | | ... | - ${phy_cores} - Number of cores for workers Type: int
133 | | ... | - ${vpp_api_socket} - Path to VPP api socket file Type: string
134 | | ... | - ${api_seg_global_size} - Global API segment size Type: string
135 | | ... | - ${api_seg_api_size} - API segment API fifo size Type: string
136 | | ... | - ${tcp_cc_algo} - TCP congestion control algorithm Type: string
137 | | ... | - ${sess_evt_q_seg_size} - Session event queue segment size
138 | | ... | Type: string
139 | | ... | - ${sess_evt_q_length} - Session event queue length Type: string
140 | | ... | - ${sess_prealloc_sess} - Number of sessions to preallocate
141 | | ... | Type: string
142 | | ... | - ${sess_v4_tbl_buckets} - Number of IPv4 session table buckets
143 | | ... | Type: string
144 | | ... | - ${sess_v4_tbl_mem} - IPv4 session table memory size
145 | | ... | Type: string
146 | | ... | - ${sess_v4_hopen_buckets} - Number of IPv4 session
147 | | ... | half open table buckets Type: string
148 | | ... | - ${sess_v4_hopen_mem} - IPv4 session half open
149 | | ... | table memory size Type: string
150 | | ... | - ${sess_lendpt_buckets} - Number of session local endpoint
151 | | ... | table buckets Type: string
152 | | ... | - ${sess_lendpt_mem} - Session local endpoint
153 | | ... | table memory size Type: string
154 | |
155 | | ... | *Example:*
156 | |
157 | | ... | \| Set VPP Hoststack Attributes \| phy_cores=${phy_cores} \|
158 | |
159 | | [Arguments]
160 | | ... | ${rxq}=${vpp_hoststack_attr}[rxq]
161 | | ... | ${rxd}=${vpp_hoststack_attr}[rxd]
162 | | ... | ${txd}=${vpp_hoststack_attr}[txd]
163 | | ... | ${phy_cores}=${vpp_hoststack_attr}[phy_cores]
164 | | ... | ${vpp_api_socket}=${vpp_hoststack_attr}[vpp_api_socket]
165 | | ... | ${api_seg_global_size}=${vpp_hoststack_attr}[api_seg_global_size]
166 | | ... | ${api_seg_api_size}=${vpp_hoststack_attr}[api_seg_api_size]
167 | | ... | ${tcp_cc_algo}=${vpp_hoststack_attr}[tcp_cc_algo]
168 | | ... | ${sess_evt_q_seg_size}=${vpp_hoststack_attr}[sess_evt_q_seg_size]
169 | | ... | ${sess_evt_q_length}=${vpp_hoststack_attr}[sess_evt_q_length]
170 | | ... | ${sess_prealloc_sess}=${vpp_hoststack_attr}[sess_prealloc_sess]
171 | | ... | ${sess_v4_tbl_buckets}=${vpp_hoststack_attr}[sess_v4_tbl_buckets]
172 | | ... | ${sess_v4_tbl_mem}=${vpp_hoststack_attr}[sess_v4_tbl_mem]
173 | | ... | ${sess_v4_hopen_buckets}=${vpp_hoststack_attr}[sess_v4_hopen_buckets]
174 | | ... | ${sess_v4_hopen_mem}=${vpp_hoststack_attr}[sess_v4_hopen_mem]
175 | | ... | ${sess_lendpt_buckets}=${vpp_hoststack_attr}[sess_lendpt_buckets]
176 | | ... | ${sess_lendpt_mem}=${vpp_hoststack_attr}[sess_lendpt_mem]
177 | |
178 | | Set To Dictionary | ${vpp_hoststack_attr} | rxq | ${rxq}
179 | | Set To Dictionary | ${vpp_hoststack_attr} | rxd | ${rxd}
180 | | Set To Dictionary | ${vpp_hoststack_attr} | txd | ${txd}
181 | | Set To Dictionary | ${vpp_hoststack_attr} | phy_cores | ${phy_cores}
182 | | Set To Dictionary | ${vpp_hoststack_attr}
183 | | ... | vpp_api_socket | ${vpp_api_socket}
184 | | Set To Dictionary | ${vpp_hoststack_attr}
185 | | ... | api_seg_global_size | ${api_seg_global_size}
186 | | Set To Dictionary | ${vpp_hoststack_attr}
187 | | ... | api_seg_api_size | ${api_seg_api_size}
188 | | Set To Dictionary | ${vpp_hoststack_attr}
189 | | ... | tcp_cc_algo | ${tcp_cc_algo}
190 | | Set To Dictionary | ${vpp_hoststack_attr}
191 | | ... | sess_evt_q_seg_size | ${sess_evt_q_seg_size}
192 | | Set To Dictionary | ${vpp_hoststack_attr}
193 | | ... | sess_evt_q_length | ${sess_evt_q_length}
194 | | Set To Dictionary | ${vpp_hoststack_attr}
195 | | ... | sess_prealloc_sess | ${sess_prealloc_sess}
196 | | Set To Dictionary | ${vpp_hoststack_attr}
197 | | ... | sess_v4_tbl_buckets | ${sess_v4_tbl_buckets}
198 | | Set To Dictionary | ${vpp_hoststack_attr}
199 | | ... | sess_v4_tbl_mem | ${sess_v4_tbl_mem}
200 | | Set To Dictionary | ${vpp_hoststack_attr}
201 | | ... | sess_v4_hopen_buckets | ${sess_v4_hopen_buckets}
202 | | Set To Dictionary | ${vpp_hoststack_attr}
203 | | ... | sess_v4_hopen_mem | ${sess_v4_hopen_mem}
204 | | Set To Dictionary | ${vpp_hoststack_attr}
205 | | ... | sess_lendpt_buckets | ${sess_lendpt_buckets}
206 | | Set To Dictionary | ${vpp_hoststack_attr}
207 | | ... | sess_lendpt_mem | ${sess_lendpt_mem}
208
209 | Set VPP Echo Server Attributes
210 | | [Documentation]
211 | | ... | Set the HostStack vpp_echo test program attributes
212 | | ... | in the vpp_echo_server_attr dictionary.
213 | |
214 | | ... | *Arguments:*
215 | | ... | - ${cfg_vpp_feature} - VPP Feature requiring config Type: string
216 | | ... | - ${namespace} - Namespace Type: string
217 | | ... | - ${nthreads} - Number of threads Type: string
218 | | ... | - ${mq_size} - Number of threads Type: string
219 | | ... | - ${nclients} - Number of clients Type: string
220 | | ... | - ${quic_streams} - Number of quic streams Type: string
221 | | ... | - ${fifo_size} - Session Fifo Size Type: integer
222 | | ... | - ${time} - Timing events (start:end) Type: string
223 | | ... | - ${rx_bytes} - Number of Bytes to receive Type: string
224 | | ... | - ${tx_bytes} - Number of Bytes to send Type: string
225 | | ... | - ${rx_results_diff} - Rx Results are different to pass Type: boolean
226 | | ... | - ${tx_results_diff} - Tx Results are different to pass Type: boolean
227 | |
228 | | ... | *Example:*
229 | |
230 | | ... | \| Set VPP Echo Server Attributes \| nclients=${nclients} \|
231 | | ... | \| tx_bytes=${tx_bytes} \|
232 | |
233 | | [Arguments]
234 | | ... | ${cfg_vpp_feature}=${vpp_echo_server_attr}[cfg_vpp_feature]
235 | | ... | ${namespace}=${vpp_echo_server_attr}[namespace]
236 | | ... | ${nthreads}=${vpp_echo_server_attr}[nthreads]
237 | | ... | ${mq_size}=${vpp_echo_server_attr}[mq_size]
238 | | ... | ${nclients}=${vpp_echo_server_attr}[nclients]
239 | | ... | ${quic_streams}=${vpp_echo_server_attr}[quic_streams]
240 | | ... | ${time}=${vpp_echo_server_attr}[time]
241 | | ... | ${fifo_size}=${vpp_echo_server_attr}[fifo_size]
242 | | ... | ${rx_bytes}=${vpp_echo_server_attr}[rx_bytes]
243 | | ... | ${tx_bytes}=${vpp_echo_server_attr}[tx_bytes]
244 | | ... | ${rx_results_diff}=${vpp_echo_server_attr}[rx_results_diff]
245 | | ... | ${tx_results_diff}=${vpp_echo_server_attr}[tx_results_diff]
246 | |
247 | | Set To Dictionary | ${vpp_echo_server_attr} | cfg_vpp_feature
248 | | ... | ${cfg_vpp_feature}
249 | | Set To Dictionary | ${vpp_echo_server_attr} | namespace | ${namespace}
250 | | Set To Dictionary | ${vpp_echo_server_attr} | nthreads | ${nthreads}
251 | | Set To Dictionary | ${vpp_echo_server_attr} | mq_size | ${mq_size}
252 | | Set To Dictionary | ${vpp_echo_server_attr} | nclients | ${nclients}
253 | | Set To Dictionary | ${vpp_echo_server_attr} | quic_streams | ${quic_streams}
254 | | Set To Dictionary | ${vpp_echo_server_attr} | time | ${time}
255 | | Set To Dictionary | ${vpp_echo_server_attr} | fifo_size | ${fifo_size}
256 | | Set To Dictionary | ${vpp_echo_server_attr} | rx_bytes | ${rx_bytes}
257 | | Set To Dictionary | ${vpp_echo_server_attr} | tx_bytes | ${tx_bytes}
258 | | Set To Dictionary
259 | | ... | ${vpp_echo_server_attr} | rx_results_diff | ${rx_results_diff}
260 | | Set To Dictionary
261 | | ... | ${vpp_echo_server_attr} | tx_results_diff | ${tx_results_diff}
262
263 | Set VPP Echo Client Attributes
264 | | [Documentation]
265 | | ... | Set the HostStack vpp_echo test program attributes
266 | | ... | in the vpp_echo_client_attr dictionary.
267 | |
268 | | ... | *Arguments:*
269 | | ... | - ${cfg_vpp_feature} - VPP Feature requiring config Type: string
270 | | ... | - ${namespace} - Namespace Type: string
271 | | ... | - ${nthreads} - Number of threads Type: string
272 | | ... | - ${mq_size} - Number of threads Type: string
273 | | ... | - ${nclients} - Number of clients Type: string
274 | | ... | - ${quic_streams} - Number of quic streams Type: string
275 | | ... | - ${fifo_size} - Session Fifo Size Type: integer
276 | | ... | - ${time} - Timing events (start:end) Type: string
277 | | ... | - ${rx_bytes} - Number of Bytes to receive Type: string
278 | | ... | - ${tx_bytes} - Number of Bytes to send Type: string
279 | | ... | - ${rx_results_diff} - Rx Results are different to pass Type: boolean
280 | | ... | - ${tx_results_diff} - Tx Results are different to pass Type: boolean
281 | |
282 | | ... | *Example:*
283 | |
284 | | ... | \| Set VPP Echo Client Attributes \| nclients=${nclients} \|
285 | | ... | \| tx_bytes=${tx_bytes} \|
286 | |
287 | | [Arguments]
288 | | ... | ${cfg_vpp_feature}=${vpp_echo_client_attr}[cfg_vpp_feature]
289 | | ... | ${namespace}=${vpp_echo_client_attr}[namespace]
290 | | ... | ${nthreads}=${vpp_echo_client_attr}[nthreads]
291 | | ... | ${mq_size}=${vpp_echo_client_attr}[mq_size]
292 | | ... | ${nclients}=${vpp_echo_client_attr}[nclients]
293 | | ... | ${quic_streams}=${vpp_echo_client_attr}[quic_streams]
294 | | ... | ${time}=${vpp_echo_client_attr}[time]
295 | | ... | ${fifo_size}=${vpp_echo_client_attr}[fifo_size]
296 | | ... | ${rx_bytes}=${vpp_echo_client_attr}[rx_bytes]
297 | | ... | ${tx_bytes}=${vpp_echo_client_attr}[tx_bytes]
298 | | ... | ${rx_results_diff}=${vpp_echo_client_attr}[rx_results_diff]
299 | | ... | ${tx_results_diff}=${vpp_echo_client_attr}[tx_results_diff]
300 | |
301 | | Set To Dictionary | ${vpp_echo_client_attr} | cfg_vpp_feature
302 | | ... | ${cfg_vpp_feature}
303 | | Set To Dictionary | ${vpp_echo_client_attr} | namespace | ${namespace}
304 | | Set To Dictionary | ${vpp_echo_client_attr} | nthreads | ${nthreads}
305 | | Set To Dictionary | ${vpp_echo_client_attr} | mq_size | ${mq_size}
306 | | Set To Dictionary | ${vpp_echo_client_attr} | nclients | ${nclients}
307 | | Set To Dictionary | ${vpp_echo_client_attr} | quic_streams | ${quic_streams}
308 | | Set To Dictionary | ${vpp_echo_client_attr} | time | ${time}
309 | | Set To Dictionary | ${vpp_echo_client_attr} | fifo_size | ${fifo_size}
310 | | Set To Dictionary | ${vpp_echo_client_attr} | rx_bytes | ${rx_bytes}
311 | | Set To Dictionary | ${vpp_echo_client_attr} | tx_bytes | ${tx_bytes}
312 | | Set To Dictionary
313 | | ... | ${vpp_echo_client_attr} | rx_results_diff | ${rx_results_diff}
314 | | Set To Dictionary
315 | | ... | ${vpp_echo_client_attr} | tx_results_diff | ${tx_results_diff}
316
317 | Set Iperf3 Server Attributes
318 | | [Documentation]
319 | | ... | Set the HostStack iperf3 test program attributes
320 | | ... | in the iperf3_server_attr dictionary.
321 | |
322 | | ... | *Arguments:*
323 | | ... | - ${vcl_config} - VCL configuration file name Type: string
324 | | ... | - ${ld_preload} - Use the VCL LD_PRELOAD library Type: boolean
325 | | ... | - ${transparent_tls} - Use VCL Transparent-TLS mode Type: boolean
326 | | ... | - ${ip_version} - IP version (4 or 6) Type: int
327 | |
328 | | ... | *Example:*
329 | |
330 | | ... | \| Set Iperf3 Server Attributes \| vcl_config=${vcl_config} \|
331 | | ... | \| ip_version=${ip_version} \|
332 | |
333 | | [Arguments]
334 | | ... | ${vcl_config}=${iperf3_server_attr}[vcl_config]
335 | | ... | ${ld_preload}=${iperf3_server_attr}[ld_preload]
336 | | ... | ${transparent_tls}=${iperf3_server_attr}[transparent_tls]
337 | | ... | ${ip_version}=${iperf3_server_attr}[ip_version]
338 | |
339 | | Set To Dictionary | ${iperf3_server_attr} | vcl_config | ${vcl_config}
340 | | Set To Dictionary | ${iperf3_server_attr} | ld_preload | ${ld_preload}
341 | | Set To Dictionary | ${iperf3_server_attr} | transparent_tls
342 | | ... | ${transparent_tls}
343 | | Set To Dictionary | ${iperf3_server_attr} | ip_version | ${ip_version}
344
345 | Set Iperf3 Client Attributes
346 | | [Documentation]
347 | | ... | Set the HostStack iperf3 test program attributes
348 | | ... | in the iperf3_client_attr dictionary.
349 | |
350 | | ... | *Arguments:*
351 | | ... | - ${vcl_config} - VCL configuration file name Type: string
352 | | ... | - ${ld_preload} - Use the VCL LD_PRELOAD library Type: boolean
353 | | ... | - ${transparent_tls} - Use VCL Transparent-TLS mode Type: boolean
354 | | ... | - ${ip_version} - IP version (4 or 6) Type: int
355 | | ... | - ${parallel} - Number of parallel streams Type: int
356 | |
357 | | ... | *Example:*
358 | |
359 | | ... | \| Set Iperf3 Client Attributes \| vcl_config=${vcl_config} \|
360 | | ... | \| ip_version=${ip_version} \| parallel=${streams} \|
361 | |
362 | | [Arguments]
363 | | ... | ${vcl_config}=${iperf3_client_attr}[vcl_config]
364 | | ... | ${ld_preload}=${iperf3_client_attr}[ld_preload]
365 | | ... | ${transparent_tls}=${iperf3_client_attr}[transparent_tls]
366 | | ... | ${ip_version}=${iperf3_client_attr}[ip_version]
367 | | ... | ${parallel}=${iperf3_client_attr}[parallel]
368 | |
369 | | Set To Dictionary | ${iperf3_client_attr} | vcl_config | ${vcl_config}
370 | | Set To Dictionary | ${iperf3_client_attr} | ld_preload | ${ld_preload}
371 | | Set To Dictionary | ${iperf3_client_attr} | transparent_tls
372 | | ... | ${transparent_tls}
373 | | Set To Dictionary | ${iperf3_client_attr} | ip_version | ${ip_version}
374 | | Set To Dictionary | ${iperf3_client_attr} | parallel | ${parallel}
375
376 | Run hoststack test program on DUT
377 | | [Documentation]
378 | | ... | Configure IP address on the port, set it up and start the specified
379 | | ... | HostStack test program on the specified DUT.
380 | |
381 | | ... | *Arguments:*
382 | | ... | - ${node} - VPP DUT node Type: Node
383 | | ... | - ${intf} - VPP DUT node interface key Type: string
384 | | ... | - ${ip4_addr} - VPP DUT node interface ip4 address Type: string
385 | | ... | - ${ip4_mask} - VPP DUT node interface ip4 network mask Type: string
386 | | ... | - ${namespace} - Network namespace to run test program in Type: string
387 | | ... | - ${cfg_vpp_feature} - VPP hoststack feature requiring
388 | | ... | additional VPP configuration Type: string
389 | | ... | - ${core_list} - Cpu core affinity list Type: string
390 | | ... | - ${test_program} - Host Stack test program Type: dict
391 | |
392 | | ... | *Example:*
393 | |
394 | | ... | \| Run hoststack test program on DUT \| ${dut1} \| ${dut1_if1} \|
395 | | ... | \| ${dut1_if1_ip4_addr} \| ${dut1_if1_ip4_mask} \| default \|
396 | | ... | \| quic \| ${vpp_echo_server} \|
397 | |
398 | | [Arguments] | ${node} | ${intf} | ${ip4_addr} | ${ip4_mask}
399 | | | ... | ${namespace} | ${core_list} | ${cfg_vpp_feature}
400 | | | ... | ${test_program}
401 | |
402 | | ${is_dut1}= | Run Keyword And Return Status
403 | | ... | Dictionaries should be equal | ${node} | ${dut1}
404 | | Run Keyword If
405 | | ... | ${is_dut1} and ${vpp_nsim_attr}[output_nsim_enable]
406 | | ... | Configure VPP NSIM | ${node} | ${vpp_nsim_attr} | ${intf}
407 | | Run Keyword If | '${cfg_vpp_feature}' != ''
408 | | ... | Additional VPP Config for Feature ${cfg_vpp_feature} | ${node}
409 | | VPP Get Interface Data | ${node}
410 | | Set Interface State | ${node} | ${intf} | up
411 | | VPP Interface Set IP Address | ${node} | ${intf} | ${ip4_addr}
412 | | ... | ${ip4_mask}
413 | | Vpp Node Interfaces Ready Wait | ${node}
414 | | ${hoststack_test_program_pid}= | Start Hoststack Test Program
415 | | ... | ${node} | ${namespace} | ${core_list} | ${test_program}
416 | | Return From Keyword | ${hoststack_test_program_pid}
417
418 | Additional VPP Config For Feature quic
419 | | [Documentation]
420 | | ... | Configure VPP quic attributes on the specified DUT.
421 | |
422 | | ... | *Arguments:*
423 | | ... | - ${node} - VPP DUT node Type: Node
424 | |
425 | | [Arguments] | ${node}
426 | |
427 | | Set hoststack quic fifo size | ${node} | ${quic_fifo_size}
428 | | Set hoststack quic crypto engine | ${node} | ${quic_crypto_engine}
429
430 | Configure VPP hoststack attributes on all DUTs
431 | | [Documentation]
432 | | ... | Configure VPP HostStack attributes on all DUTs.
433 | |
434 | | Set Max Rate And Jumbo
435 | | Add worker threads to all DUTs
436 | | ... | ${vpp_hoststack_attr}[phy_cores] | ${vpp_hoststack_attr}[rxq]
437 | | ... | ${vpp_hoststack_attr}[rxd] | ${vpp_hoststack_attr}[txd]
438 | | Pre-initialize layer driver | ${nic_driver}
439 | | FOR | ${dut} | IN | @{duts}
440 | | | Import Library | resources.libraries.python.VppConfigGenerator
441 | | | ... | WITH NAME | ${dut}
442 | | | Run keyword | ${dut}.Add socksvr | ${vpp_hoststack_attr}[vpp_api_socket]
443 | | | Run keyword | ${dut}.Add api segment global size
444 | | | ... | ${vpp_hoststack_attr}[api_seg_global_size]
445 | | | Run keyword | ${dut}.Add api segment api size
446 | | | ... | ${vpp_hoststack_attr}[api_seg_api_size]
447 | | | Run Keyword If
448 | | | ... | '${dut}' == 'DUT1' and ${vpp_nsim_attr}[output_nsim_enable]
449 | | | ... | ${dut}.Add Nsim poll main thread
450 | | | Run keyword | ${dut}.Add api segment gid | testuser
451 | | | Run keyword | ${dut}.Add tcp congestion control algorithm
452 | | | ... | ${vpp_hoststack_attr}[tcp_cc_algo]
453 | | | Run keyword | ${dut}.Add session enable
454 | | | Run keyword | ${dut}.Add session event queues memfd segment
455 | | | Run keyword | ${dut}.Add session event queues segment size
456 | | | ... | ${vpp_hoststack_attr}[sess_evt_q_seg_size]
457 | | | Run keyword | ${dut}.Add session event queue length
458 | | | ... | ${vpp_hoststack_attr}[sess_evt_q_length]
459 | | | Run keyword | ${dut}.Add session preallocated sessions
460 | | | ... | ${vpp_hoststack_attr}[sess_prealloc_sess]
461 | | | Run keyword | ${dut}.Add session v4 session table buckets
462 | | | ... | ${vpp_hoststack_attr}[sess_v4_tbl_buckets]
463 | | | Run keyword | ${dut}.Add session v4 session table memory
464 | | | ... | ${vpp_hoststack_attr}[sess_v4_tbl_mem]
465 | | | Run keyword | ${dut}.Add session v4 halfopen table buckets
466 | | | ... | ${vpp_hoststack_attr}[sess_v4_hopen_buckets]
467 | | | Run keyword | ${dut}.Add session v4 halfopen table memory
468 | | | ... | ${vpp_hoststack_attr}[sess_v4_hopen_mem]
469 | | | Run keyword | ${dut}.Add session local endpoints table buckets
470 | | | ... | ${vpp_hoststack_attr}[sess_lendpt_buckets]
471 | | | Run keyword | ${dut}.Add session local endpoints table memory
472 | | | ... | ${vpp_hoststack_attr}[sess_lendpt_mem]
473 | | END
474 | | Apply startup configuration on all VPP DUTs
475
476 | Get Test Results From Hoststack VPP Echo Test
477 | | [Documentation]
478 | | ... | Configure IP address on the port, set it up and start the specified
479 | | ... | HostStack test programs on the DUTs. Gather test program
480 | | ... | output and append JSON formatted test data in message.
481 | | ... | Return boolean indicating there was a defered failure of either the
482 | | ... | server and/or client test programs.
483 | |
484 | | Set To Dictionary | ${vpp_echo_server_attr} | uri_ip4_addr
485 | | ... | ${dut2_if1_ip4_addr}
486 | | Set To Dictionary | ${vpp_echo_client_attr} | uri_ip4_addr
487 | | ... | ${dut2_if1_ip4_addr}
488 | | Configure VPP Hoststack Attributes on all DUTs
489 | | ${vpp_echo_server}= | Get VPP Echo Command | ${vpp_echo_server_attr}
490 | | ${skip_cnt}= | Evaluate
491 | | ... | ${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN} + ${vpp_hoststack_attr}[phy_cores]
492 | | ${numa}= | Get interfaces numa node | ${dut2} | ${dut2_if1}
493 | | ${core_list}= | Cpu list per node str | ${dut2} | ${numa}
494 | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${vpp_echo_server_attr}[cpu_cnt]
495 | | ${server_pid}= | Run hoststack test program on DUT
496 | | ... | ${dut2} | ${dut2_if1} | ${dut2_if1_ip4_addr} | ${dut2_if1_ip4_prefix}
497 | | ... | ${vpp_echo_server_attr}[namespace] | ${core_list}
498 | | ... | ${vpp_echo_server_attr}[cfg_vpp_feature] | ${vpp_echo_server}
499 | | ${vpp_echo_client}= | Get VPP Echo Command | ${vpp_echo_client_attr}
500 | | ${numa}= | Get interfaces numa node | ${dut1} | ${dut1_if1}
501 | | ${core_list}= | Cpu list per node str | ${dut1} | ${numa}
502 | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${vpp_echo_client_attr}[cpu_cnt]
503 | | ${client_pid}= | Run hoststack test program on DUT
504 | | ... | ${dut1} | ${dut1_if1} | ${dut1_if1_ip4_addr} | ${dut1_if1_ip4_prefix}
505 | | ... | ${vpp_echo_client_attr}[namespace] | ${core_list}
506 | | ... | ${vpp_echo_client_attr}[cfg_vpp_feature] | ${vpp_echo_client}
507 | | When Hoststack Test Program Finished | ${dut1} | ${client_pid}
508 | | ${client_defer_fail} | ${client_output}=
509 | | ... | Analyze hoststack test program output | ${dut1} | Client
510 | | ... | ${vpp_nsim_attr} | ${vpp_echo_client}
511 | | Then Set test message | ${client_output}
512 | | And Hoststack Test Program Finished | ${dut2} | ${server_pid}
513 | | ${server_defer_fail} | ${server_output}=
514 | | ... | Analyze hoststack test program output | ${dut2} | Server
515 | | ... | ${vpp_nsim_attr} | ${vpp_echo_server}
516 | | Set test message | ${server_output} | append=True
517 | | Run Keyword And Return | Hoststack Test Program Defer Fail
518 | | ... | ${server_defer_fail} | ${client_defer_fail}
519
520 | Get Test Results From Hoststack Iperf3 Test
521 | | [Documentation]
522 | | ... | Configure IP address on the port, set it up and start the specified
523 | | ... | HostStack test programs on the DUTs. Gather test program
524 | | ... | output and append JSON formatted test data in message.
525 | | ... | Return boolean indicating there was a defered failure of either the
526 | | ... | server and/or client test programs.
527 | |
528 | | Set To Dictionary | ${iperf3_client_attr} | ip_address
529 | | ... | ${dut2_if1_ip4_addr}
530 | | Configure VPP Hoststack Attributes on all DUTs
531 | | ${iperf3_server}= | Get Iperf3 Command | ${iperf3_server_attr}
532 | | ${skip_cnt}= | Evaluate
533 | | ... | ${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN} + ${vpp_hoststack_attr}[phy_cores]
534 | | ${numa}= | Get interfaces numa node | ${dut2} | ${dut2_if1}
535 | | ${core_list}= | Cpu list per node str | ${dut2} | ${numa}
536 | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${iperf3_server_attr}[cpu_cnt]
537 | | ${server_pid}= | Run hoststack test program on DUT
538 | | ... | ${dut2} | ${dut2_if1} | ${dut2_if1_ip4_addr} | ${dut2_if1_ip4_prefix}
539 | | ... | ${iperf3_server_attr}[namespace] | ${core_list}
540 | | ... | ${iperf3_server_attr}[cfg_vpp_feature] | ${iperf3_server}
541 | | ${iperf3_client}= | Get Iperf3 Command | ${iperf3_client_attr}
542 | | ${numa}= | Get interfaces numa node | ${dut1} | ${dut1_if1}
543 | | ${core_list}= | Cpu list per node str | ${dut1} | ${numa}
544 | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${iperf3_client_attr}[cpu_cnt]
545 | | ${client_pid}= | Run hoststack test program on DUT
546 | | ... | ${dut1} | ${dut1_if1} | ${dut1_if1_ip4_addr} | ${dut1_if1_ip4_prefix}
547 | | ... | ${iperf3_client_attr}[namespace] | ${core_list}
548 | | ... | ${iperf3_client_attr}[cfg_vpp_feature] | ${iperf3_client}
549 | | When Hoststack Test Program Finished | ${dut1} | ${client_pid}
550 | | ${client_defer_fail} | ${client_output}=
551 | | ... | Analyze hoststack test program output | ${dut1} | Client
552 | | ... | ${vpp_nsim_attr} | ${iperf3_client}
553 | | Then Set test message | ${client_output}
554 | | Return From Keyword | ${client_defer_fail}
555
556 | Set up LDP or VCL Nginx on DUT node
557 | | [Documentation]
558 | | ... | Setup for suites which uses VCL or LDP Nginx on DUT.
559 | |
560 | | ... | *Arguments:*
561 | | ... | - dut - DUT node.
562 | | ... | Type: string
563 | | ... | - mode - VCL Nginx or LDP Nginx.
564 | | ... | Type: string
565 | | ... | - rps_cps - Test request or connect.
566 | | ... | Type: string
567 | | ... | - core_num - Nginx work processes number.
568 | | ... | Type: int
569 | | ... | - qat - Whether to use the qat engine.
570 | | ... | Type: string
571 | | ... | - tls_tcp - TLS or TCP.
572 | |
573 | | ... | *Example:*
574 | |
575 | | ... | \| Set up LDP or VCL NGINX on DUT node \| ${dut} |${mode}\
576 | | ... | \| ${rps_cps} \| ${phy_cores} \| ${qat} \| ${tls_tcp} \|
577 | |
578 | | [Arguments] | ${dut} | ${mode} | ${rps_cps} | ${phy_cores} | ${qat}
579 | | ... | ${tls_tcp}
580 | |
581 | | Set Interface State | ${dut} | ${DUT1_${int}1}[0] | up
582 | | VPP Interface Set IP Address | ${dut} | ${DUT1_${int}1}[0]
583 | | ... | ${dut_ip_addrs}[0] | ${dut_ip_prefix}
584 | | Vpp Node Interfaces Ready Wait | ${dut}
585 | | ${skip_cnt}= | Evaluate
586 | | ... | ${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN} + ${vpp_hoststack_attr}[phy_cores]
587 | | ${numa}= | Get interfaces numa node | ${dut} | ${DUT1_${int}1}[0]
588 | | Apply Nginx configuration on DUT | ${dut} | ${phy_cores}
589 | | Set To Dictionary | ${nginx_server_attr} | ip_address
590 | | ... | ${dut_ip_addrs}[0]
591 | | ${core_list}= | Cpu list per node str | ${dut} | ${numa}
592 | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${nginx_server_attr}[cpu_cnt]
593 | | ${cpu_idle_list}= | Get cpu idle list | ${dut} | ${numa}
594 | | ... | ${smt_used} | ${cpu_alloc_str}
595 | | ${nginx_server}= | Get Nginx Command | ${nginx_server_attr}
596 | | ... | ${nginx_version} | ${packages_dir}
597 | | ${server_pid}= | Start Hoststack Test Program
598 | | ... | ${dut} | ${nginx_server_attr}[namespace] | ${core_list}
599 | | ... | ${nginx_server}
600 | | Taskset Nginx PID to idle cores | ${dut} | ${cpu_idle_list}
601
602 | Measure TLS requests or connections per second
603 | | [Documentation]
604 | | ... | Measure number of requests or connections per second using ab.
605 | |
606 | | ... | *Arguments:*
607 | | ... | - ${ciphers} - Specify SSL/TLS cipher suite
608 | | ... | - ${files} - Filename to be requested from the servers
609 | | ... | - ${tls_tcp} - Test TLS or TCP.
610 | | ... | - ${mode} - VCL Nginx or LDP Nginx.
611 | |
612 | | ... | *Example:*
613 | |
614 | | ... | \| Measure TLS requests or connections per second
615 | | ... | \| AES128-SHA \| 64 \| tls \| rps \|
616 | |
617 | | [Arguments] | ${ciphers} | ${files} | ${tls_tcp} | ${mode}
618 | |
619 | | ${output}= | Run ab | ${tg} | ${dut_ip_addrs}[0] | ${ab_ip_addrs}[0]
620 | | ... | ${tls_tcp} | ${ciphers} | ${files} | ${mode} | ${r_total} | ${c_total}
621 | | ... | ${listen_port}
622 | | Set test message | ${output}
623 | | Log VPP Hoststack data | ${dut1}