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