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