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