aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/robot/hoststack/hoststack.robot
blob: 0b82ff20b7ed69a1c8420f9528e7b46da2e505f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
# Copyright (c) 2024 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

*** Settings ***
| Library | resources.libraries.python.InterfaceUtil
| Library | resources.libraries.python.IPUtil
| Library | resources.libraries.python.HoststackUtil
| Library | resources.libraries.python.NginxUtil
| Library | resources.libraries.python.NsimUtil
| Library | resources.libraries.python.DMAUtil
| Library | resources.tools.ab.ABTools
| Variables | resources/libraries/python/Constants.py
| Resource | resources/libraries/robot/features/dma.robot
| Resource | resources/libraries/robot/ip/ip4.robot
| Resource | resources/libraries/robot/nsim/nsim.robot
| Resource | resources/libraries/robot/nginx/default.robot
|
| Documentation | *L2 keywords to set up VPP to test hoststack.*

*** Variables ***
| ${quic_crypto_engine}= | nocrypto
| ${quic_fifo_size}= | 4M
| &{vpp_hoststack_attr}=
| ... | rxq=${1}
| ... | rxd=${256}
| ... | txd=${256}
| ... | phy_cores=${1}
| ... | app_api_socket=/run/vpp/app_ns_sockets/default
| ... | tcp_cc_algo=cubic
| ... | sess_evt_q_length=16384
| ... | sess_prealloc_sess=1024
| ... | sess_v4_tbl_buckets=20000
| ... | sess_v4_tbl_mem=64M
| ... | sess_v4_hopen_buckets=20000
| ... | sess_v4_hopen_mem=64M
| ... | sess_lendpt_buckets=250000
| ... | sess_lendpt_mem=512M
| &{vpp_echo_server_attr}=
| ... | role=server
| ... | cpu_cnt=${1}
| ... | cfg_vpp_feature=${None}
| ... | namespace=default
| ... | app_api_socket=${vpp_hoststack_attr}[app_api_socket]
| ... | json_output=json
| ... | uri_protocol=quic
| ... | uri_ip4_addr=${EMPTY}
| ... | uri_port=1234
| ... | nthreads=1
| ... | mq_size=${vpp_hoststack_attr}[sess_evt_q_length]
| ... | nclients=1
| ... | quic_streams=1
| ... | time=sconnect:lastbyte
| ... | fifo_size=4M
| ... | rx_bytes=0
| ... | tx_bytes=0
| ... | rx_results_diff=${False}
| ... | tx_results_diff=${False}
| ... | use_app_socket_api=${True}
| &{vpp_echo_client_attr}=
| ... | role=client
| ... | cpu_cnt=${1}
| ... | cfg_vpp_feature=${None}
| ... | namespace=default
| ... | app_api_socket=${vpp_hoststack_attr}[app_api_socket]
| ... | json_output=json
| ... | uri_protocol=quic
| ... | uri_ip4_addr=${EMPTY}
| ... | uri_port=1234
| ... | nthreads=1
| ... | mq_size=${vpp_hoststack_attr}[sess_evt_q_length]
| ... | nclients=1
| ... | quic_streams=1
| ... | time=sconnect:lastbyte
| ... | fifo_size=4M
| ... | rx_bytes=0
| ... | tx_bytes=0
| ... | rx_results_diff=${False}
| ... | tx_results_diff=${False}
| ... | use_app_socket_api=${True}
| &{iperf3_server_attr}=
| ... | role=server
| ... | cpu_cnt=${1}
| ... | cfg_vpp_feature=${Empty}
| ... | namespace=default
| ... | vcl_config=vcl_iperf3.conf
| ... | ld_preload=${True}
| ... | transparent_tls=${False}
| ... | json=${True}
| ... | ip_version=${4}
| &{iperf3_client_attr}=
| ... | role=client
| ... | cpu_cnt=${1}
| ... | cfg_vpp_feature=${Empty}
| ... | namespace=default
| ... | vcl_config=vcl_iperf3.conf
| ... | ld_preload=${True}
| ... | transparent_tls=${False}
| ... | json=${True}
| ... | ip_version=${4}
| ... | ip_address=${EMPTY}
| ... | parallel=${1}
| ... | time=${20}
| ... | udp=${False}
| ... | bandwidth=10000000
| ... | length=${0}
| &{nginx_server_attr}=
| ... | role=server
| ... | cpu_cnt=${1}
| ... | cfg_vpp_feature=${Empty}
| ... | namespace=default
| ... | vcl_config=vcl_nginx.conf
| ... | ld_preload=${True}
| ... | transparent_tls=${False}
| ... | json=${True}
| ... | ip_version=${4}
| &{nginx_server_with_dma_attr}=
| ... | role=server
| ... | cpu_cnt=${1}
| ... | cfg_vpp_feature=${Empty}
| ... | namespace=default
| ... | vcl_config=vcl_dma.conf
| ... | ld_preload=${True}
| ... | transparent_tls=${False}
| ... | json=${True}
| ... | ip_version=${4}

*** Keywords ***
| Set VPP Hoststack Attributes
| | [Documentation]
| | ... | Set the VPP HostStack attributes in the vpp_hoststack_attr dictionary.
| |
| | ... | *Arguments:*
| | ... | - ${rxq} - Number of Rx Queues Type: int
| | ... | - ${rxd} - Number of Rx Descriptors Type: int
| | ... | - ${txd} - Number of Tx Descriptors Type: int
| | ... | - ${phy_cores} - Number of cores for workers Type: int
| | ... | - ${app_api_socket} - Path to application api socket file Type: string
| | ... | - ${tcp_cc_algo} - TCP congestion control algorithm Type: string
| | ... | Type: string
| | ... | - ${sess_evt_q_length} - Session event queue length Type: string
| | ... | - ${sess_prealloc_sess} - Number of sessions to preallocate
| | ... | Type: string
| | ... | - ${sess_v4_tbl_buckets} - Number of IPv4 session table buckets
| | ... | Type: string
| | ... | - ${sess_v4_tbl_mem} - IPv4 session table memory size
| | ... | Type: string
| | ... | - ${sess_v4_hopen_buckets} - Number of IPv4 session
| | ... | half open table buckets Type: string
| | ... | - ${sess_v4_hopen_mem} - IPv4 session half open
| | ... | table memory size Type: string
| | ... | - ${sess_lendpt_buckets} - Number of session local endpoint
| | ... | table buckets Type: string
| | ... | - ${sess_lendpt_mem} - Session local endpoint
| | ... | table memory size Type: string
| |
| | ... | *Example:*
| |
| | ... | \| Set VPP Hoststack Attributes \| phy_cores=${phy_cores} \|
| |
| | [Arguments]
| | ... | ${rxq}=${vpp_hoststack_attr}[rxq]
| | ... | ${rxd}=${vpp_hoststack_attr}[rxd]
| | ... | ${txd}=${vpp_hoststack_attr}[txd]
| | ... | ${phy_cores}=${vpp_hoststack_attr}[phy_cores]
| | ... | ${app_api_socket}=${vpp_hoststack_attr}[app_api_socket]
| | ... | ${tcp_cc_algo}=${vpp_hoststack_attr}[tcp_cc_algo]
| | ... | ${sess_evt_q_length}=${vpp_hoststack_attr}[sess_evt_q_length]
| | ... | ${sess_prealloc_sess}=${vpp_hoststack_attr}[sess_prealloc_sess]
| | ... | ${sess_v4_tbl_buckets}=${vpp_hoststack_attr}[sess_v4_tbl_buckets]
| | ... | ${sess_v4_tbl_mem}=${vpp_hoststack_attr}[sess_v4_tbl_mem]
| | ... | ${sess_v4_hopen_buckets}=${vpp_hoststack_attr}[sess_v4_hopen_buckets]
| | ... | ${sess_v4_hopen_mem}=${vpp_hoststack_attr}[sess_v4_hopen_mem]
| | ... | ${sess_lendpt_buckets}=${vpp_hoststack_attr}[sess_lendpt_buckets]
| | ... | ${sess_lendpt_mem}=${vpp_hoststack_attr}[sess_lendpt_mem]
| |
| | Set To Dictionary | ${vpp_hoststack_attr} | rxq | ${rxq}
| | Set To Dictionary | ${vpp_hoststack_attr} | rxd | ${rxd}
| | Set To Dictionary | ${vpp_hoststack_attr} | txd | ${txd}
| | Set To Dictionary | ${vpp_hoststack_attr} | phy_cores | ${phy_cores}
| | Set To Dictionary | ${vpp_hoststack_attr}
| | ... | app_api_socket | ${app_api_socket}
| | Set To Dictionary | ${vpp_hoststack_attr}
| | ... | tcp_cc_algo | ${tcp_cc_algo}
| | Set To Dictionary | ${vpp_hoststack_attr}
| | ... | sess_evt_q_length | ${sess_evt_q_length}
| | Set To Dictionary | ${vpp_hoststack_attr}
| | ... | sess_prealloc_sess | ${sess_prealloc_sess}
| | Set To Dictionary | ${vpp_hoststack_attr}
| | ... | sess_v4_tbl_buckets | ${sess_v4_tbl_buckets}
| | Set To Dictionary | ${vpp_hoststack_attr}
| | ... | sess_v4_tbl_mem | ${sess_v4_tbl_mem}
| | Set To Dictionary | ${vpp_hoststack_attr}
| | ... | sess_v4_hopen_buckets | ${sess_v4_hopen_buckets}
| | Set To Dictionary | ${vpp_hoststack_attr}
| | ... | sess_v4_hopen_mem | ${sess_v4_hopen_mem}
| | Set To Dictionary | ${vpp_hoststack_attr}
| | ... | sess_lendpt_buckets | ${sess_lendpt_buckets}
| | Set To Dictionary | ${vpp_hoststack_attr}
| | ... | sess_lendpt_mem | ${sess_lendpt_mem}

| Set VPP Echo Server Attributes
| | [Documentation]
| | ... | Set the HostStack vpp_echo test program attributes
| | ... | in the vpp_echo_server_attr dictionary.
| |
| | ... | *Arguments:*
| | ... | - ${cfg_vpp_feature} - VPP Feature requiring config Type: string
| | ... | - ${namespace} - Namespace Type: string
| | ... | - ${nthreads} - Number of threads Type: string
| | ... | - ${mq_size} - Number of threads Type: string
| | ... | - ${nclients} - Number of clients Type: string
| | ... | - ${quic_streams} - Number of quic streams Type: string
| | ... | - ${fifo_size} - Session Fifo Size Type: integer
| | ... | - ${time} - Timing events (start:end) Type: string
| | ... | - ${rx_bytes} - Number of Bytes to receive Type: string
| | ... | - ${tx_bytes} - Number of Bytes to send Type: string
| | ... | - ${rx_results_diff} - Rx Results are different to pass Type: boolean
| | ... | - ${tx_results_diff} - Tx Results are different to pass Type: boolean
| | ... | - ${use_app_socket_api} - Use app socket API instead of VPP API
| |
| | ... | *Example:*
| |
| | ... | \| Set VPP Echo Server Attributes \| nclients=${nclients} \|
| | ... | \| tx_bytes=${tx_bytes} \|
| |
| | [Arguments]
| | ... | ${cfg_vpp_feature}=${vpp_echo_server_attr}[cfg_vpp_feature]
| | ... | ${namespace}=${vpp_echo_server_attr}[namespace]
| | ... | ${nthreads}=${vpp_echo_server_attr}[nthreads]
| | ... | ${mq_size}=${vpp_echo_server_attr}[mq_size]
| | ... | ${nclients}=${vpp_echo_server_attr}[nclients]
| | ... | ${quic_streams}=${vpp_echo_server_attr}[quic_streams]
| | ... | ${time}=${vpp_echo_server_attr}[time]
| | ... | ${fifo_size}=${vpp_echo_server_attr}[fifo_size]
| | ... | ${rx_bytes}=${vpp_echo_server_attr}[rx_bytes]
| | ... | ${tx_bytes}=${vpp_echo_server_attr}[tx_bytes]
| | ... | ${rx_results_diff}=${vpp_echo_server_attr}[rx_results_diff]
| | ... | ${tx_results_diff}=${vpp_echo_server_attr}[tx_results_diff]
| | ... | ${use_app_socket_api}=${vpp_echo_server_attr}[use_app_socket_api]
| |
| | Set To Dictionary | ${vpp_echo_server_attr} | cfg_vpp_feature
| | ... | ${cfg_vpp_feature}
| | Set To Dictionary | ${vpp_echo_server_attr} | namespace | ${namespace}
| | Set To Dictionary | ${vpp_echo_server_attr} | nthreads | ${nthreads}
| | Set To Dictionary | ${vpp_echo_server_attr} | mq_size | ${mq_size}
| | Set To Dictionary | ${vpp_echo_server_attr} | nclients | ${nclients}
| | Set To Dictionary | ${vpp_echo_server_attr} | quic_streams | ${quic_streams}
| | Set To Dictionary | ${vpp_echo_server_attr} | time | ${time}
| | Set To Dictionary | ${vpp_echo_server_attr} | fifo_size | ${fifo_size}
| | Set To Dictionary | ${vpp_echo_server_attr} | rx_bytes | ${rx_bytes}
| | Set To Dictionary | ${vpp_echo_server_attr} | tx_bytes | ${tx_bytes}
| | Set To Dictionary
| | ... | ${vpp_echo_server_attr} | rx_results_diff | ${rx_results_diff}
| | Set To Dictionary
| | ... | ${vpp_echo_server_attr} | tx_results_diff | ${tx_results_diff}
| | Set To Dictionary
| | ... | ${vpp_echo_server_attr} | use_app_socket_api | ${use_app_socket_api}

| Set VPP Echo Client Attributes
| | [Documentation]
| | ... | Set the HostStack vpp_echo test program attributes
| | ... | in the vpp_echo_client_attr dictionary.
| |
| | ... | *Arguments:*
| | ... | - ${cfg_vpp_feature} - VPP Feature requiring config Type: string
| | ... | - ${namespace} - Namespace Type: string
| | ... | - ${nthreads} - Number of threads Type: string
| | ... | - ${mq_size} - Number of threads Type: string
| | ... | - ${nclients} - Number of clients Type: string
| | ... | - ${quic_streams} - Number of quic streams Type: string
| | ... | - ${fifo_size} - Session Fifo Size Type: integer
| | ... | - ${time} - Timing events (start:end) Type: string
| | ... | - ${rx_bytes} - Number of Bytes to receive Type: string
| | ... | - ${tx_bytes} - Number of Bytes to send Type: string
| | ... | - ${rx_results_diff} - Rx Results are different to pass Type: boolean
| | ... | - ${tx_results_diff} - Tx Results are different to pass Type: boolean
| | ... | - ${use_app_socket_api} - Use app socket API instead of VPP API
| |
| | ... | *Example:*
| |
| | ... | \| Set VPP Echo Client Attributes \| nclients=${nclients} \|
| | ... | \| tx_bytes=${tx_bytes} \|
| |
| | [Arguments]
| | ... | ${cfg_vpp_feature}=${vpp_echo_client_attr}[cfg_vpp_feature]
| | ... | ${namespace}=${vpp_echo_client_attr}[namespace]
| | ... | ${nthreads}=${vpp_echo_client_attr}[nthreads]
| | ... | ${mq_size}=${vpp_echo_client_attr}[mq_size]
| | ... | ${nclients}=${vpp_echo_client_attr}[nclients]
| | ... | ${quic_streams}=${vpp_echo_client_attr}[quic_streams]
| | ... | ${time}=${vpp_echo_client_attr}[time]
| | ... | ${fifo_size}=${vpp_echo_client_attr}[fifo_size]
| | ... | ${rx_bytes}=${vpp_echo_client_attr}[rx_bytes]
| | ... | ${tx_bytes}=${vpp_echo_client_attr}[tx_bytes]
| | ... | ${rx_results_diff}=${vpp_echo_client_attr}[rx_results_diff]
| | ... | ${tx_results_diff}=${vpp_echo_client_attr}[tx_results_diff]
| | ... | ${use_app_socket_api}=${vpp_echo_client_attr}[use_app_socket_api]
| |
| | Set To Dictionary | ${vpp_echo_client_attr} | cfg_vpp_feature
| | ... | ${cfg_vpp_feature}
| | Set To Dictionary | ${vpp_echo_client_attr} | namespace | ${namespace}
| | Set To Dictionary | ${vpp_echo_client_attr} | nthreads | ${nthreads}
| | Set To Dictionary | ${vpp_echo_client_attr} | mq_size | ${mq_size}
| | Set To Dictionary | ${vpp_echo_client_attr} | nclients | ${nclients}
| | Set To Dictionary | ${vpp_echo_client_attr} | quic_streams | ${quic_streams}
| | Set To Dictionary | ${vpp_echo_client_attr} | time | ${time}
| | Set To Dictionary | ${vpp_echo_client_attr} | fifo_size | ${fifo_size}
| | Set To Dictionary | ${vpp_echo_client_attr} | rx_bytes | ${rx_bytes}
| | Set To Dictionary | ${vpp_echo_client_attr} | tx_bytes | ${tx_bytes}
| | Set To Dictionary
| | ... | ${vpp_echo_client_attr} | rx_results_diff | ${rx_results_diff}
| | Set To Dictionary
| | ... | ${vpp_echo_client_attr} | tx_results_diff | ${tx_results_diff}
| | Set To Dictionary
| | ... | ${vpp_echo_client_attr} | use_app_socket_api | ${use_app_socket_api}

| Set Iperf3 Server Attributes
| | [Documentation]
| | ... | Set the HostStack iperf3 test program attributes
| | ... | in the iperf3_server_attr dictionary.
| |
| | ... | *Arguments:*
| | ... | - ${vcl_config} - VCL configuration file name Type: string
| | ... | - ${ld_preload} - Use the VCL LD_PRELOAD library Type: boolean
| | ... | - ${transparent_tls} - Use VCL Transparent-TLS mode Type: boolean
| | ... | - ${ip_version} - IP version (4 or 6) Type: int
| |
| | ... | *Example:*
| |
| | ... | \| Set Iperf3 Server Attributes \| vcl_config=${vcl_config} \|
| | ... | \| ip_version=${ip_version} \|
| |
| | [Arguments]
| | ... | ${vcl_config}=${iperf3_server_attr}[vcl_config]
| | ... | ${ld_preload}=${iperf3_server_attr}[ld_preload]
| | ... | ${transparent_tls}=${iperf3_server_attr}[transparent_tls]
| | ... | ${ip_version}=${iperf3_server_attr}[ip_version]
| |
| | Set To Dictionary | ${iperf3_server_attr} | vcl_config | ${vcl_config}
| | Set To Dictionary | ${iperf3_server_attr} | ld_preload | ${ld_preload}
| | Set To Dictionary | ${iperf3_server_attr} | transparent_tls
| | ... | ${transparent_tls}
| | Set To Dictionary | ${iperf3_server_attr} | ip_version | ${ip_version}

| Set Iperf3 Client Attributes
| | [Documentation]
| | ... | Set the HostStack iperf3 test program attributes
| | ... | in the iperf3_client_attr dictionary.
| |
| | ... | *Arguments:*
| | ... | - ${vcl_config} - VCL configuration file name Type: string
| | ... | - ${ld_preload} - Use the VCL LD_PRELOAD library Type: boolean
| | ... | - ${transparent_tls} - Use VCL Transparent-TLS mode Type: boolean
| | ... | - ${ip_version} - IP version (4 or 6) Type: int
| | ... | - ${parallel} - Number of parallel streams Type: int
| | ... | - ${bandwidth} - Target bandwidth in bits/sec Type: int
| | ... | - ${udp} - UDP or TCP protocol Type: boolean
| | ... | - ${length} - Packet Length Type: int
| |
| | ... | *Example:*
| |
| | ... | \| Set Iperf3 Client Attributes \| vcl_config=${vcl_config} \|
| | ... | \| ip_version=${ip_version} \| parallel=${streams} \|
| | ... | \| bandwidth=${bandwidth} | udp=${True} \|
| |
| | [Arguments]
| | ... | ${vcl_config}=${iperf3_client_attr}[vcl_config]
| | ... | ${ld_preload}=${iperf3_client_attr}[ld_preload]
| | ... | ${transparent_tls}=${iperf3_client_attr}[transparent_tls]
| | ... | ${ip_version}=${iperf3_client_attr}[ip_version]
| | ... | ${parallel}=${iperf3_client_attr}[parallel]
| | ... | ${bandwidth}=${iperf3_client_attr}[bandwidth]
| | ... | ${udp}=${iperf3_client_attr}[udp]
| | ... | ${length}=${iperf3_client_attr}[length]
| |
| | Set To Dictionary | ${iperf3_client_attr} | vcl_config | ${vcl_config}
| | Set To Dictionary | ${iperf3_client_attr} | ld_preload | ${ld_preload}
| | Set To Dictionary | ${iperf3_client_attr} | transparent_tls
| | ... | ${transparent_tls}
| | Set To Dictionary | ${iperf3_client_attr} | ip_version | ${ip_version}
| | Set To Dictionary | ${iperf3_client_attr} | parallel | ${parallel}
| | Set To Dictionary | ${iperf3_client_attr} | bandwidth | ${bandwidth}
| | Set To Dictionary | ${iperf3_client_attr} | udp | ${udp}
| | Set To Dictionary | ${iperf3_client_attr} | length | ${length}

| Run hoststack test program on DUT
| | [Documentation]
| | ... | Configure IP address on the port, set it up and start the specified
| | ... | HostStack test program on the specified DUT.
| |
| | ... | *Arguments:*
| | ... | - ${node} - VPP DUT node Type: Node
| | ... | - ${intf} - VPP DUT node interface key Type: string
| | ... | - ${ip4_addr} - VPP DUT node interface ip4 address Type: string
| | ... | - ${ip4_mask} - VPP DUT node interface ip4 network mask Type: string
| | ... | - ${namespace} - Network namespace to run test program in Type: string
| | ... | - ${cfg_vpp_feature} - VPP hoststack feature requiring
| | ... | additional VPP configuration Type: string
| | ... | - ${core_list} - Cpu core affinity list Type: string
| | ... | - ${test_program} - Host Stack test program Type: dict
| |
| | ... | *Example:*
| |
| | ... | \| Run hoststack test program on DUT \| ${dut1} \| ${dut1_if1} \|
| | ... | \| ${dut1_if1_ip4_addr} \| ${dut1_if1_ip4_mask} \| default \|
| | ... | \| quic \| ${vpp_echo_server} \|
| |
| | [Arguments] | ${node} | ${intf} | ${ip4_addr} | ${ip4_mask}
| | | ... | ${namespace} | ${core_list} | ${cfg_vpp_feature}
| | | ... | ${test_program}
| |
| | ${is_dut1}= | Run Keyword And Return Status
| | ... | Dictionaries should be equal | ${node} | ${dut1}
| | Run Keyword If
| | ... | ${is_dut1} and ${vpp_nsim_attr}[output_nsim_enable]
| | ... | Configure VPP NSIM | ${node} | ${vpp_nsim_attr} | ${intf}
| | Run Keyword If | '${cfg_vpp_feature}' != ''
| | ... | Additional VPP Config for Feature ${cfg_vpp_feature} | ${node}
| | VPP Get Interface Data | ${node}
| | Set Interface State | ${node} | ${intf} | up
| | VPP Interface Set IP Address | ${node} | ${intf} | ${ip4_addr}
| | ... | ${ip4_mask}
| | Vpp Node Interfaces Ready Wait | ${node}
| | ${hoststack_test_program_pid}= | Start Hoststack Test Program
| | ... | ${node} | ${namespace} | ${core_list} | ${test_program}
| | Return From Keyword | ${hoststack_test_program_pid}

| Additional VPP Config For Feature quic
| | [Documentation]
| | ... | Configure VPP quic attributes on the specified DUT.
| |
| | ... | *Arguments:*
| | ... | - ${node} - VPP DUT node Type: Node
| |
| | [Arguments] | ${node}
| |
| | Set hoststack quic fifo size | ${node} | ${quic_fifo_size}
| | Set hoststack quic crypto engine | ${node} | ${quic_crypto_engine}

| Configure VPP Hoststack Attributes on all DUTs
| | [Documentation]
| | ... | Configure VPP HostStack attributes on all DUTs.
| |
| | Set Max Rate And Jumbo
| | Add worker threads to all DUTs
| | ... | ${vpp_hoststack_attr}[phy_cores] | ${vpp_hoststack_attr}[rxq]
| | ... | ${vpp_hoststack_attr}[rxd] | ${vpp_hoststack_attr}[txd]
| | Pre-initialize layer driver | ${nic_driver}
| | FOR | ${dut} | IN | @{duts}
| | | Import Library | resources.libraries.python.VppConfigGenerator
| | | ... | WITH NAME | ${dut}
| | | Run Keyword If
| | | ... | '${dut}' == 'DUT1' and ${vpp_nsim_attr}[output_nsim_enable]
| | | ... | ${dut}.Add Nsim poll main thread
| | | Run keyword | ${dut}.Add api segment gid | testuser
| | | Run keyword | ${dut}.Add tcp congestion control algorithm
| | | ... | ${vpp_hoststack_attr}[tcp_cc_algo]
| | | Run keyword | ${dut}.Add session enable
| | | Run keyword | ${dut}.Add session app socket api
| | | Run keyword | ${dut}.Add session event queue length
| | | ... | ${vpp_hoststack_attr}[sess_evt_q_length]
| | | Run keyword | ${dut}.Add session preallocated sessions
| | | ... | ${vpp_hoststack_attr}[sess_prealloc_sess]
| | | Run keyword | ${dut}.Add session v4 session table buckets
| | | ... | ${vpp_hoststack_attr}[sess_v4_tbl_buckets]
| | | Run keyword | ${dut}.Add session v4 session table memory
| | | ... | ${vpp_hoststack_attr}[sess_v4_tbl_mem]
| | | Run keyword | ${dut}.Add session v4 halfopen table buckets
| | | ... | ${vpp_hoststack_attr}[sess_v4_hopen_buckets]
| | | Run keyword | ${dut}.Add session v4 halfopen table memory
| | | ... | ${vpp_hoststack_attr}[sess_v4_hopen_mem]
| | | Run keyword | ${dut}.Add session local endpoints table buckets
| | | ... | ${vpp_hoststack_attr}[sess_lendpt_buckets]
| | | Run keyword | ${dut}.Add session local endpoints table memory
| | | ... | ${vpp_hoststack_attr}[sess_lendpt_mem]
| | END
| | Apply startup configuration on all VPP DUTs

| Get Test Results From Hoststack VPP Echo Test
| | [Documentation]
| | ... | Configure IP address on the port, set it up and start the specified
| | ... | HostStack test programs on the DUTs. Gather test program
| | ... | output and append JSON formatted test data in message.
| | ... | Return boolean indicating there was a defered failure of either the
| | ... | server and/or client test programs.
| |
| | Set To Dictionary | ${vpp_echo_server_attr} | uri_ip4_addr
| | ... | ${dut2_if1_ip4_addr}
| | Set To Dictionary | ${vpp_echo_client_attr} | uri_ip4_addr
| | ... | ${dut2_if1_ip4_addr}
| | Configure VPP Hoststack Attributes on all DUTs
| | ${vpp_echo_server}= | Get VPP Echo Command | ${vpp_echo_server_attr}
| | ${skip_cnt}= | Evaluate
| | ... | ${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN} + ${vpp_hoststack_attr}[phy_cores]
| | ${numa}= | Get interfaces numa node | ${dut2} | ${dut2_if1}
| | ${core_list}= | Cpu list per node str | ${dut2} | ${numa}
| | ... | skip_cnt=${skip_cnt} | cpu_cnt=${vpp_echo_server_attr}[cpu_cnt]
| | FOR | ${action} | IN | @{stat_pre_trial}
| | | Run Keyword | Additional Statistics Action For ${action}
| | END
| | ${server_pid}= | Run hoststack test program on DUT
| | ... | ${dut2} | ${dut2_if1} | ${dut2_if1_ip4_addr} | ${dut2_if1_ip4_prefix}
| | ... | ${vpp_echo_server_attr}[namespace] | ${core_list}
| | ... | ${vpp_echo_server_attr}[cfg_vpp_feature] | ${vpp_echo_server}
| | ${vpp_echo_client}= | Get VPP Echo Command | ${vpp_echo_client_attr}
| | ${numa}= | Get interfaces numa node | ${dut1} | ${dut1_if1}
| | ${core_list}= | Cpu list per node str | ${dut1} | ${numa}
| | ... | skip_cnt=${skip_cnt} | cpu_cnt=${vpp_echo_client_attr}[cpu_cnt]
| | ${client_pid}= | Run hoststack test program on DUT
| | ... | ${dut1} | ${dut1_if1} | ${dut1_if1_ip4_addr} | ${dut1_if1_ip4_prefix}
| | ... | ${vpp_echo_client_attr}[namespace] | ${core_list}
| | ... | ${vpp_echo_client_attr}[cfg_vpp_feature] | ${vpp_echo_client}
| | When Hoststack Test Program Finished | ${dut1} | ${client_pid}
| | ... | ${vpp_echo_client} | ${dut2} | ${vpp_echo_server}
| | ${client_defer_fail} | ${client_output}=
| | ... | Analyze hoststack test program output | ${dut1} | Client
| | ... | ${vpp_nsim_attr} | ${vpp_echo_client}
| | Then Set test message | ${client_output}
| | And Hoststack Test Program Finished | ${dut2} | ${server_pid}
| | ... | ${vpp_echo_server} | ${dut1} | ${vpp_echo_client}
| | ${server_defer_fail} | ${server_output}=
| | ... | Analyze hoststack test program output | ${dut2} | Server
| | ... | ${vpp_nsim_attr} | ${vpp_echo_server}
| | FOR | ${action} | IN | @{stat_post_trial}
| | | Run Keyword | Additional Statistics Action For ${action}
| | END
| | Set test message | ${server_output} | append=True
| | Run Keyword And Return | Hoststack Test Program Defer Fail
| | ... | ${server_defer_fail} | ${client_defer_fail}

| Get Test Results From Hoststack Iperf3 Test
| | [Documentation]
| | ... | Configure IP address on the port, set it up and start the specified
| | ... | HostStack test programs on the DUTs. Gather test program
| | ... | output and append JSON formatted test data in message.
| | ... | Return boolean indicating there was a defered failure of either the
| | ... | server and/or client test programs.
| |
| | Set To Dictionary | ${iperf3_client_attr} | ip_address
| | ... | ${dut2_if1_ip4_addr}
| | Configure VPP Hoststack Attributes on all DUTs
| | ${iperf3_server}= | Get Iperf3 Command | ${iperf3_server_attr}
| | ${skip_cnt}= | Evaluate
| | ... | ${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN} + ${vpp_hoststack_attr}[phy_cores]
| | ${numa}= | Get interfaces numa node | ${dut2} | ${dut2_if1}
| | ${core_list}= | Cpu list per node str | ${dut2} | ${numa}
| | ... | skip_cnt=${skip_cnt} | cpu_cnt=${iperf3_server_attr}[cpu_cnt]
| | FOR | ${action} | IN | @{stat_pre_trial}
| | | Run Keyword | Additional Statistics Action For ${action}
| | END
| | ${server_pid}= | Run hoststack test program on DUT
| | ... | ${dut2} | ${dut2_if1} | ${dut2_if1_ip4_addr} | ${dut2_if1_ip4_prefix}
| | ... | ${iperf3_server_attr}[namespace] | ${core_list}
| | ... | ${iperf3_server_attr}[cfg_vpp_feature] | ${iperf3_server}
| | ${iperf3_client}= | Get Iperf3 Command | ${iperf3_client_attr}
| | ${numa}= | Get interfaces numa node | ${dut1} | ${dut1_if1}
| | ${core_list}= | Cpu list per node str | ${dut1} | ${numa}
| | ... | skip_cnt=${skip_cnt} | cpu_cnt=${iperf3_client_attr}[cpu_cnt]
| | ${client_pid}= | Run hoststack test program on DUT
| | ... | ${dut1} | ${dut1_if1} | ${dut1_if1_ip4_addr} | ${dut1_if1_ip4_prefix}
| | ... | ${iperf3_client_attr}[namespace] | ${core_list}
| | ... | ${iperf3_client_attr}[cfg_vpp_feature] | ${iperf3_client}
| | When Hoststack Test Program Finished | ${dut1} | ${client_pid}
| | ... | ${iperf3_client} | ${dut2} | ${iperf3_server}
| | FOR | ${action} | IN | @{stat_post_trial}
| | | Run Keyword | Additional Statistics Action For ${action}
| | END
| | ${client_defer_fail} | ${client_output}=
| | ... | Analyze hoststack test program output | ${dut1} | Client
| | ... | ${vpp_nsim_attr} | ${iperf3_client}
| | Then Set test message | ${client_output}
| | Return From Keyword | ${client_defer_fail}

| Set up LDP or VCL Nginx on DUT1 node
| | [Documentation]
| | ... | Setup for suites which uses VCL or LDP Nginx on DUT1.
| |
| | ... | Currently hardcoded to work on DUT1, assuming its node dict
| | ... | and similar values like \${DUT1_cpu_alloc_str} are already defined.
| |
| | ... | *Arguments:*
| | ... | - mode - VCL Nginx or LDP Nginx. Type: string
| | ... | - rps_cps - Test rps or cps. Type: string
| | ... | - core_num - Nginx work processes number. Type: int
| | ... | - qat - Whether to use the qat engine. Type: string
| | ... | - tls_tcp - TLS or TCP. Type: string
| | ... | - use_dma - Whether to use DMA, Default: False. Type: bool
| |
| | ... | *Example:*
| |
| | ... | \| Set up LDP or VCL NGINX on DUT1 node \| ${mode}\
| | ... | \| ${rps_cps} \| ${phy_cores} \| ${qat} \| ${tls_tcp} \|
| |
| | [Arguments] | ${mode} | ${rps_cps} | ${phy_cores} | ${qat} | ${tls_tcp}
| | | ... | ${use_dma}=${False}
| |
| | Set Interface State | ${DUT1} | ${DUT1_${int}1}[0] | up
| | VPP Interface Set IP Address | ${DUT1} | ${DUT1_${int}1}[0]
| | ... | ${dut_ip_addrs}[0] | ${dut_ip_prefix}
| | Vpp Node Interfaces Ready Wait | ${DUT1}
| | ${skip_cnt}= | Evaluate
| | ... | ${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN} + ${vpp_hoststack_attr}[phy_cores]
| | ${numa}= | Get interfaces numa node | ${DUT1} | ${DUT1_${int}1}[0]
| | Apply Nginx configuration on DUT | ${DUT1} | ${phy_cores}
| | ${attr}= | Run Keyword If | ${use_dma} == ${True}
| | ... | Set Variable | ${nginx_server_with_dma_attr}
| | ... | ELSE | Set Variable | ${nginx_server_attr}
| | Set To Dictionary | ${attr} | ip_address
| | ... | ${dut_ip_addrs}[0]
| | ${core_list}= | Cpu list per node str | ${DUT1} | ${numa}
| | ... | skip_cnt=${skip_cnt} | cpu_cnt=${attr}[cpu_cnt]
| | ... | smt_used=${smt_used}
| | ${cpu_idle}= | Cpu List per node | ${DUT1} | ${numa}
| | ${cpu_idle_list}= | Get Slice From List | ${cpu_idle}
| | ... | ${${skip_cnt} + ${attr}[cpu_cnt]}
| | ${nginx_server}= | Get Nginx Command | ${attr}
| | ... | ${nginx_version} | ${packages_dir}
| | Start Hoststack Test Program
| | ... | ${DUT1} | ${attr}[namespace] | ${core_list}
| | ... | ${nginx_server}
| | Get Hoststack Test Program Logs | ${DUT1} | ${nginx_server}
| | Taskset Nginx PID to idle cores | ${DUT1} | ${cpu_idle_list}

| Measure TLS requests or connections per second
| | [Documentation]
| | ... | Measure number of requests or connections per second using ab.
| |
| | ... | *Arguments:*
| | ... | - ${ciphers} - Specify SSL/TLS cipher suite
| | ... | - ${files} - Filename to be requested from the servers
| | ... | - ${tls_tcp} - Test TLS or TCP.
| | ... | - ${mode} - VCL Nginx or LDP Nginx.
| |
| | ... | *Example:*
| |
| | ... | \| Measure TLS requests or connections per second
| | ... | \| AES128-SHA \| 64 \| tls \| rps \|
| |
| | [Arguments] | ${ciphers} | ${files} | ${tls_tcp} | ${mode}
| |
| | ${dut_ip_addrs_str} | Evaluate | ','.join(${dut_ip_addrs})
| | ${ad_ip_addrs_str} | Evaluate | ','.join(${ab_ip_addrs})
| | FOR | ${action} | IN | @{stat_pre_trial}
| | | Run Keyword | Additional Statistics Action For ${action}
| | END
| | ${output}= | Run ab | ${tg} | ${dut_ip_addrs_str} | ${ad_ip_addrs_str}
| | ... | ${tls_tcp} | ${ciphers} | ${files} | ${mode} | ${r_total} | ${c_total}
| | ... | ${listen_port}
| | FOR | ${action} | IN | @{stat_post_trial}
| | | Run Keyword | Additional Statistics Action For ${action}
| | END
| | Set test message | ${output}

| Configure VPP startup configuration for NGINX
| | [Documentation]
| | ... | COnfigure VPP startup configuration for NGINX related tests
| |
| | [Arguments] | ${sess_prealloc_sess} | ${sess_evt_q_length}
| | ... | ${v4_sess_tbl_buckets} | ${v4_sess_tbl_mem} | ${local_endpts_tbl_buckets}
| | ... | ${local_endpts_tbl_mem} | ${tcp_prealloc_conns} | ${tcp_prealloc_ho_conns}
| |
| | FOR | ${dut} | IN | @{duts}
| | | Import Library | resources.libraries.python.VppConfigGenerator
| | | ... | WITH NAME | ${dut}
| | | Run keyword | ${dut}.Add session enable
| | | Run keyword | ${dut}.Add session app socket api
| | | Run keyword | ${dut}.Add session preallocated sessions
| | | ... | ${sess_prealloc_sess}
| | | Run keyword | ${dut}.Add session event queue length
| | | ... | ${sess_evt_q_length}
| | | Run keyword | ${dut}.Add session v4 session table buckets
| | | ... | ${v4_sess_tbl_buckets}
| | | Run keyword | ${dut}.Add session v4 session table memory
| | | ... | ${v4_sess_tbl_mem}
| | | Run keyword | ${dut}.Add session local endpoints table buckets
| | | ... | ${local_endpts_tbl_buckets}
| | | Run keyword | ${dut}.Add session local endpoints table memory
| | | ... | ${local_endpts_tbl_mem}
| | | Run keyword | ${dut}.Add tcp preallocated connections
| | | ... | ${tcp_prealloc_conns}
| | | Run keyword | ${dut}.Add tcp preallocated half open connections
| | | ... | ${tcp_prealloc_ho_conns}
| | END

| Add Additional Startup Configuration For DMA On All DUTs
| | [Documentation]
| | ... | Add additional startup configuration for DMA on all DUTs
| |
| | [Arguments] | ${use_dma}=${True}
| |
| | FOR | ${dut} | IN | @{duts}
| | | Import Library | resources.libraries.python.VppConfigGenerator
| | | ... | WITH NAME | ${dut}
| | | Run keyword | ${dut}.Add Session Event Queues Memfd Segment
| | | Run keyword | ${dut}.Add TCP Congestion Control Algorithm
| | | Run keyword | ${dut}.Add TCP Tso
| | | Run keyword | ${dut}.Add Session Enable
| | | Run keyword If | ${use_dma} == ${True}
| | | ... | ${dut}.Add Session Use Dma
| | | Run keyword If | ${use_dma} == ${True}
| | | ... | Enable DMA WQs on all DUTs
| | | Run keyword If | ${use_dma} == ${True}
| | | ... | ${dut}.Add DMA Dev | ${${dut}_dma_wqs}
| | | Run keyword If | '${nic_driver}' == 'vfio-pci'
| | | ... | ${dut}.Add DPDK Dev Default Tso
| | | Run keyword If | '${nic_driver}' == 'vfio-pci'
| | | ... | ${dut}.Add DPDK Enable Tcp Udp Checksum
| | END