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