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