diff options
Diffstat (limited to 'resources/libraries/robot')
27 files changed, 1011 insertions, 597 deletions
diff --git a/resources/libraries/robot/crypto/ipsec.robot b/resources/libraries/robot/crypto/ipsec.robot index 8be8230c3d..ebaac15bc8 100644 --- a/resources/libraries/robot/crypto/ipsec.robot +++ b/resources/libraries/robot/crypto/ipsec.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# 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: @@ -152,18 +152,16 @@ | | ... | ${r_tunnel} | ${l_tunnel} | | VPP IPsec Add SPD | ${node} | ${spd_id} | | VPP IPsec SPD Add If | ${node} | ${spd_id} | ${interface} -| | ${action}= | Policy Action Bypass -| | VPP IPsec Add SPD Entry | ${node} | ${spd_id} | ${p_hi} | ${action} -| | ... | inbound=${TRUE} | proto=${ESP_PROTO} | is_ipv6=${is_ipv6} +| | VPP IPsec Add SPD Entry | ${node} | ${spd_id} | ${p_hi} | BYPASS +| | ... | inbound=${TRUE} | proto=ESP | is_ipv6=${is_ipv6} | | ... | laddr_range=${tg_tun_ip} | raddr_range=${dut_tun_ip} -| | VPP IPsec Add SPD Entry | ${node} | ${spd_id} | ${p_hi} | ${action} -| | ... | inbound=${FALSE} | proto=${ESP_PROTO} | is_ipv6=${is_ipv6} +| | VPP IPsec Add SPD Entry | ${node} | ${spd_id} | ${p_hi} | BYPASS +| | ... | inbound=${FALSE} | proto=ESP | is_ipv6=${is_ipv6} | | ... | laddr_range=${dut_tun_ip} | raddr_range=${tg_tun_ip} -| | ${action}= | Policy Action Protect -| | VPP IPsec Add SPD Entry | ${node} | ${spd_id} | ${p_lo} | ${action} +| | VPP IPsec Add SPD Entry | ${node} | ${spd_id} | ${p_lo} | PROTECT | | ... | sa_id=${r_sa_id} | laddr_range=${l_ip} | | ... | raddr_range=${r_ip} | inbound=${TRUE} -| | VPP IPsec Add SPD Entry | ${node} | ${spd_id} | ${p_lo} | ${action} +| | VPP IPsec Add SPD Entry | ${node} | ${spd_id} | ${p_lo} | PROTECT | | ... | sa_id=${l_sa_id} | laddr_range=${l_ip} | | ... | raddr_range=${r_ip} | inbound=${FALSE} @@ -240,13 +238,42 @@ | | ... | on all DUT nodes (leaving feature plane workers disabled). | | | | VPP Round Robin Rx Placement on all DUTs -| | ... | ${nodes} | prefix=${EMPTY} | workers=${cpu_dp} +| | ... | ${nodes} | prefix=${EMPTY} | use_dp_cores=${True} | | VPP IPSec Crypto SW Scheduler Set Worker on all DUTs -| | ... | ${nodes} | workers=${cpu_dp} | crypto_enable=${False} +| | ... | ${nodes} | crypto_enable=${False} + +| Enable SPD flow cache IPv4 Inbound +| | [Documentation] +| | ... | Enable IPv4 Inbound SPD flow cache in VPP configuration file. +| | +| | FOR | ${dut} | IN | @{duts} +| | | Run Keyword | ${dut}.Add IPsec SPD Flow cache IPv4 Inbound | on +| | | Run Keyword | ${dut}.Add IPsec SPD Fast Path IPv4 Inbound | on +| | END | Enable SPD flow cache IPv4 Outbound | | [Documentation] | | ... | Enable IPv4 Outbound SPD flow cache in VPP configuration file. | | | | FOR | ${dut} | IN | @{duts} -| | | Run Keyword | ${dut}.Add SPD Flow Cache IPv4 Outbound +| | | Run Keyword | ${dut}.Add IPsec SPD Flow cache IPv4 Outbound | on +| | | Run Keyword | ${dut}.Add IPsec SPD Fast Path IPv4 Outbound | on +| | END + +| Enable IPsec SPD Fast Path IPv4 Inbound and Outbound +| | [Documentation] +| | ... | Enable IPsec SPD fast path IPv4 Inbound and outbound in VPP +| | ... | configuration file. +| | +| | ... | *Arguments:* +| | ... | - value - The number buckets for spd fast path. Type: int +| | +| | [Arguments] | ${value} +| | +| | FOR | ${dut} | IN | @{duts} +| | | Run Keyword | ${dut}.Add IPsec SPD Flow Cache IPv4 Outbound | off +| | | Run Keyword | ${dut}.Add IPsec SPD Flow Cache IPv4 Inbound | off +| | | Run Keyword | ${dut}.Add IPsec SPD Fast Path IPv4 Outbound | on +| | | Run Keyword | ${dut}.Add IPsec SPD Fast Path IPv4 Inbound | on +| | | Run Keyword | ${dut}.Add IPsec SPD Fast Path Num Buckets | ${value} +| | END diff --git a/resources/libraries/robot/dpdk/default.robot b/resources/libraries/robot/dpdk/default.robot deleted file mode 100644 index 9fd6379afd..0000000000 --- a/resources/libraries/robot/dpdk/default.robot +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright (c) 2021 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.CpuUtils -| Library | resources.libraries.python.DPDK.TestpmdTest -| Library | resources.libraries.python.DPDK.L3fwdTest -| Library | Collections - -*** Keywords *** -| Start testpmd on all DUTs -| | [Documentation] | Start the testpmd with M worker threads and rxqueues N and -| | ... | jumbo support frames on/off on all DUTs. -| | -| | ... | *Arguments:* -| | ... | - phy_cores - Number of physical cores to use. Type: integer -| | ... | - rx_queues - Number of RX queues. Type: integer -| | ... | - jumbo_frames - Jumbo frames on/off: boolean -| | ... | - rxd - Number of RX descriptors. Type: integer -| | ... | - txd - Number of TX descriptors. Type: integer -| | -| | ... | *Example:* -| | -| | ... | \| Start testpmd on all DUTs \| ${1} \| ${1} \| ${False} \| -| | -| | [Arguments] | ${phy_cores} | ${rx_queues}=${None} | ${jumbo_frames}=${False} -| | ... | ${rxd}=${None} | ${txd}=${None} -| | -| | ${cpu_count_int} | Convert to Integer | ${phy_cores} -| | ${dp_count_int} | Convert to Integer | ${phy_cores} -| | ${dp_cores}= | Evaluate | ${cpu_count_int}+1 -| | FOR | ${dut} | IN | @{duts} -| | | &{compute_resource_info}= | Get Affinity Vswitch -| | | ... | ${nodes} | ${dut} | ${phy_cores} | rx_queues=${rx_queues} -| | | ... | rxd=${rxd} | txd=${txd} -| | | Set Test Variable | &{compute_resource_info} -| | | Create compute resources variables -| | | Start testpmd -| | | ... | ${nodes['${dut}']} | ${${dut}_pf1}[0] | ${${dut}_pf2}[0] -| | | ... | ${cpu_dp} | ${dp_count_int} | ${rxq_count_int} | ${jumbo_frames} -| | | ... | ${nic_rxq_size} | ${nic_txq_size} -| | END - -| Start l3fwd on all DUTs -| | [Documentation] | Start the l3fwd with M worker threads and rxqueues N and -| | ... | jumbo support frames on/off on all DUTs. -| | -| | ... | *Arguments:* -| | ... | - phy_cores - Number of physical cores to use. Type: integer -| | ... | - rx_queues - Number of RX queues. Type: integer -| | ... | - jumbo_frames - Jumbo frames on/off: boolean -| | ... | - rxd - Number of RX descriptors. Type: integer -| | ... | - txd - Number of TX descriptors. Type: integer -| | -| | ... | *Example:* -| | -| | ... | \| Start l3fwd on all DUTs \| ${1} \| ${1} \| ${False} \| -| | -| | [Arguments] | ${phy_cores} | ${rx_queues}=${None} | ${jumbo_frames}=${False} -| | ... | ${rxd}=${None} | ${txd}=${None} -| | -| | ${cpu_count_int} | Convert to Integer | ${phy_cores} -| | ${dp_count_int} | Convert to Integer | ${phy_cores} -| | ${dp_cores}= | Evaluate | ${cpu_count_int}+1 -| | FOR | ${dut} | IN | @{duts} -| | | &{compute_resource_info}= | Get Affinity Vswitch -| | | ... | ${nodes} | ${dut} | ${phy_cores} | rx_queues=${rx_queues} -| | | ... | rxd=${rxd} | txd=${txd} -| | | Set Test Variable | &{compute_resource_info} -| | | Create compute resources variables -| | | Start l3fwd -| | | ... | ${nodes} | ${nodes['${dut}']} | ${${dut}_pf1}[0] | ${${dut}_pf2}[0] -| | | ... | ${cpu_dp} | ${dp_count_int} | ${rxq_count_int} | ${jumbo_frames} -| | END diff --git a/resources/libraries/robot/features/acl.robot b/resources/libraries/robot/features/acl.robot index 1dd706c3ac..f474561a14 100644 --- a/resources/libraries/robot/features/acl.robot +++ b/resources/libraries/robot/features/acl.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2022 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: @@ -100,10 +100,10 @@ | | Add Macip Acl Multi Entries | ${dut} | rules=${acl0} | | Add Macip Acl Multi Entries | ${dut} | rules=${acl1} | | ${acl_idx}= | Set Variable | 0 -| | Run Keyword Unless | '${dut_if1}' == '${NONE}' +| | Run Keyword If | '${dut_if1}' != '${NONE}' | | ... | Add Del Macip Acl Interface | ${dut} | ${dut_if1} | add | ${acl_idx} | | ${acl_idx}= | Set Variable | 1 -| | Run Keyword Unless | '${dut_if2}' == '${NONE}' +| | Run Keyword If | '${dut_if2}' != '${NONE}' | | ... | Add Del Macip Acl Interface | ${dut} | ${dut_if2} | add | ${acl_idx} | Configure IPv4 ACLs diff --git a/resources/libraries/robot/features/dma.robot b/resources/libraries/robot/features/dma.robot new file mode 100644 index 0000000000..677f39c9df --- /dev/null +++ b/resources/libraries/robot/features/dma.robot @@ -0,0 +1,28 @@ +# 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 *** +| Documentation | DMA Keywords +| +| Library | resources.libraries.python.DMAUtil +| Resource | resources/libraries/robot/nginx/default.robot + +*** Keywords *** +| Enable DMA WQs on all DUTs +| | [Documentation] | Enable DMA WQs on all DUTs. +| | +| | FOR | ${dut} | IN | @{duts} +| | | ${dma_wqs}= | Enable DMAs And WQs On DUT +| | | ... | ${nodes['${dut}']} | ${cpu_count_int} +| | | Set Test Variable | ${${dut}_dma_wqs} | ${dma_wqs} +| | END diff --git a/resources/libraries/robot/hoststack/hoststack.robot b/resources/libraries/robot/hoststack/hoststack.robot index 9c81855af4..ece1d8a1f4 100644 --- a/resources/libraries/robot/hoststack/hoststack.robot +++ b/resources/libraries/robot/hoststack/hoststack.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# 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: @@ -17,8 +17,10 @@ | 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 @@ -29,15 +31,11 @@ | ${quic_crypto_engine}= | nocrypto | ${quic_fifo_size}= | 4M | &{vpp_hoststack_attr}= -| ... | rxq=${1} | ... | rxd=${256} | ... | txd=${256} | ... | phy_cores=${1} -| ... | vpp_api_socket=${SOCKSVR_PATH} -| ... | api_seg_global_size=2G -| ... | api_seg_api_size=1G +| ... | app_api_socket=/run/vpp/app_ns_sockets/default | ... | tcp_cc_algo=cubic -| ... | sess_evt_q_seg_size=64M | ... | sess_evt_q_length=16384 | ... | sess_prealloc_sess=1024 | ... | sess_v4_tbl_buckets=20000 @@ -51,7 +49,7 @@ | ... | cpu_cnt=${1} | ... | cfg_vpp_feature=${None} | ... | namespace=default -| ... | vpp_api_socket=${vpp_hoststack_attr}[vpp_api_socket] +| ... | app_api_socket=${vpp_hoststack_attr}[app_api_socket] | ... | json_output=json | ... | uri_protocol=quic | ... | uri_ip4_addr=${EMPTY} @@ -66,12 +64,13 @@ | ... | 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 -| ... | vpp_api_socket=${vpp_hoststack_attr}[vpp_api_socket] +| ... | app_api_socket=${vpp_hoststack_attr}[app_api_socket] | ... | json_output=json | ... | uri_protocol=quic | ... | uri_ip4_addr=${EMPTY} @@ -86,6 +85,7 @@ | ... | tx_bytes=0 | ... | rx_results_diff=${False} | ... | tx_results_diff=${False} +| ... | use_app_socket_api=${True} | &{iperf3_server_attr}= | ... | role=server | ... | cpu_cnt=${1} @@ -117,7 +117,17 @@ | ... | cpu_cnt=${1} | ... | cfg_vpp_feature=${Empty} | ... | namespace=default -| ... | vcl_config=vcl_iperf3.conf +| ... | 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} @@ -129,15 +139,11 @@ | | ... | 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 -| | ... | - ${vpp_api_socket} - Path to VPP api socket file Type: string -| | ... | - ${api_seg_global_size} - Global API segment size Type: string -| | ... | - ${api_seg_api_size} - API segment API fifo size Type: string +| | ... | - ${app_api_socket} - Path to application api socket file Type: string | | ... | - ${tcp_cc_algo} - TCP congestion control algorithm Type: string -| | ... | - ${sess_evt_q_seg_size} - Session event queue segment size | | ... | Type: string | | ... | - ${sess_evt_q_length} - Session event queue length Type: string | | ... | - ${sess_prealloc_sess} - Number of sessions to preallocate @@ -160,15 +166,11 @@ | | ... | \| 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] -| | ... | ${vpp_api_socket}=${vpp_hoststack_attr}[vpp_api_socket] -| | ... | ${api_seg_global_size}=${vpp_hoststack_attr}[api_seg_global_size] -| | ... | ${api_seg_api_size}=${vpp_hoststack_attr}[api_seg_api_size] +| | ... | ${app_api_socket}=${vpp_hoststack_attr}[app_api_socket] | | ... | ${tcp_cc_algo}=${vpp_hoststack_attr}[tcp_cc_algo] -| | ... | ${sess_evt_q_seg_size}=${vpp_hoststack_attr}[sess_evt_q_seg_size] | | ... | ${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] @@ -178,21 +180,14 @@ | | ... | ${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} -| | ... | vpp_api_socket | ${vpp_api_socket} -| | Set To Dictionary | ${vpp_hoststack_attr} -| | ... | api_seg_global_size | ${api_seg_global_size} -| | Set To Dictionary | ${vpp_hoststack_attr} -| | ... | api_seg_api_size | ${api_seg_api_size} +| | ... | 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_seg_size | ${sess_evt_q_seg_size} -| | 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} @@ -227,6 +222,7 @@ | | ... | - ${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:* | | @@ -246,6 +242,7 @@ | | ... | ${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} @@ -262,6 +259,8 @@ | | ... | ${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] @@ -281,6 +280,7 @@ | | ... | - ${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:* | | @@ -300,6 +300,7 @@ | | ... | ${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} @@ -316,6 +317,8 @@ | | ... | ${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] @@ -440,23 +443,18 @@ | | 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 +| 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] +| | ... | ${vpp_hoststack_attr}[phy_cores] +| | ... | rxd=${vpp_hoststack_attr}[rxd] | txd=${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 | ${dut}.Add socksvr | ${vpp_hoststack_attr}[vpp_api_socket] -| | | Run keyword | ${dut}.Add api segment global size -| | | ... | ${vpp_hoststack_attr}[api_seg_global_size] -| | | Run keyword | ${dut}.Add api segment api size -| | | ... | ${vpp_hoststack_attr}[api_seg_api_size] | | | Run Keyword If | | | ... | '${dut}' == 'DUT1' and ${vpp_nsim_attr}[output_nsim_enable] | | | ... | ${dut}.Add Nsim poll main thread @@ -464,9 +462,7 @@ | | | 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 event queues memfd segment -| | | Run keyword | ${dut}.Add session event queues segment size -| | | ... | ${vpp_hoststack_attr}[sess_evt_q_seg_size] +| | | 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 @@ -505,6 +501,9 @@ | | ${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} @@ -518,14 +517,19 @@ | | ... | ${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} @@ -547,6 +551,9 @@ | | ${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} @@ -560,57 +567,65 @@ | | ... | ${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 DUT node +| Set up LDP or VCL Nginx on DUT1 node | | [Documentation] -| | ... | Setup for suites which uses VCL or LDP Nginx on DUT. +| | ... | 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:* -| | ... | - dut - DUT node. -| | ... | Type: string -| | ... | - mode - VCL Nginx or LDP Nginx. -| | ... | Type: string -| | ... | - rps_cps - Test request or connect. -| | ... | Type: string -| | ... | - core_num - Nginx work processes number. -| | ... | Type: int -| | ... | - qat - Whether to use the qat engine. -| | ... | Type: string -| | ... | - tls_tcp - TLS or TCP. +| | ... | - 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 DUT node \| ${dut} |${mode}\ +| | ... | \| Set up LDP or VCL NGINX on DUT1 node \| ${mode}\ | | ... | \| ${rps_cps} \| ${phy_cores} \| ${qat} \| ${tls_tcp} \| | | -| | [Arguments] | ${dut} | ${mode} | ${rps_cps} | ${phy_cores} | ${qat} -| | ... | ${tls_tcp} +| | [Arguments] | ${mode} | ${rps_cps} | ${phy_cores} | ${qat} | ${tls_tcp} +| | | ... | ${use_dma}=${False} | | -| | Set Interface State | ${dut} | ${DUT1_${int}1}[0] | up -| | VPP Interface Set IP Address | ${dut} | ${DUT1_${int}1}[0] +| | 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 | ${dut} +| | 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 | ${dut} | ${DUT1_${int}1}[0] -| | Apply Nginx configuration on DUT | ${dut} | ${phy_cores} -| | Set To Dictionary | ${nginx_server_attr} | ip_address +| | ${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 | ${dut} | ${numa} -| | ... | skip_cnt=${skip_cnt} | cpu_cnt=${nginx_server_attr}[cpu_cnt] -| | ${cpu_idle_list}= | Get cpu idle list | ${dut} | ${numa} -| | ... | ${smt_used} | ${cpu_alloc_str} -| | ${nginx_server}= | Get Nginx Command | ${nginx_server_attr} +| | ${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} -| | ${server_pid}= | Start Hoststack Test Program -| | ... | ${dut} | ${nginx_server_attr}[namespace] | ${core_list} +| | Start Hoststack Test Program +| | ... | ${DUT1} | ${attr}[namespace] | ${core_list} | | ... | ${nginx_server} -| | Taskset Nginx PID to idle cores | ${dut} | ${cpu_idle_list} +| | 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] @@ -629,8 +644,71 @@ | | | | [Arguments] | ${ciphers} | ${files} | ${tls_tcp} | ${mode} | | -| | ${output}= | Run ab | ${tg} | ${dut_ip_addrs}[0] | ${ab_ip_addrs}[0] +| | ${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} -| | Log VPP Hoststack data | ${dut1} + +| 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 diff --git a/resources/libraries/robot/ip/ip4.robot b/resources/libraries/robot/ip/ip4.robot index ef5b27f7de..e3ebd0e289 100644 --- a/resources/libraries/robot/ip/ip4.robot +++ b/resources/libraries/robot/ip/ip4.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 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: @@ -12,9 +12,6 @@ # limitations under the License. *** Settings *** -| Library | resources.libraries.python.InterfaceUtil -| Library | resources.libraries.python.IPUtil -| | Documentation | IPv4 keywords *** Keywords *** @@ -83,80 +80,21 @@ | | ... | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | gateway=1.1.1.1 | | ... | interface=${DUT2_${int}1}[0] | | -| | Run Keyword Unless | '${remote_host1_ip}' == '${NONE}' +| | Run Keyword If | '${remote_host1_ip}' != '${NONE}' | | ... | Vpp Route Add | ${dut1} | ${remote_host1_ip} | ${remote_host_mask} | | ... | gateway=10.10.10.2 | interface=${DUT1_${int}1}[0] -| | Run Keyword Unless | '${remote_host2_ip}' == '${NONE}' +| | Run Keyword If | '${remote_host2_ip}' != '${NONE}' | | ... | Vpp Route Add | ${dut} | ${remote_host2_ip} | ${remote_host_mask} | | ... | gateway=20.20.20.2 | interface=${dut_if2} -| | Run Keyword Unless | '${remote_host1_ip}' == '${NONE}' +| | Run Keyword If | '${remote_host1_ip}' != '${NONE}' | | ... | Run Keyword If | '${dut2_status}' == 'PASS' | | ... | Vpp Route Add | ${dut1} | ${remote_host1_ip} | ${remote_host_mask} | | ... | gateway=1.1.1.2 | interface=${DUT1_${int}2}[0] -| | Run Keyword Unless | '${remote_host2_ip}' == '${NONE}' +| | Run Keyword If | '${remote_host2_ip}' != '${NONE}' | | ... | Run Keyword If | '${dut2_status}' == 'PASS' | | ... | Vpp Route Add | ${dut2} | ${remote_host2_ip} | ${remote_host_mask} | | ... | gateway=1.1.1.1 | interface=${DUT2_${int}1}[0] -| Initialize IPv4 forwarding with scaling in circular topology -| | [Documentation] -| | ... | Custom setup of IPv4 topology with scalability of ip routes on all -| | ... | DUT nodes in 2-node / 3-node circular topology -| | -| | ... | *Arguments:* -| | ... | - count - IP route count. Type: integer -| | -| | ... | *Return:* -| | ... | - No value returned -| | -| | ... | *Example:* -| | -| | ... | \| Initialize IPv4 forwarding with scaling in 3-node circular \ -| | ... | topology \| 100000 \| -| | -| | [Arguments] | ${count} -| | -| | ${dut2_status} | ${value}= | Run Keyword And Ignore Error -| | ... | Variable Should Exist | ${dut2} -| | -| | Set interfaces in path up -| | -| | VPP Add IP Neighbor -| | ... | ${dut1} | ${DUT1_${int}1}[0] | 1.1.1.1 | ${TG_pf1_mac}[0] -| | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | VPP Add IP Neighbor -| | ... | ${dut1} | ${DUT1_${int}2}[0] | 2.2.2.2 | ${DUT2_${int}1_mac}[0] -| | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | VPP Add IP Neighbor -| | ... | ${dut2} | ${DUT2_${int}1}[0] | 2.2.2.1 | ${DUT1_${int}2_mac}[0] -| | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | Set Variable | ${dut2} -| | ... | ELSE | Set Variable | ${dut1} -| | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | Set Variable | ${DUT2_${int}2}[0] -| | ... | ELSE | Set Variable | ${DUT1_${int}2}[0] -| | VPP Add IP Neighbor -| | ... | ${dut} | ${dut_if2} | 3.3.3.1 | ${TG_pf2_mac}[0] -| | VPP Interface Set IP Address -| | ... | ${dut1} | ${DUT1_${int}1}[0] | 1.1.1.2 | 30 -| | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | VPP Interface Set IP Address | ${dut1} | ${DUT1_${int}2}[0] | 2.2.2.1 -| | ... | 30 -| | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | VPP Interface Set IP Address | ${dut2} | ${DUT2_${int}1}[0] | 2.2.2.2 -| | ... | 30 -| | VPP Interface Set IP Address | ${dut} | ${dut_if2} | 3.3.3.2 | 30 -| | Vpp Route Add | ${dut1} | 10.0.0.0 | 32 | gateway=1.1.1.1 -| | ... | interface=${DUT1_${int}1}[0] | count=${count} -| | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | Vpp Route Add | ${dut1} | 20.0.0.0 | 32 | gateway=2.2.2.2 -| | ... | interface=${DUT1_${int}2}[0] | count=${count} -| | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | Vpp Route Add | ${dut2} | 10.0.0.0 | 32 | gateway=2.2.2.1 -| | ... | interface=${DUT2_${int}1}[0] | count=${count} -| | Vpp Route Add | ${dut} | 20.0.0.0 | 32 | gateway=3.3.3.1 -| | ... | interface=${dut_if2} | count=${count} - | Initialize IPv4 routing with memif pairs | | [Documentation] | | ... | Create pairs of Memif interfaces on all defined VPP nodes. Put each @@ -267,7 +205,7 @@ | | | ${memif2}= | Set Variable | ${${dut}-memif-${number}-if2} | | | ${fib_table_1}= | Evaluate | ${fib_table_1} + ${1} | | | ${fib_table_2}= | Evaluate | ${fib_table_1} + ${1} -| | | Run Keyword Unless | ${number} == ${count} +| | | Run Keyword If | ${number} != ${count} | | | ... | Add Fib Table | ${nodes['${dut}']} | ${fib_table_2} | | | Assign Interface To Fib Table | ${nodes['${dut}']} | | | ... | ${memif1} | ${fib_table_1} @@ -375,10 +313,10 @@ | | | ... | ${dut1} | ${dut1-vhost-${number}-if1} | 1.1.1.2 | 30 | | | VPP Interface Set IP Address | | | ... | ${dut1} | ${dut1-vhost-${number}-if2} | 1.1.2.2 | 30 -| | | Run Keyword Unless | ${testpmd_mac} +| | | Run Keyword If | not ${testpmd_mac} | | | ... | Vpp Route Add | ${dut1} | 20.0.0.0 | 8 | gateway=1.1.1.1 | | | ... | interface=${dut1-vhost-${number}-if1} | vrf=${fib_table_1} -| | | Run Keyword Unless | ${testpmd_mac} +| | | Run Keyword If | not ${testpmd_mac} | | | ... | Vpp Route Add | ${dut1} | 10.0.0.0 | 8 | gateway=1.1.2.1 | | | ... | interface=${dut1-vhost-${number}-if2} | vrf=${fib_table_2} | | | Run Keyword If | ${testpmd_mac} @@ -494,16 +432,16 @@ | | | ... | ${dut2} | ${dut2-vhost-${number}-if1} | 1.1.1.2 | 30 | | | VPP Interface Set IP Address | | | ... | ${dut2} | ${dut2-vhost-${number}-if2} | 1.1.2.2 | 30 -| | | Run Keyword Unless | ${testpmd_mac} +| | | Run Keyword If | not ${testpmd_mac} | | | ... | Vpp Route Add | ${dut1} | 20.0.0.0 | 8 | gateway=1.1.1.1 | | | ... | interface=${dut1-vhost-${number}-if1} | vrf=${fib_table_1} -| | | Run Keyword Unless | ${testpmd_mac} +| | | Run Keyword If | not ${testpmd_mac} | | | ... | Vpp Route Add | ${dut1} | 10.0.0.0 | 8 | gateway=1.1.2.1 | | | ... | interface=${dut1-vhost-${number}-if2} | vrf=${fib_table_2} -| | | Run Keyword Unless | ${testpmd_mac} +| | | Run Keyword If | not ${testpmd_mac} | | | ... | Vpp Route Add | ${dut2} | 20.0.0.0 | 8 | gateway=1.1.1.1 | | | ... | interface=${dut2-vhost-${number}-if1} | vrf=${fib_table_1} -| | | Run Keyword Unless | ${testpmd_mac} +| | | Run Keyword If | not ${testpmd_mac} | | | ... | Vpp Route Add | ${dut2} | 10.0.0.0 | 8 | gateway=1.1.2.1 | | | ... | interface=${dut2-vhost-${number}-if2} | vrf=${fib_table_2} | | | Run Keyword If | ${testpmd_mac} diff --git a/resources/libraries/robot/ip/ip6.robot b/resources/libraries/robot/ip/ip6.robot index edb264190c..506e5d844a 100644 --- a/resources/libraries/robot/ip/ip6.robot +++ b/resources/libraries/robot/ip/ip6.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2022 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: @@ -84,17 +84,17 @@ | | ... | Vpp Route Add | ${dut2} | 2001:1::0 | 64 | gateway=2001:3::1 | | ... | interface=${DUT2_${int}1}[0] | | -| | Run Keyword Unless | '${remote_host1_ip}' == '${NONE}' +| | Run Keyword If | '${remote_host1_ip}' != '${NONE}' | | ... | Vpp Route Add | ${dut1} | ${remote_host1_ip} | 128 | | ... | gateway=2001:1::2 | interface=${DUT1_${int}1}[0] -| | Run Keyword Unless | '${remote_host2_ip}' == '${NONE}' +| | Run Keyword If | '${remote_host2_ip}' != '${NONE}' | | ... | Vpp Route Add | ${dut} | ${remote_host2_ip} | 128 | | ... | gateway=2001:2::2 | interface=${dut_if2} -| | Run Keyword Unless | '${remote_host1_ip}' == '${NONE}' +| | Run Keyword If | '${remote_host1_ip}' != '${NONE}' | | ... | Run Keyword If | '${dut2_status}' == 'PASS' | | ... | Vpp Route Add | ${dut1} | ${remote_host1_ip} | 128 | | ... | gateway=2001:3::2 | interface=${DUT1_${int}2}[0] -| | Run Keyword Unless | '${remote_host2_ip}' == '${NONE}' +| | Run Keyword If | '${remote_host2_ip}' != '${NONE}' | | ... | Run Keyword If | '${dut2_status}' == 'PASS' | | ... | Vpp Route Add | ${dut2} | ${remote_host2_ip} | 128 | | ... | gateway=2001:3::1 | interface=${DUT2_${int}1}[0] diff --git a/resources/libraries/robot/ip/nat.robot b/resources/libraries/robot/ip/nat.robot index c33c875389..c04aef0f69 100644 --- a/resources/libraries/robot/ip/nat.robot +++ b/resources/libraries/robot/ip/nat.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2022 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: @@ -52,7 +52,8 @@ | | | | ${max_sessions}= | Compute Max Translations Per Thread | | ... | ${n_sessions} | ${dp_count_int} -| | Enable NAT44 Plugin | ${dut1} | mode=${nat_mode} | sessions=${max_sessions} +| | Enable NAT44 ED Plugin | ${dut1} | mode=${nat_mode} +| | ... | sessions=${max_sessions} | | Configure inside and outside interfaces | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${DUT1_${int}2}[0] | | ${resetter} = | Set NAT44 Address Range diff --git a/resources/libraries/robot/l2/l2_bridge_domain.robot b/resources/libraries/robot/l2/l2_bridge_domain.robot index f54d1685c4..00044e1253 100644 --- a/resources/libraries/robot/l2/l2_bridge_domain.robot +++ b/resources/libraries/robot/l2/l2_bridge_domain.robot @@ -1,5 +1,5 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# Copyright (c) 2021 PANTHEON.tech and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. +# Copyright (c) 2023 PANTHEON.tech 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: @@ -491,18 +491,14 @@ | | Set interfaces in path up | | ${dut1_eth_bond_if1}= | VPP Create Bond Interface | | ... | ${dut1} | ${bond_mode} | ${lb_mode} -| | Set Interface State | ${dut1} | ${dut1_eth_bond_if1} | up -| | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1} | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1 | | | ${_even}= | Evaluate | ${pf} % 2 -| | | Run Keyword Unless | ${even} +| | | Run Keyword If | not ${even} | | | ... | VPP Add Bond Member | | | ... | ${dut1} | ${DUT1_${int}${pf}}[0] | ${dut1_eth_bond_if1} | | END | | ${dut2_eth_bond_if1}= | VPP Create Bond Interface | | ... | ${dut2} | ${bond_mode} | ${lb_mode} -| | Set Interface State | ${dut2} | ${dut2_eth_bond_if1} | up -| | VPP Set interface MTU | ${dut2} | ${dut2_eth_bond_if1} | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1 | | | ${_even}= | Evaluate | ${pf} % 2 | | | Run Keyword If | ${even} diff --git a/resources/libraries/robot/l2/l2_xconnect.robot b/resources/libraries/robot/l2/l2_xconnect.robot index 59199b6c90..b782602827 100644 --- a/resources/libraries/robot/l2/l2_xconnect.robot +++ b/resources/libraries/robot/l2/l2_xconnect.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 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: @@ -243,18 +243,14 @@ | | Set interfaces in path up | | ${dut1_eth_bond_if1}= | VPP Create Bond Interface | | ... | ${dut1} | ${bond_mode} | ${lb_mode} -| | Set Interface State | ${dut1} | ${dut1_eth_bond_if1} | up -| | VPP Set interface MTU | ${dut1} | ${dut1_eth_bond_if1} | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1 | | | ${_even}= | Evaluate | ${pf} % 2 -| | | Run Keyword Unless | ${even} +| | | Run Keyword If | not ${even} | | | ... | VPP Add Bond Member | | | ... | ${dut1} | ${DUT1_${int}${pf}}[0] | ${dut1_eth_bond_if1} | | END | | ${dut2_eth_bond_if1}= | VPP Create Bond Interface | | ... | ${dut2} | ${bond_mode} | ${lb_mode} -| | Set Interface State | ${dut2} | ${dut2_eth_bond_if1} | up -| | VPP Set interface MTU | ${dut2} | ${dut2_eth_bond_if1} | | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1 | | | ${_even}= | Evaluate | ${pf} % 2 | | | Run Keyword If | ${even} diff --git a/resources/libraries/robot/l2/tagging.robot b/resources/libraries/robot/l2/tagging.robot index dd4642c505..843b25d958 100644 --- a/resources/libraries/robot/l2/tagging.robot +++ b/resources/libraries/robot/l2/tagging.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2022 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: @@ -82,24 +82,24 @@ | | ... | \| ${dut1_if2} \| 10 \| | | | | Set Interface State | ${DUT1} | ${INT1} | up -| | Run Keyword Unless | ${DUT2} == ${None} +| | Run Keyword If | ${DUT2} != ${None} | | ... | Set Interface State | ${DUT2} | ${INT2} | up | | ${INT1_NAME}= | Get interface name | ${DUT1} | ${INT1} -| | ${INT2_NAME}= | Run Keyword Unless | ${DUT2} == ${None} +| | ${INT2_NAME}= | Run Keyword If | ${DUT2} != ${None} | | ... | Get interface name | ${DUT2} | ${INT2} | | ${subif_name_1} | ${subif_index_1}= | Create Vlan Subinterface | | ... | ${DUT1} | ${INT1_NAME} | ${SUB_ID} | | ${subif_name_2} | ${subif_index_2}= -| | ... | Run Keyword Unless | ${DUT2} == ${None} +| | ... | Run Keyword If | ${DUT2} != ${None} | | ... | Create Vlan Subinterface | ${DUT2} | ${INT2_NAME} | ${SUB_ID} | | Set Interface State | ${DUT1} | ${subif_index_1} | up -| | Run Keyword Unless | ${DUT2} == ${None} +| | Run Keyword If | ${DUT2} != ${None} | | ... | Set Interface State | ${DUT2} | ${subif_index_2} | up | | Set Test Variable | ${subif_name_1} | | Set Test Variable | ${subif_index_1} -| | Run Keyword Unless | ${DUT2} == ${None} +| | Run Keyword If | ${DUT2} != ${None} | | ... | Set Test Variable | ${subif_name_2} -| | Run Keyword Unless | ${DUT2} == ${None} +| | Run Keyword If | ${DUT2} != ${None} | | ... | Set Test Variable | ${subif_index_2} | Configure L2 tag rewrite method on interfaces @@ -115,7 +115,7 @@ | | ... | - TAG_REWRITE_METHOD - Method of tag rewrite. | | | | L2 Vlan tag rewrite | ${DUT1} | ${SUB_INT1} | ${TAG_REWRITE_METHOD} -| | Run Keyword Unless | ${DUT2} == ${None} +| | Run Keyword If | ${DUT2} != ${None} | | ... | L2 Vlan tag rewrite | ${DUT2} | ${SUB_INT2} | ${TAG_REWRITE_METHOD} | Configure L2 tag rewrite method on interface diff --git a/resources/libraries/robot/overlay/gtpu.robot b/resources/libraries/robot/overlay/gtpu.robot index 3135be73fd..be82ca0fd5 100644 --- a/resources/libraries/robot/overlay/gtpu.robot +++ b/resources/libraries/robot/overlay/gtpu.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Intel and/or its affiliates. +# Copyright (c) 2022 Intel 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: @@ -23,7 +23,13 @@ | | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular | | ... | topology. Create GTPU tunnel on both DUT nodes, setup IPv4 adresses | | ... | with /30 prefix on DUT1-DUT2 link, and set routing on both DUT nodes -| | ... | with prefix /24 and next hop of neighbour DUT interface. +| | ... | with prefix /24 and next hop of neighbour DUT interface. Gtpu offload +| | ... | rx will be enabled on both DUT nodes if offload is set to true. +| | +| | ... | *Arguments:* +| | ... | - offload - False or True. Type: bool +| | +| | [Arguments] | ${offload}=${False} | | | | VPP Interface Set IP Address | ${dut1} | ${DUT1_${int}1}[0] | | ... | 10.10.10.1 | 24 @@ -60,3 +66,10 @@ | | ... | interface=${dut1_tunnel_if_index} | | Vpp Route Add | ${dut2} | 10.10.10.0 | 24 | gateway=1.1.1.1 | | ... | interface=${dut2_tunnel_if_index} +| | +| | Run keyword if | ${offload} == ${True} +| | ... | Vpp Enable GTPU Offload rx +| | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut1_tunnel_if_index} +| | Run keyword if | ${offload} == ${True} +| | ... | Vpp Enable GTPU Offload rx +| | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut2_tunnel_if_index} diff --git a/resources/libraries/robot/overlay/lisp.robot b/resources/libraries/robot/overlay/lisp.robot index c759aafda4..820a232338 100644 --- a/resources/libraries/robot/overlay/lisp.robot +++ b/resources/libraries/robot/overlay/lisp.robot @@ -339,13 +339,13 @@ | | VPP Add IP Neighbor | | ... | ${dut1} | ${DUT1_${int}1}[0] | 2001:1::2 | ${TG_pf1_mac}[0] | | VPP Add IP Neighbor -| | ... | ${dut2} | ${DUT2_${int}1}[0] | 2001:2::2 | ${TG_pf2_mac}[0] -| | VPP Add IP Neighbor | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut2_dut1_address} | | ... | ${DUT2_${int}1_mac}[0] | | VPP Add IP Neighbor | | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut1_dut2_address} | | ... | ${DUT1_${int}2_mac}[0] +| | VPP Add IP Neighbor +| | ... | ${dut2} | ${DUT2_${int}2}[0] | 2001:2::2 | ${TG_pf2_mac}[0] | Initialize LISP IPv4 over IPv6 forwarding in 3-node circular topology | | [Documentation] | Custom setup of IPv4 over IPv6 topology on all DUT nodes \ diff --git a/resources/libraries/robot/overlay/srv6.robot b/resources/libraries/robot/overlay/srv6.robot index 9462a71189..83ec8949a4 100644 --- a/resources/libraries/robot/overlay/srv6.robot +++ b/resources/libraries/robot/overlay/srv6.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 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: @@ -263,7 +263,7 @@ | | ... | VPP Add IP Neighbor | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut2_if1_ip6} | | ... | ${DUT2_${int}1_mac}[0] -| | Run Keyword Unless | ${dut2_status} +| | Run Keyword If | not ${dut2_status} | | ... | VPP Add IP Neighbor | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut2_if1_ip6} | ${TG_pf2_mac}[0] | | Run Keyword If | ${dut2_status} @@ -367,16 +367,10 @@ | | Set up memif interfaces on DUT node | ${dut1} | ${sock1} | ${sock1} | | ... | ${1} | dut1-memif-1-if1 | dut1-memif-1-if2 | ${rxq_count_int} | | ... | ${rxq_count_int} -| | VPP Set interface MTU | ${dut1} | ${dut1-memif-1-if1} -| | VPP Set interface MTU | ${dut1} | ${dut1-memif-1-if2} | | Run Keyword If | ${dut2_status} | | ... | Set up memif interfaces on DUT node | ${dut2} | ${sock2} | ${sock2} | | ... | ${1} | dut2-memif-1-if1 | dut2-memif-1-if2 | ${rxq_count_int} | | ... | ${rxq_count_int} -| | Run Keyword If | ${dut2_status} -| | ... | VPP Set interface MTU | ${dut2} | ${dut2-memif-1-if1} -| | Run Keyword If | ${dut2_status} -| | ... | VPP Set interface MTU | ${dut2} | ${dut2-memif-1-if2} | | FOR | ${dut} | IN | @{duts} | | | Show Memif | ${nodes['${dut}']} | | END @@ -405,7 +399,7 @@ | | ... | VPP Add IP Neighbor | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut2_if1_ip6} | | ... | ${DUT2_${int}1_mac}[0] -| | Run Keyword Unless | ${dut2_status} +| | Run Keyword If | not ${dut2_status} | | ... | VPP Add IP Neighbor | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut2_if1_ip6} | ${TG_pf2_mac}[0] | | Run Keyword If | ${dut2_status} diff --git a/resources/libraries/robot/performance/performance_actions.robot b/resources/libraries/robot/performance/performance_actions.robot index bb6881ef7b..1d2ea52274 100644 --- a/resources/libraries/robot/performance/performance_actions.robot +++ b/resources/libraries/robot/performance/performance_actions.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 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: @@ -26,6 +26,41 @@ | | Run Keyword If | ${extended_debug}==${True} | | ... | Perf Stat On All DUTs | ${nodes} | cpu_list=${cpu_alloc_str} +| Additional Statistics Action For trex-runtime +| | [Documentation] +| | ... | Additional Statistics Action for T-Rex telemetry counters with +| | ... | running traffic. +| | +| | ... | See documentation of the called keyword for required test variables. +| | +| | ${ppta} = | Get Packets Per Transaction Aggregated +| | ${ramp_up_duration} = | Get Ramp Up Duration +| | ${ramp_up_rate} = | Get Ramp Up Rate +| | ${runtime_duration} = | Get Runtime Duration +| | ${runtime_rate} = | Get Runtime Rate +| | ${traffic_directions} = | Get Traffic Directions +| | ${transaction_duration} = | Get Transaction Duration +| | ${transaction_scale} = | Get Transaction Scale +| | ${transaction_type} = | Get Transaction Type +| | ${use_latency} = | Get Use Latency +| | Send traffic on tg +| | ... | duration=${-1} +| | ... | rate=${runtime_rate} +| | ... | frame_size=${frame_size} +| | ... | traffic_profile=${traffic_profile} +| | ... | async_call=${True} +| | ... | ppta=${ppta} +| | ... | use_latency=${use_latency} +| | ... | traffic_directions=${traffic_directions} +| | ... | transaction_duration=${transaction_duration} +| | ... | transaction_scale=${transaction_scale} +| | ... | transaction_type=${transaction_type} +| | ... | duration_limit=${0.0} +| | ... | ramp_up_duration=${ramp_up_duration} +| | ... | ramp_up_rate=${ramp_up_rate} +| | Sleep | 1s +| | Stop traffic on tg + | Additional Statistics Action For vpp-runtime | | [Documentation] | | ... | Additional Statistics Action for clear and show runtime counters with @@ -59,7 +94,82 @@ | | ... | ramp_up_duration=${ramp_up_duration} | | ... | ramp_up_rate=${ramp_up_rate} | | Run Telemetry On All DUTs -| | ... | ${nodes} | profile=vpp_runtime.yaml +| | ... | ${nodes} | profile=vppctl_runtime.yaml +| | ... | rate=${telemetry_rate} | export=${telemetry_export} +| | Stop traffic on tg + +| Additional Statistics Action For bpf-runtime +| | [Documentation] +| | ... | Additional Statistics Action for linux bundle counters with +| | ... | running traffic. +| | +| | ... | See documentation of the called keyword for required test variables. +| | +| | ${ppta} = | Get Packets Per Transaction Aggregated +| | ${ramp_up_duration} = | Get Ramp Up Duration +| | ${ramp_up_rate} = | Get Ramp Up Rate +| | ${runtime_duration} = | Get Runtime Duration +| | ${runtime_rate} = | Get Runtime Rate +| | ${traffic_directions} = | Get Traffic Directions +| | ${transaction_duration} = | Get Transaction Duration +| | ${transaction_scale} = | Get Transaction Scale +| | ${transaction_type} = | Get Transaction Type +| | ${use_latency} = | Get Use Latency +| | Send traffic on tg +| | ... | duration=${-1} +| | ... | rate=${runtime_rate} +| | ... | frame_size=${frame_size} +| | ... | traffic_profile=${traffic_profile} +| | ... | async_call=${True} +| | ... | ppta=${ppta} +| | ... | use_latency=${use_latency} +| | ... | traffic_directions=${traffic_directions} +| | ... | transaction_duration=${transaction_duration} +| | ... | transaction_scale=${transaction_scale} +| | ... | transaction_type=${transaction_type} +| | ... | duration_limit=${0.0} +| | ... | ramp_up_duration=${ramp_up_duration} +| | ... | ramp_up_rate=${ramp_up_rate} +| | Run Telemetry On All DUTs +| | ... | ${nodes} | profile=bpf_runtime.yaml +| | ... | rate=${telemetry_rate} | export=${False} +| | Stop traffic on tg + +| Additional Statistics Action For perf-stat-runtime +| | [Documentation] +| | ... | Additional Statistics Action for linux bundle counters with +| | ... | running traffic. +| | +| | ... | See documentation of the called keyword for required test variables. +| | +| | ${ppta} = | Get Packets Per Transaction Aggregated +| | ${ramp_up_duration} = | Get Ramp Up Duration +| | ${ramp_up_rate} = | Get Ramp Up Rate +| | ${runtime_duration} = | Get Runtime Duration +| | ${runtime_rate} = | Get Runtime Rate +| | ${traffic_directions} = | Get Traffic Directions +| | ${transaction_duration} = | Get Transaction Duration +| | ${transaction_scale} = | Get Transaction Scale +| | ${transaction_type} = | Get Transaction Type +| | ${use_latency} = | Get Use Latency +| | Send traffic on tg +| | ... | duration=${-1} +| | ... | rate=${runtime_rate} +| | ... | frame_size=${frame_size} +| | ... | traffic_profile=${traffic_profile} +| | ... | async_call=${True} +| | ... | ppta=${ppta} +| | ... | use_latency=${use_latency} +| | ... | traffic_directions=${traffic_directions} +| | ... | transaction_duration=${transaction_duration} +| | ... | transaction_scale=${transaction_scale} +| | ... | transaction_type=${transaction_type} +| | ... | duration_limit=${0.0} +| | ... | ramp_up_duration=${ramp_up_duration} +| | ... | ramp_up_rate=${ramp_up_rate} +| | Run Telemetry On All DUTs +| | ... | ${nodes} | profile=perf_stat_runtime.yaml +| | ... | rate=${telemetry_rate} | export=${False} | | Stop traffic on tg | Additional Statistics Action For vpp-runtime-iperf3 @@ -84,7 +194,8 @@ | | | ... | bind=${iperf_client_bind} | | | ... | affinity=${iperf_client_affinity} | | Run Telemetry On All DUTs -| | ... | ${nodes} | profile=vpp_runtime.yaml +| | ... | ${nodes} | profile=vppctl_runtime.yaml +| | ... | rate=${telemetry_rate} | export=${telemetry_export} | | iPerf Client Stop Remote Exec | ${nodes['${iperf_client_node}']} | ${pids} | Additional Statistics Action For noop @@ -98,7 +209,8 @@ | | ... | Additional Statistics Action for clear VPP statistics. | | | | Run Telemetry On All DUTs -| | ... | ${nodes} | profile=vpp_clear_stats.yaml +| | ... | ${nodes} | profile=vppctl_clear_stats.yaml +| | ... | export=${False} | Additional Statistics Action For vpp-enable-packettrace | | [Documentation] @@ -119,4 +231,5 @@ | | ... | Additional Statistics Action for show VPP statistics. | | | | Run Telemetry On All DUTs -| | ... | ${nodes} | profile=vpp_show_stats.yaml +| | ... | ${nodes} | profile=vppctl_show_stats.yaml +| | ... | export=${False} diff --git a/resources/libraries/robot/performance/performance_display.robot b/resources/libraries/robot/performance/performance_display.robot index de515412a5..6ee493a17e 100644 --- a/resources/libraries/robot/performance/performance_display.robot +++ b/resources/libraries/robot/performance/performance_display.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 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: @@ -17,34 +17,30 @@ | ... | This includes checks to fail test. *** Keywords *** -| Check NDRPDR interval validity +| Compute Bandwidth | | [Documentation] -| | ... | Extract loss ratio of lower bound of the interval. -| | ... | Fail if it does not reach the allowed value. -| | +| | ... | Compute (bidir) bandwidth from given (unidir) transaction rate. +| | ... +| | ... | This keyword reads \${ppta} and \${avg_aggregated_frame_size} set +| | ... | elsewhere. The implementation should work for both pps and cps rates. +| | ... | | | ... | *Arguments:* -| | ... | - interval - Measured interval. Type: ReceiveRateInterval -| | ... | - packet_loss_ratio - Accepted loss (0.0 for NDR). Type: float +| | ... | - tps - Transaction rate (unidirectional) [tps]. Type: float +| | ... +| | ... | *Returns:* +| | ... | - Computed bandwidth in Gbps. +| | ... | - Computed aggregated packet rate in pps. | | | | ... | *Example:* | | -| | ... | \| Check NDRPDR interval validity \| \${result.pdr_interval} \ -| | ... | \| \${0.005} \| -| | -| | [Arguments] | ${interval} | ${packet_loss_ratio}=${0.0} -| | -| | ${lower_bound} = | Set Variable | ${interval.measured_low} -| | ${lower_bound_lr} = | Set Variable | ${lower_bound.loss_ratio} -| | Return From Keyword If | ${lower_bound_lr} <= ${packet_loss_ratio} -| | Set Test Variable | \${rate_for_teardown} | ${lower_bound.target_tr} -| | ${message}= | Catenate | SEPARATOR=${SPACE} -| | ... | Minimal rate loss ratio ${lower_bound_lr} -| | ... | does not reach target ${packet_loss_ratio}. -| | ${message_zero} = | Set Variable | Zero packets forwarded! -| | ${message_other} = | Set Variable | ${lower_bound.loss_count} packets lost. -| | ${message} = | Set Variable If | ${lower_bound_lr} >= 1.0 -| | ... | ${message}${\n}${message_zero} | ${message}${\n}${message_other} -| | Fail | ${message} +| | ... | |\ \${bandwidth} \| \${pps} = \| Compute Bandwidth \| \${12345.67} \| +| | +| | [Arguments] | ${tps} +| | +| | ${ppta} = | Get Packets Per Transaction Aggregated +| | ${pps} = | Evaluate | ${tps} * ${ppta} +| | ${bandwidth} = | Evaluate | ${pps} * (${avg_aggregated_frame_size}+20)*8/1e9 +| | Return From Keyword | ${bandwidth} | ${pps} | Display Reconfig Test Message | | [Documentation] @@ -52,8 +48,8 @@ | | ... | due to reconfiguration under traffic. | | | | ... | *Arguments:* -| | ... | - result - Result of bidirectional measurement. -| | ... | Type: ReceiveRateMeasurement +| | ... | - result - Result of MLRsearch invocation for one search goal. +| | ... | Type: StatInterval | | | | ... | *Example:* | | @@ -61,23 +57,20 @@ | | | | [Arguments] | ${result} | | -| | ${ppta} = | Get Packets Per Transaction Aggregated -| | ${packet_rate} = | Evaluate | ${result.target_tr} * ${ppta} +| | ${bandwidth} | ${packet_rate}= | Compute Bandwidth | ${result.intended_load} | | ${packet_loss} = | Set Variable | ${result.loss_count} | | ${time_loss} = | Evaluate | ${packet_loss} / ${packet_rate} | | Set Test Message | Packets lost due to reconfig: ${packet_loss} | | Set Test Message | ${\n}Implied time lost: ${time_loss} | append=yes +| | Export Reconf Result | ${packet_rate} | ${packet_loss} | ${bandwidth * 1e9} | Display result of NDRPDR search | | [Documentation] -| | ... | Display result of NDR+PDR search, both quantities, both bounds, -| | ... | aggregate in units given by trasaction type, e.g. by default -| | ... | in packet per seconds and Gbps total bandwidth +| | ... | Display result of NDR+PDR search, both quantities, aggregated, +| | ... | conditional throughput only, in units given by trasaction type, +| | ... | e.g. by default in packet per seconds and Gbps total bandwidth | | ... | (for initial packet size). -| | ... | -| | ... | The bound to display is encoded as target rate, it is assumed -| | ... | it is in transactions per second. Bidirectional traffic -| | ... | transaction is understood as having 2 packets, for this purpose. +| | ... | The lower bounds in the result are assumed to be valid. | | ... | | | ... | Througput is calculated as: | | ... | Sum of measured rate over streams @@ -90,8 +83,8 @@ | | ... | - transaction_type - String identifier to determine how to count | | ... | transactions. Default is "packet". | | ... | *Arguments:* -| | ... | - result - Measured result data. Aggregate rate, tps or pps. -| | ... | Type: NdrPdrResult +| | ... | - result - Measured result data Tps. Type: List[TrimmedStat] +| | ... | *Returns:* NDR and PDR: Unidirectional intended load as tps float. | | | | ... | *Example:* | | @@ -99,21 +92,18 @@ | | | | [Arguments] | ${result} | | -| | Display single bound | NDR_LOWER -| | ... | ${result[0].measured_low.target_tr} -| | ... | ${result[0].measured_low.latency} -| | Display single bound | NDR_UPPER -| | ... | ${result[0].measured_high.target_tr} -| | Display single bound | PDR_LOWER -| | ... | ${result[1].measured_low.target_tr} -| | ... | ${result[1].measured_low.latency} -| | Display single bound | PDR_UPPER -| | ... | ${result[1].measured_high.target_tr} +| | ${ndr} = | Convert To Number | ${result[0].relevant_lower_bound} +| | ${pdr} = | Convert To Number | ${result[1].relevant_lower_bound} +| | Display single bound | NDR | ${result[0].conditional_throughput} +| | Display single bound | PDR | ${result[1].conditional_throughput} +| | Return From Keyword | ${ndr} | ${pdr} | Display result of soak search | | [Documentation] | | ... | Display result of soak search, avg+-stdev, as upper/lower bounds. | | ... | See Display single bound for units used. +| | ... | The displayed values are bidirectional, based on conditional +| | ... | throughput. The returned | | | | ... | *Test (or broader scope) variables read:* | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or @@ -123,7 +113,6 @@ | | ... | *Arguments:* | | ... | - avg - Estimated average critical load [pps]. Type: float | | ... | - stdev - Standard deviation of critical load [pps]. Type: float -| | | | ... | *Returns:* | | ... | - Lower and upper bound of critical load [pps]. Type: 2-tuple of float | | @@ -144,14 +133,14 @@ | Display single bound | | [Documentation] | | ... | Compute and display one bound of NDR+PDR (or soak) search result. -| | ... | If the latency string is present, it is displayed as well. | | ... | | | ... | The bound to display is given as target transfer rate, it is assumed -| | ... | it is in transactions per second. Bidirectional traffic +| | ... | valid and in transactions per second. Bidirectional traffic | | ... | transaction is understood as having 2 packets, for this purpose. | | ... | -| | ... | Pps values are aggregate in packet per seconds, +| | ... | Pps values are aggregated, in packet per seconds | | ... | and Gbps total bandwidth (for initial packet size). +| | ... | If the latency string is present, it is displayed as well. | | ... | | | ... | Througput is calculated as: | | ... | Sum of measured rate over streams @@ -164,22 +153,24 @@ | | ... | transactions. Default is "packet". | | ... | *Arguments:* | | ... | - text - Flavor text describing which bound is this. Type: string -| | ... | - tps - Transaction rate [tps]. Type: float +| | ... | - tps - Conditional throughput [tps]. Type: Union[float, DiscreteLoad] | | ... | - latency - Latency data to display if non-empty. Type: string | | | | ... | *Example:* | | -| | ... | \| Display single bound \| NDR lower bound \| \${12345.67} \ +| | ... | \| Display single bound \| NDR \| \${12345.67} \ | | ... | \| latency=\${EMPTY} \| | | | | [Arguments] | ${text} | ${tps} | ${latency}=${EMPTY} | | +| | ${tps} = | Convert To Number | ${tps} | | ${transaction_type} = | Get Transaction Type | | Run Keyword And Return If | """_cps""" in """${transaction_type}""" -| | ... | Display single cps bound | ${text} | ${tps} | ${latency} -| | Display single pps bound | ${text} | ${tps} | ${latency} +| | ... | Display Single CPS Bound | ${text} | ${tps} | ${latency} +| | Run Keyword And Return +| | ... | Display Single PPS Bound | ${text} | ${tps} | ${latency} -| Display single cps bound +| Display Single CPS Bound | | [Documentation] | | ... | Display one bound of NDR+PDR search for CPS tests. | | ... | The bounds are expressed as transactions per second. @@ -192,20 +183,21 @@ | | | | ... | *Example:* | | -| | ... | \| Display single cps bound \| NDR lower bound \| \${12345.67} \ +| | ... | \| Display Single CPS Bound \| NDR lower bound \| \${12345.67} \ | | ... | \| latency=\${EMPTY} \| | | | | [Arguments] | ${text} | ${tps} | ${latency}=${EMPTY} | | | | Set Test Message | ${\n}${text}: ${tps} CPS | append=yes -| | Return From Keyword If | not """${latency}""" -| | Set Test Message | ${\n}LATENCY [min/avg/max/hdrh] per stream: ${latency} -| | ... | append=yes +| | ${bandwidth} | ${pps} = | Compute Bandwidth | ${tps} +| | Export Search Bound | ${text} | ${tps} | cps | ${bandwidth * 1e9} +| | Run Keyword If | """${latency}""" | Set Test Message +| | ... | ${\n}LATENCY [min/avg/max/hdrh] per stream: ${latency} | append=yes -| Display single pps bound +| Display Single PPS Bound | | [Documentation] -| | ... | Display one pps bound of NDR+PDR search, -| | ... | aggregate in packet per seconds and Gbps total bandwidth +| | ... | Display one pps bound of NDR+PDR search, aggregated, +| | ... | in packet per seconds and Gbps total bandwidth | | ... | (for initial packet size). | | ... | | | ... | The bound to display is given as target transfer rate, it is assumed @@ -225,16 +217,14 @@ | | | | ... | *Example:* | | -| | ... | \| Display single pps bound \| NDR lower bound \| \${12345.67} \ +| | ... | \| Display Single PPS Bound \| NDR lower bound \| \${12345.67} \ | | ... | \| latency=\${EMPTY} \| | | | | [Arguments] | ${text} | ${tps} | ${latency}=${EMPTY} | | -| | ${ppta} = | Get Packets Per Transaction Aggregated -| | ${pps} = | Evaluate | ${tps} * ${ppta} -| | ${bandwidth} = | Evaluate | ${pps} * (${avg_frame_size}+20)*8 / 1e9 +| | ${bandwidth} | ${pps} = | Compute Bandwidth | ${tps} | | Set Test Message | ${\n}${text}: ${pps} pps, | append=yes | | Set Test Message | ${bandwidth} Gbps (initial) | append=yes -| | Return From Keyword If | not """${latency}""" -| | Set Test Message | ${\n}LATENCY [min/avg/max/hdrh] per stream: ${latency} -| | ... | append=yes +| | Export Search Bound | ${text} | ${pps} | pps | ${bandwidth * 1e9} +| | Run Keyword If | """${latency}""" | Set Test Message +| | ... | ${\n}LATENCY [min/avg/max/hdrh] per stream: ${latency} | append=yes diff --git a/resources/libraries/robot/performance/performance_utils.robot b/resources/libraries/robot/performance/performance_utils.robot index 8de74c5707..4211486a19 100644 --- a/resources/libraries/robot/performance/performance_utils.robot +++ b/resources/libraries/robot/performance/performance_utils.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 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: @@ -13,6 +13,7 @@ *** Settings *** | Library | Collections +| Library | resources.libraries.python.model.ExportResult | Library | resources.libraries.python.topology.Topology | Library | resources.libraries.python.NodePath | Library | resources.libraries.python.InterfaceUtil @@ -45,7 +46,7 @@ | | ... | Display results as formatted test message. | | ... | Fail if computed lower bound is 110% of the minimal rate or less. | | ... | Input rates are unidirectional, in transaction per second. -| | ... | Reported result may contain aggregate pps rates, depending on test. +| | ... | Reported result may contain aggregated pps rates, depending on test. | | ... | Call \${resetter} (if defined) to reset DUT state before each trial. | | | | ... | *Test (or broader scope) variables read:* @@ -72,11 +73,28 @@ | | ${transaction_scale} = | Get Transaction Scale | | ${transaction_type} = | Get Transaction Type | | ${use_latency} = | Get Use Latency +| | # TRex needs a warmup to avoid unsent packets at half-max rate. +| | Send traffic on tg +| | ... | duration=1.0 +| | ... | rate=${max_rate} +| | ... | frame_size=${frame_size} +| | ... | traffic_profile=${traffic_profile} +| | ... | async_call=${False} +| | ... | duration_limit=${1.0} +| | ... | ppta=${ppta} +| | ... | traffic_directions=${traffic_directions} +| | ... | transaction_duration=${transaction_duration} +| | ... | transaction_scale=${transaction_scale} +| | ... | transaction_type=${transaction_type} +| | ... | use_latency=False +| | ... | ramp_up_duration=${0.0} +| | ... | ramp_up_rate=${0.0} +| | # Ready for main search. | | ${average} | ${stdev} = | Perform soak search | | ... | frame_size=${frame_size} | | ... | traffic_profile=${traffic_profile} -| | ... | minimum_transmit_rate=${min_rate_soft} -| | ... | maximum_transmit_rate=${max_rate} +| | ... | min_load=${min_rate_soft} +| | ... | max_load=${max_rate} | | ... | plr_target=${1e-7} | | ... | tdpt=${0.1} | | ... | initial_count=${50} @@ -94,6 +112,15 @@ | | ${lower} | ${upper} = | Display result of soak search | | ... | ${average} | ${stdev} | | Set Test Variable | \${rate for teardown} | ${lower} +| | # Stats at the discovered critical rate. +| | Set Test Variable | ${telemetry_rate} | plr +| | Set Test Variable | ${telemetry_export} | ${True} +| | Send traffic at specified rate +| | ... | rate=${lower} +| | ... | trial_duration=${1.0} +| | ... | trial_multiplicity=${1} +| | ... | use_latency=${use_latency} +| | ... | duration_limit=${1.0} | | Should Not Be True | 1.1 * ${min_rate_soft} > ${lower} | | ... | Lower bound ${lower} too small for unidir minimum ${min_rate_soft}. @@ -104,7 +131,7 @@ | | ... | Display findings as a formatted test message. | | ... | Fail if a resulting lower bound has too high loss ratio. | | ... | Input rates are unidirectional, in transaction per second. -| | ... | Reported result may contain aggregate pps rates, depending on test. +| | ... | Reported result may contain aggregated pps rates, depending on test. | | ... | Additional latency measurements are performed for smaller loads, | | ... | even if latency stream is disabled in search. Their results | | ... | are also displayed. @@ -115,7 +142,7 @@ | | ... | - traffic_profile - Name of module defining traffc for measurements. | | ... | Type: string | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or -| | ... | string +| | ... | string. | | ... | - max_rate - Calculated maximal unidirectional transmit rate [tps]. | | ... | Type: float | | ... | - resetter - Callable to reset DUT state before each trial. @@ -133,8 +160,7 @@ | | ${disable_latency} = | Get Disable Latency | | ${max_rate} = | Get Max Rate | | ${min_rate_soft} = | Get Min Rate Soft -| | # \${packet_loss_ratio} is used twice so it is worth a variable. -| | ${packet_loss_ratio} = | Get Packet Loss Ratio +| | ${loss_ratio} = | Get Packet Loss Ratio | | ${ppta} = | Get Packets Per Transaction Aggregated | | ${ramp_up_duration} = | Get Ramp Up Duration | | ${ramp_up_rate} = | Get Ramp Up Rate @@ -144,17 +170,18 @@ | | ${transaction_scale} = | Get Transaction Scale | | ${transaction_type} = | Get Transaction Type | | ${use_latency} = | Get Use Latency -| | ${result} = | Perform optimized ndrpdr search +| | ${result} = | Perform MLR Search | | ... | frame_size=${frame_size} | | ... | traffic_profile=${traffic_profile} -| | ... | minimum_transmit_rate=${min_rate_soft} -| | ... | maximum_transmit_rate=${max_rate} -| | ... | packet_loss_ratio=${packet_loss_ratio} -| | ... | final_relative_width=${0.005} -| | ... | final_trial_duration=${30.0} +| | ... | min_load=${min_rate_soft} +| | ... | max_load=${max_rate} +| | ... | loss_ratio=${loss_ratio} +| | ... | relative_width=${0.005} | | ... | initial_trial_duration=${1.0} -| | ... | number_of_intermediate_phases=${2} -| | ... | timeout=${1200.0} +| | ... | final_trial_duration=${1.0} +| | ... | duration_sum=${21.0} +| | ... | preceding_targets=${2} +| | ... | search_duration_max=${1200.0} | | ... | ppta=${ppta} | | ... | resetter=${resetter} | | ... | traffic_directions=${traffic_directions} @@ -164,19 +191,18 @@ | | ... | use_latency=${use_latency} | | ... | ramp_up_duration=${ramp_up_duration} | | ... | ramp_up_rate=${ramp_up_rate} -| | Display result of NDRPDR search | ${result} -| | Check NDRPDR interval validity | ${result[1]} -| | ... | ${packet_loss_ratio} -| | Check NDRPDR interval validity | ${result[0]} -| | ${pdr} = | Set Variable | ${result[1].measured_low.target_tr} -| | ${ndr} = | Set Variable | ${result[0].measured_low.target_tr} -| | # We expect NDR and PDR to have different-looking stats. +| | ${ndr} | ${pdr} = | Display result of NDRPDR search | ${result} +| | # We expect NDR and PDR to have different-looking telemetry. +| | Set Test Variable | ${telemetry_rate} | pdr +| | Set Test Variable | ${telemetry_export} | ${True} | | Send traffic at specified rate | | ... | rate=${pdr} | | ... | trial_duration=${1.0} | | ... | trial_multiplicity=${1} | | ... | use_latency=${use_latency} | | ... | duration_limit=${1.0} +| | Set Test Variable | ${telemetry_rate} | ndr +| | Set Test Variable | ${telemetry_export} | ${True} | | Run Keyword If | ${ndr} != ${pdr} | | ... | Send traffic at specified rate | | ... | rate=${ndr} @@ -231,17 +257,18 @@ | | ${transaction_scale} = | Get Transaction Scale | | ${transaction_type} = | Get Transaction Type | | ${use_latency} = | Get Use Latency -| | ${result} = | Perform optimized ndrpdr search +| | ${result} = | Perform MLR Search | | ... | frame_size=${frame_size} | | ... | traffic_profile=${traffic_profile} -| | ... | minimum_transmit_rate=${min_rate_soft} -| | ... | maximum_transmit_rate=${max_rate} -| | ... | packet_loss_ratio=${0.0} -| | ... | final_relative_width=${0.001} -| | ... | final_trial_duration=${10.0} +| | ... | min_load=${min_rate_soft} +| | ... | max_load=${max_rate} +| | ... | loss_ratio=${0.0} +| | ... | relative_width=${0.001} | | ... | initial_trial_duration=${1.0} -| | ... | number_of_intermediate_phases=${1} -| | ... | timeout=${1200} +| | ... | final_trial_duration=${1.0} +| | ... | duration_sum=${11.0} +| | ... | preceding_targets=${1} +| | ... | search_duration_max=${1200} | | ... | ppta=${ppta} | | ... | resetter=${resetter} | | ... | traffic_directions=${traffic_directions} @@ -251,8 +278,8 @@ | | ... | use_latency=${use_latency} | | ... | ramp_up_duration=${ramp_up_duration} | | ... | ramp_up_rate=${ramp_up_rate} -| | Check NDRPDR interval validity | ${result[0]} -| | Return From Keyword | ${result[0].measured_low.target_tr} +| | ${ret} = | Convert To Number | ${result[0].relevant_lower_bound} +| | Return From Keyword | ${ret} | Measure and show latency at specified rate | | [Documentation] @@ -301,6 +328,7 @@ | | ... | ramp_up_rate=${ramp_up_rate} | | ${latency} = | Get Latency Int | | Set Test Message | ${\n}${message_prefix} ${latency} | append=${True} +| | Export Ndrpdr Latency | ${message_prefix} | ${latency} | Send ramp-up traffic | | [Documentation] @@ -328,7 +356,7 @@ | | ... | \| Send ramp-up traffic \| | | | | ${ramp_up_rate} = | Get Ramp Up Rate -| | Run Keyword Unless | ${ramp_up_rate} > 0.0 | Fail | Ramp up rate missing! +| | Run Keyword If | ${ramp_up_rate} <= 0.0 | Fail | Ramp up rate missing! | | ${ramp_up_duration} = | Get Ramp Up Duration | | ${ppta} = | Get Packets Per Transaction Aggregated | | ${traffic_directions} = | Get Traffic Directions @@ -371,14 +399,17 @@ | | ... | Type: boolean | | ... | - duration_limit - Hard limit for trial duration, overriding duration | | ... | computed from transaction_scale. Default 0.0 means no limit. +| | ... | - export_mrr_unit - Use this unit when exporting MRR values, +| | ... | or empty string for no export. | | | | ... | *Example:* | | | | ... | \| Send traffic at specified rate \| \${1.0} \| ${4000000.0} \ -| | ... | \| \${10} \| ${False} \| ${1.0} \| +| | ... | \| \${10} \| ${False} \| ${1.0} \| pps \| | | | | [Arguments] | ${trial_duration} | ${rate} | ${trial_multiplicity} | | ... | ${use_latency}=${False} | ${duration_limit}=${0.0} +| | ... | ${export_mrr_unit}=${Empty} | | | | ${ppta} = | Get Packets Per Transaction Aggregated | | ${ramp_up_duration} = | Get Ramp Up Duration @@ -415,7 +446,11 @@ | | | ... | ramp_up_rate=${ramp_up_rate} | | | # Out of several quantities for aborted traffic (duration stretching), | | | # the approximated receive rate is the best estimate we have. -| | | Append To List | ${results} | ${result.approximated_receive_rate} +| | | ${value} = | Set Variable | ${result.forwarding_count} +| | | ${value} = | Evaluate | ${value} / ${result.offered_duration} +| | | ${bandwidth} | ${pps} = | Compute Bandwidth | ${value} / ${ppta} +| | | Append Mrr Value | ${value} | ${export_mrr_unit} | ${bandwidth * 1e9} +| | | Append To List | ${results} | ${value} | | END | | FOR | ${action} | IN | @{stat_post_trial} | | | Run Keyword | Additional Statistics Action For ${action} @@ -443,9 +478,12 @@ | | ... | ${trial_multiplicity}=${trial_multiplicity} | | ... | ${traffic_directions}=${1} | | +| | Set Test Variable | ${telemetry_rate} | mrr +| | Set Test Variable | ${telemetry_export} | ${True} | | ${results}= | Send iPerf3 traffic at specified rate | | ... | ${trial_duration} | ${None} | ${None} | | ... | ${trial_multiplicity} | ${traffic_directions} +| | ... | export_mrr_unit=bps | | Set Test Message | ${\n}iPerf3 trial results | | Set Test Message | in Gbits per second: ${results} | | ... | append=yes @@ -460,7 +498,7 @@ | | ... | *Arguments:* | | ... | - trial_duration - Duration of single trial [s]. | | ... | Type: float -| | ... | - rate - Target aggregate transmit rate [bps] / Bits per second +| | ... | - rate - Target aggregated transmit rate [bps] / Bits per second. | | ... | Type: float | | ... | - frame_size - L2 Frame Size [B]. | | ... | Type: integer or string @@ -470,6 +508,9 @@ | | ... | Type: integer | | ... | - extended_debug - True to enable extended debug. | | ... | Type: boolean +| | ... | - export_mrr_unit - Use this unit when exporting MRR values, +| | ... | or empty string for no export. +| | ... | Type: string | | | | ... | *Example:* | | @@ -479,6 +520,7 @@ | | [Arguments] | ${trial_duration} | ${rate} | ${frame_size} | | ... | ${trial_multiplicity}=${trial_multiplicity} | | ... | ${traffic_directions}=${1} | ${extended_debug}=${extended_debug} +| | ... | ${export_mrr_unit}=${Empty} | | | | Set Test Variable | ${extended_debug} | | Set Test Variable | ${rate} @@ -501,14 +543,14 @@ | | ... | bind_mask=${iperf_server_bind_mask} | | ... | namespace=${iperf_server_namespace} | | ... | cpu_skip_cnt=${cpu_skip_cnt} -| | Run Keyword If | '${iperf_client_namespace}' is not '${None}' +| | Run Keyword If | '${iperf_client_namespace}' != '${None}' | | ... | Set Linux Interface IP | | ... | ${nodes['${iperf_client_node}']} | | ... | interface=${iperf_client_interface} | | ... | ip_addr=${iperf_client_bind} | | ... | prefix=${iperf_client_bind_mask} | | ... | namespace=${iperf_client_namespace} -| | Run Keyword If | '${iperf_client_namespace}' is not '${None}' +| | Run Keyword If | '${iperf_client_namespace}' != '${None}' | | ... | Add Default Route To Namespace | | ... | ${nodes['${iperf_client_node}']} | | ... | namespace=${iperf_client_namespace} @@ -539,6 +581,7 @@ | | | ... | bind=${iperf_client_bind} | | | ... | affinity=${iperf_client_affinity} | | | ${conv} = | Convert To Number | ${rr['sum_received']['bits_per_second']} +| | | Append Mrr Value | ${conv} | ${export_mrr_unit} | | | ${conv} = | Evaluate | ${conv} / ${1000} / ${1000} / ${1000} | | | ${conv} = | Evaluate | "{:.3f}".format(${conv}) | | | Append To List @@ -595,7 +638,6 @@ | | ... | transaction_scale=${transaction_scale} | | ... | transaction_type=${transaction_type} | | ... | use_latency=${use_latency} -| | # TODO: Ramp-up? | Stop Running Traffic | | [Documentation] @@ -632,21 +674,25 @@ | | | | ... | \| Traffic should pass with maximum rate \| | | +| | Set Test Variable | ${telemetry_rate} | mrr +| | Set Test Variable | ${telemetry_export} | ${True} | | ${max_rate} = | Get Max Rate | | ${transaction_type} = | Get Transaction Type | | ${trial_duration} = | Get Mrr Trial Duration | | ${trial_multiplicity} = | Get Mrr Trial Multiplicity | | ${use_latency} = | Get Use Latency -| | # The following also sets \${rate_for_teardown} +| | ${unit} = | Set Variable If | """_cps""" in """${transaction_type}""" +| | ... | cps | pps | | ${results} = | Send traffic at specified rate | | ... | rate=${max_rate} | | ... | trial_duration=${trial_duration} | | ... | trial_multiplicity=${trial_multiplicity} | | ... | use_latency=${use_latency} | | ... | duration_limit=${0.0} -| | ${unit} = | Set Variable If | """_cps""" in """${transaction_type}""" +| | ... | export_mrr_unit=${unit} +| | ${unit_text} = | Set Variable If | """_cps""" in """${transaction_type}""" | | ... | estimated connections per second | packets per second | | Set Test Message | ${\n}Maximum Receive Rate trial results -| | Set Test Message | in ${unit}: ${results} +| | Set Test Message | in ${unit_text}: ${results} | | ... | append=yes | | Fail if no traffic forwarded diff --git a/resources/libraries/robot/performance/performance_vars.robot b/resources/libraries/robot/performance/performance_vars.robot index 4f2cc50fa3..1bab1071b7 100644 --- a/resources/libraries/robot/performance/performance_vars.robot +++ b/resources/libraries/robot/performance/performance_vars.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# 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: @@ -155,11 +155,11 @@ | Get Packets Per Transaction Aggregated | | [Documentation] | | ... | Return value of \${packets_per_transaction_aggregated}; -| | ... | if not defined, assume traffic is symmetric and compute -| | ... | from unidirectional values. +| | ... | if not defined, assume traffic is symmetric (or unidirectional) +| | ... | and compute from unidirectional values. | | -| | ... | The return value is used when reporting PPS values from TPS found -| | ... | by some search (e.g. NDRPDR). +| | ... | The return value is used when reporting PPS (and bandwidth) values +| | ... | from TPS found by some search (e.g. NDRPDR). | | ... | Return type: integer. | | | | ... | *Example:* @@ -169,7 +169,6 @@ | | ${ppta} = | Get Variable Value | \${packets_per_transaction_aggregated} | | ... | ${0} | | Return From Keyword If | "${ppta}" != "0" | ${ppta} -| | # TODO: Insert TCP computation from packet size here. | | ${pptad} = | Get Packets Per Transaction And Direction | | ${traffic_directions} = | Get Traffic Directions | | # We do not support ASTF profiles with multiple transactions, yet. @@ -181,8 +180,9 @@ | | ... | Return value of \${packets_per_transaction_and_direction}, | | ... | or ${1} if not defined. | | -| | ... | The return value is used when computing max rate (TPS), -| | ... | so for asymmetric transaction use the more numerous direction. +| | ... | The return value is used when computing max rate (TPS) +| | ... | from packet level (pps or bps) limits. +| | ... | For asymmetric transactions, use the more numerous direction. | | ... | Return type: integer. | | | | ... | *Example:* @@ -392,54 +392,44 @@ | Set Jumbo | | [Documentation] -| | ... | For jumbo frames detection, the maximal packet size is relevant, -| | ... | encapsulation overhead (if any) has effect. -| | -| | ... | This keyword computes jumbo boolean (some suites need that for -| | ... | configuration decisions). +| | ... | Call Set Numeric Frame Sizes and set jumbo based on max framesize. | | ... | To streamline suite autogeneration, both input and output values | | ... | are communicated as test (or broader scope) variables, | | ... | instead of explicit arguments and return values. | | | | ... | *Test (or broader scope) variables read:* | | ... | - overhead - Overhead in bytes; default value: 0. Type: integer -| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or -| | ... | string +| | ... | - frame_size - Framesize. Type: integer or string | | | | ... | *Test variables set:* | | ... | - jumbo - Jumbo boolean, true if jumbo packet support has to be | | ... | enabled. Type: boolean +| | ... | - recommended_mtu - Resonable value (with space for encap overhead) +| | ... | according to jumbo. Type: int | | | | ... | *Example:* | | | | ... | \| Set Jumbo \| | | -| | # Already called by Set Max Rate And Jumbo, but some suites (e.g. device) -| | # are calling this directly. +| | # Some suites (e.g. device) are not calling Set Max Rate And Jumbo. | | Set Numeric Frame Sizes -| | ${jumbo} = | Set Variable If | ${max_frame_size} < 1522 -| | ... | ${False} | ${True} +| | ${jumbo} = | Evaluate | ${max_frame_size} >= 1800 | | Set Test Variable | \${jumbo} +| | ${recommended_mtu} = | Set Variable If | ${jumbo} | ${9200} | ${1800} +| | Set Test Variable | \${recommended_mtu} | Set Max Rate And Jumbo | | [Documentation] -| | ... | Input framesize can be either integer in case of a single packet -| | ... | in stream, or IMIX string defining mix of packets. -| | ... | For jumbo frames detection, the maximal packet size is relevant. -| | ... | For maximal transmit rate, the average packet size is relevant. -| | ... | In both cases, encapsulation overhead (if any) has effect. -| | ... | The maximal rate is computed from NIC name. -| | ... | The implementation works by mapping from exact -| | ... | whitelisted NIC names. -| | ... | The mapping is hardcoded in nic_limits.yaml -| | ... | TODO: Make the mapping from NIC names case insensistive. -| | -| | ... | This keyword computes maximal unidirectional transmit rate -| | ... | and jumbo boolean (some suites need that for configuration decisions). +| | ... | This keyword computes maximal unidirectional transmit rate, +| | ... | jumbo boolean (some suites need that for configuration decisions), +| | ... | and recommended MTU value (depends on jumbo). | | ... | To streamline suite autogeneration, both input and output values | | ... | are communicated as test (or broader scope) variables, | | ... | instead of explicit arguments and return values. | | +| | ... | For correctly applying bandwidth limit, average frame size is used, +| | ... | see Set Numeric Frame Sizes keyword documentation for details. +| | | | ... | If this keyword detects the test is interested in (unidirectional) | | ... | transactons per second maximal rate (tps), that is returned (not pps). | | @@ -448,8 +438,13 @@ | | ... | - overhead - Overhead in bytes; default value: 0. Type: integer | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or | | ... | string -| | ... | - packets_per_transaction_and_direction - Pps-tps conversion. -| | ... | Optional, default 1. +| | ... | - ASTF_N_DATA_FRAMES - Number of data frames per transaction +| | ... | and direction. Type: integer +| | ... | - packets_per_transaction_and_direction - May be unset. +| | ... | See Get Packets Per Transaction And Direction keyword. Type: integer +| | ... | - packets_per_transaction_aggregated - May be unset. +| | ... | See Get Packets Per Transaction Aggregated keyword. Type: integer +| | ... | - TEST_TAGS - Robot tags of this test. Type: list of string | | | | ... | *Test variables set:* | | ... | - max_rate - Calculated unidirectional maximal transmit rate [pps]. @@ -457,8 +452,13 @@ | | ... | Type: float | | ... | - jumbo - Jumbo boolean, true if jumbo packet support has to be | | ... | enabled. Type: boolean -| | ... | avg_frame_size - Average frame size including overhead. Type: float -| | ... | max_frame_size - Maximal frame size including overhead. Type: float +| | ... | - recommended_mtu - Resonable value (with space for encap overhead) +| | ... | according to jumbo. Type: int +| | ... | - max_frame_size - Maximal frame size including overhead. Type: float +| | ... | - avg_directional_frame_size - Average frame size including overhead +| | ... | for the more loaded direction. Type: float +| | ... | - avg_aggregated_frame_size - Average frame size including overhead +| | ... | across both traffic directions. Type: float | | | | ... | *Example:* | | @@ -470,68 +470,192 @@ | | ... | ${NIC_NAME_TO_PPS_LIMIT} | ${nic_name} | | ${bps_limit} = | Get From Dictionary | | ... | ${NIC_NAME_TO_BPS_LIMIT} | ${nic_name} -| | Set Numeric Frame Sizes -| | # We need to add 20B (Ethernet preamble and inter-frame gap) -| | # to avg_frame_size -| | ${rate} = | Evaluate | ${bps_limit} / ((${avg_frame_size} + 20.0) * 8) +| | # Set Jumbo also calls Set Numeric Frame Sizes. +| | Set Jumbo +| | # We need to add 20B (Ethernet preamble and inter-frame gap). +| | ${adfs} = | Get Variable Value | \${avg_directional_frame_size} +| | ${rate} = | Evaluate | ${bps_limit} / ((${adfs} + 20.0) * 8) | | ${max_rate} = | Set Variable If | ${rate} > ${pps_limit} | | ... | ${pps_limit} | ${rate} | | ${pptad} = | Get Packets Per Transaction And Direction | | ${max_rate} = | Evaluate | ${max_rate} / ${pptad} | | Set Test Variable | \${max_rate} -| | Set Jumbo | Set Numeric Frame Sizes | | [Documentation] | | ... | Framesize can be either integer in case of a single packet | | ... | in stream, or set of packets in case of IMIX type or simmilar. | | ... | For jumbo decisions, we need a numeric size of the biggest packet. -| | ... | For max rate decisions, we need a numeric average packet size. -| | ... | This keyword computes both and sets them as test variables. +| | ... | For bandwidth limit decisions, we need a numeric average packet size +| | ... | in the more bit intensive direction if traffic is non-symmetric. +| | ... | Computation of max_rate assumes it is also the more pps direction +| | ... | (so it can have smaller average frame size than the aggregated one). +| | ... | Average (across both directions) frame size is also used +| | ... | for displaying the bidirectional bandwidth forwarded. +| | ... | This keyword computes all three values (accounting for overheads) +| | ... | and sets them as test variables. | | | | ... | Each suite sets a value named \${overhead}, | | ... | which describes by how many bytes the frames on DUT-DUT link | | ... | are larger (due to encapsulation) than those -| | ... | on the primary TG-DUT link. But for some suites that value +| | ... | on the primary TG-DUT link. For some suites that value | | ... | can be negaive (if TG-DUT is encapsulated more heavily). | | ... | For calculations in this keyword, we need largest sizes | | ... | across links, so zero is used if \${overhead} is negative. | | +| | ... | The other overhead is from TCP control packets (only IPv4 supported). +| | ... | TCP_CPS tests have SYN frames of length 78B and other frames 70B. +| | ... | The more loaded is client-to-server direction with 1 SYN and 3 other, +| | ... | across both directions it is 2 SYN and 5 other. +| | ... | TCP_PPS and TCP_TPUT tests have one other control packet less +| | ... | (in the less loaded direction), but they do contain data frames. +| | | | ... | *Test variables read:* | | ... | - frame_size - Framesize. Type: integer or string | | ... | - overhead - Overhead in bytes; default value: ${0}. Type: integer +| | ... | - ASTF_N_DATA_FRAMES - Number of data frames per transaction +| | ... | and direction. Type: integer +| | ... | - packets_per_transaction_and_direction - May be unset. +| | ... | See Get Packets Per Transaction And Direction keyword. Type: integer +| | ... | - packets_per_transaction_aggregated - May be unset. +| | ... | See Get Packets Per Transaction Aggregated keyword. Type: integer +| | ... | - TEST_TAGS - Robot tags of this test. Type: list of string | | | | ... | *Test variables set* -| | ... | avg_frame_size - Average frame size including overhead. Type: float -| | ... | max_frame_size - Maximal frame size including overhead. Type: float +| | ... | - max_frame_size - Maximal frame size including overhead. Type: float +| | ... | - avg_directional_frame_size - Average frame size including overhead +| | ... | for the more loaded direction. Type: float +| | ... | - avg_aggregated_frame_size - Average frame size including overhead +| | ... | across both traffic directions. Type: float | | | | ... | *Example:* | | | | ... | \| Set Numeric Frame Sizes \| | | +| | ${bare_max_frame_size} = | Run Keyword If +| | ... | '${frame_size}' == 'IMIX_v4_1' | Set Variable | ${1518.0} +| | ... | ELSE | Convert To Number | ${frame_size} +| | ${bafs} = | Run Keyword If +| | ... | '${frame_size}' == 'IMIX_v4_1' | Set Variable | ${353.8333333333333} +| | ... | ELSE | Convert To Number | ${frame_size} +| | # Long boolean formula in 2 lines. +| | ${is_cps} = | Evaluate | 'TCP_CPS' in ${TEST_TAGS} +| | ${is_pps} = | Evaluate | 'TCP_PPS' in ${TEST_TAGS} +| | ${is_tput} = | Evaluate | ${is_pps} or 'TCP_TPUT' in ${TEST_TAGS} +| | # TODO: Investigate impact of values on hoststack tests. +| | ${is_cps} = | Evaluate | ${is_cps} and 'HOSTSTACK' not in ${TEST_TAGS} +| | ${is_tput} = | Evaluate | ${is_tput} and 'HOSTSTACK' not in ${TEST_TAGS} +| | ${avg_dir_frame_size} | ${avg_agg_frame_size} = | Run Keyword If +| | ... | ${is_cps} | Apply Tcp Cps Proto Overhead | ${bafs} +| | ... | ELSE IF | ${is_tput} | Apply Tcp Tput Proto Overhead | ${bafs} +| | ... | ELSE | Set Variable | ${bafs} | ${bafs} | | ${max_overhead} = | Set Variable If | ${overhead} >= 0 | ${overhead} | ${0} -| | ${bare_avg_frame_size} = | Run Keyword If | '${frame_size}' == 'IMIX_v4_1' -| | ... | Set Variable | ${353.83333} -| | ... | ELSE -| | ... | Convert To Number | ${frame_size} -| | # Do not use $max_overhead (without braces), that does not tolerate string. -| | ${avg_frame_size} = | Evaluate | ${bare_avg_frame_size} + ${max_overhead} -| | Set Test Variable | \${avg_frame_size} -| | ${bare_max_frame_size} = | Run Keyword If | '${frame_size}' == 'IMIX_v4_1' -| | ... | Set Variable | ${1518} -| | ... | ELSE -| | ... | Convert To Number | ${frame_size} -| | ${max_frame_size} = | Evaluate | $bare_max_frame_size + $max_overhead -| | Set Test Variable | ${max_frame_size} +| | ${mfs} = | Evaluate | ${bare_max_frame_size} + ${max_overhead} +| | ${adfs} = | Evaluate | ${avg_dir_frame_size} + ${max_overhead} +| | ${aafs} = | Evaluate | ${avg_agg_frame_size} + ${max_overhead} +| | Set Test Variable | \${max_frame_size} | ${mfs} +| | Set Test Variable | \${avg_directional_frame_size} | ${adfs} +| | Set Test Variable | \${avg_aggregated_frame_size} | ${aafs} + +| Apply Tcp Cps Proto Overhead +| | [Documentation] +| | ... | Recompute average frame size for TCP CPS test cases. +| | +| | ... | This is contitionally called from Set Numeric Frame Sizes. +| | ... | In Robot Framework it is more convenient to wrap such a block +| | ... | as a standalone keyword to Run Keyword If. +| | +| | ... | *Test variables read:* +| | ... | - ASTF_N_DATA_FRAMES - Number of data frames per transaction +| | ... | and direction. Usually set globally. Type: integer +| | ... | - packets_per_transaction_and_direction - May be unset. +| | ... | See Get Packets Per Transaction And Direction keyword. Type: integer +| | ... | - packets_per_transaction_aggregated - May be unset. +| | ... | See Get Packets Per Transaction Aggregated keyword. Type: integer +| | +| | ... | *Arguments:* +| | ... | - bare_avg_frame_size - Average numeric framesize without overheads. +| | +| | ... | *Returns:* +| | ... | - avg_dir_frame_size - Average framesize for more loaded direction. +| | ... | - avg_agg_frame_size - Average framesize across both directions. +| | +| | ... | *Example:* +| | +| | ... | \| \${adfs} \| \${aafs} = \| Apply Tcp Cps Proto Overhead \| \${bafs} +| | +| | [Arguments] | ${bare_avg_frame_size} +| | +| | # Increase max_frame_size for TCP tests if used for more than just jumbo. +| | Run Keyword If | ${bare_avg_frame_size} != 64 +| | ... | Fail | TCP_CPS tests are only supported for (nominal) 64B frames. +| | # TODO: Unify with packets_per_transaction_* variables when adding PCAP. +| | ${pptad} = | Get Packets Per Transaction And Direction +| | ${ppta} = | Get Packets Per Transaction Aggregated +| | ${avg_dir_frame_size} = | Evaluate | (78.0 * 1 + 70.0 * 3) / (1 + 3) +| | Run Keyword If | '${pptad}' != '4' +| | ... | Fail | TCP CPS with pptad '${pptad}' != '4'. +| | ${avg_agg_frame_size} = | Evaluate | (78.0 * 2 + 70.0 * 5) / (2 + 5) +| | Run Keyword If | '${ppta}' != '7' +| | ... | Fail | TCP CPS with ppta '${ppta}' != '7'. +| | Return From Keyword | ${avg_dir_frame_size} | ${avg_agg_frame_size} + +| Apply Tcp Tput Proto Overhead +| | [Documentation] +| | ... | Recompute average frame size for TCP TPUT (or PPS) test cases. +| | +| | ... | This is contitionally called from Set Numeric Frame Sizes. +| | ... | In Robot Framework it is more convenient to wrap such a block +| | ... | as a standalone keyword to Run Keyword If. +| | +| | ... | *Test variables read:* +| | ... | - ASTF_N_DATA_FRAMES - Number of data frames per transaction +| | ... | and direction. Usually set globally. Type: integer +| | ... | - packets_per_transaction_and_direction - May be unset. +| | ... | See Get Packets Per Transaction And Direction keyword. Type: integer +| | ... | - packets_per_transaction_aggregated - May be unset. +| | ... | See Get Packets Per Transaction Aggregated keyword. Type: integer +| | +| | ... | *Arguments:* +| | ... | - bare_framesize - Average numeric framesize without overheads. +| | +| | ... | *Returns:* +| | ... | - avg_dir_frame_size - Average framesize for more loaded direction. +| | ... | - avg_agg_frame_size - Average framesize across both directions. +| | +| | ... | *Example:* +| | +| | ... | \| \${adfs} \| \${aafs} = \| Apply Tcp Cps Proto Overhead \| \${bafs} +| | +| | [Arguments] | ${bare_framesize} +| | +| | # TODO: Unify with packets_per_transaction_* variables when adding PCAP. +| | ${pptad} = | Get Packets Per Transaction And Direction +| | ${ppta} = | Get Packets Per Transaction Aggregated +| | # Long float formula in 4 lines. +| | ${numerator} = | Evaluate | ${bare_framesize} * ${ASTF_N_DATA_FRAMES} +| | ${numerator} = | Evaluate | 78.0 * 1 + 70.0 * 3 + ${numerator} +| | ${denominator} = | Evaluate | 1 + 3 + ${ASTF_N_DATA_FRAMES} +| | ${avg_dir_frame_size} = | Evaluate | ${numerator} / ${denominator} +| | Run Keyword If | '${pptad}' != '${denominator}' +| | ... | Fail | TCP TPUT with pptad '${pptad}' != '${denominator}'. +| | # Long float formula in 4 lines. +| | ${numerator} = | Evaluate | ${bare_framesize} * 2 * ${ASTF_N_DATA_FRAMES} +| | ${numerator} = | Evaluate | 78.0 * 2 + 70.0 * 4 + ${numerator} +| | ${denominator} = | Evaluate | 2 + 4 + 2 * ${ASTF_N_DATA_FRAMES} +| | ${avg_agg_frame_size} = | Evaluate | ${numerator} / ${denominator} +| | Run Keyword If | '${ppta}' != '${denominator}' +| | ... | Fail | TCP TPUT with ppta '${ppta}' != '${denominator}'. +| | Return From Keyword | ${avg_dir_frame_size} | ${avg_agg_frame_size} | Set Rates For Policer | | [Documentation] | | ... | Policer tests need these values, -| | ... | currently computed from \${avg_frame_size}. +| | ... | currently computed from \${avg_directional_frame_size}. | | ... | TODO: Verify the units match and computation is correct. | | | | ... | *Test (or broader scope) variables read:* -| | ... | - avg_frame_size - Average L2 Frame Size [B]. Type: float +| | ... | - avg_directional_frame_size - Average L2 Frame Size [B]. Type: float | | ... | Set by Set Max Rate And Jumbo keyword. | | | | ... | *Test variables set:* @@ -542,5 +666,5 @@ | | | | ... | \| Set Rates For Policer \| | | -| | Set Test Variable | \${eb} | ${avg_frame_size} -| | Set Test Variable | \${cb} | ${avg_frame_size} +| | Set Test Variable | \${eb} | ${avg_directional_frame_size} +| | Set Test Variable | \${cb} | ${avg_directional_frame_size} diff --git a/resources/libraries/robot/shared/container.robot b/resources/libraries/robot/shared/container.robot index 4b2ad22527..9f08e6b1d4 100644 --- a/resources/libraries/robot/shared/container.robot +++ b/resources/libraries/robot/shared/container.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# 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: @@ -84,9 +84,9 @@ | | ... | ${nf_dtc} | | ${nf_id}= | Evaluate | (${nf_chain} - ${1}) * ${nf_nodes} + ${nf_node} | | ${env}= | Create List | DEBIAN_FRONTEND=noninteractive -| | ${dut1_uuid_length} = | Get Length | ${DUT1_UUID} -| | ${root}= | Run Keyword If | ${dut1_uuid_length} -| | ... | Get Docker Mergeddir | ${nodes['DUT1']} | ${DUT1_UUID} +| | ${in_container}= | Running in Container | ${nodes['${dut}']} +| | ${root}= | Run Keyword If | ${in_container} +| | ... | Get Docker Mergeddir | ${nodes['${dut}']} | | ... | ELSE | Set Variable | ${EMPTY} | | ${node_arch}= | Get Node Arch | ${nodes['${dut}']} | | ${name}= | Set Variable | ${dut}_${container_group}${nf_id}${DUT1_UUID} @@ -106,7 +106,7 @@ | | ... | vs_dtc=${cpu_count_int} | nf_dtc=${nf_dtc} | nf_dtcr=${nf_dtcr} | | &{cont_args}= | Create Dictionary | | ... | name=${name} | node=${nodes['${dut}']} | mnt=${mnt} | env=${env} -| | ... | root=${root} +| | ... | root=${root} | page_size=${page_size} | | Run Keyword If | ${pinning} | | ... | Set To Dictionary | ${cont_args} | cpuset_cpus=${nf_cpus} | | Run Keyword | ${container_group}.Construct container | &{cont_args} @@ -240,6 +240,10 @@ | | ... | ${container_chain_topology} | | ... | dut1_if=${DUT1_${int}2}[0] | | ... | dut2_if=${DUT2_${int}2}[0] +| | ... | ELSE IF | '${container_chain_topology}' == 'chain_dma' +| | ... | ${group}.Configure VPP In All Containers +| | ... | ${container_chain_topology} +| | ... | dma_wqs=${DUT1_dma_wqs} | | ... | ELSE | | ... | ${group}.Configure VPP In All Containers | | ... | ${container_chain_topology} diff --git a/resources/libraries/robot/shared/default.robot b/resources/libraries/robot/shared/default.robot index 58bbb97acb..2dc78941b3 100644 --- a/resources/libraries/robot/shared/default.robot +++ b/resources/libraries/robot/shared/default.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# 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: @@ -28,12 +28,15 @@ | Library | resources.libraries.python.FlowUtil | Library | resources.libraries.python.L2Util | Library | resources.libraries.python.InterfaceUtil +| Library | resources.libraries.python.IPTopology | Library | resources.libraries.python.IPUtil | Library | resources.libraries.python.IPv6Util | Library | resources.libraries.python.IrqUtil +| Library | resources.libraries.python.model.ExportJson | Library | resources.libraries.python.NodePath | Library | resources.libraries.python.Namespaces | Library | resources.libraries.python.PapiHistory +| Library | resources.libraries.python.QATUtil | Library | resources.libraries.python.SchedUtils | Library | resources.libraries.python.Tap | Library | resources.libraries.python.Tap.TapFeatureMask @@ -42,6 +45,7 @@ | Library | resources.libraries.python.topology.Topology | Library | resources.libraries.python.Trace | Library | resources.libraries.python.VhostUser.VirtioFeatureMask +| Library | resources.libraries.python.VppConfigGenerator.VppInitConfig | Library | resources.libraries.python.VppCounters | Library | resources.libraries.python.VPPUtil | @@ -74,6 +78,7 @@ *** Variables *** | ${cpu_alloc_str}= | ${0} +| ${page_size}= | ${DEFAULT_HUGEPAGE_SIZE} *** Keywords *** | Call Resetter @@ -82,8 +87,6 @@ | | ... | If it exists (and not None), call the resetter (as a Python callable). | | ... | This is usually used to reset any state on DUT before next trial. | | -| | ... | TODO: Move to a more specific library if needed. -| | | | ... | *Example:* | | | | ... | \| Call Resetter \| @@ -94,29 +97,6 @@ | | # Parens are there to perform the call. | | Run Keyword If | $resetter | Evaluate | $resetter() -| Configure crypto device on all DUTs -| | [Documentation] | Verify if Crypto QAT device virtual functions are -| | ... | initialized on all DUTs. If parameter force_init is set to True, then -| | ... | try to initialize/disable. -| | -| | ... | *Arguments:* -| | ... | - crypto_type - Crypto device type - HW_DH895xcc or HW_C3xxx; default -| | ... | value: HW_DH895xcc. Type: string -| | ... | - numvfs - Number of VFs to initialize, 0 - disable the VFs; default -| | ... | value: ${32} Type: integer -| | ... | - force_init - Force to initialize. Type: boolean -| | -| | ... | *Example:* -| | -| | ... | \| Configure crypto device on all DUTs \| HW_DH895xcc \| ${32} \| -| | -| | [Arguments] | ${crypto_type} | ${numvfs} | ${force_init}=${False} -| | -| | FOR | ${dut} | IN | @{duts} -| | | Crypto Device Verify | ${nodes['${dut}']} | ${crypto_type} -| | | ... | ${numvfs} | force_init=${force_init} -| | END - | Configure kernel module on all DUTs | | [Documentation] | Verify if specific kernel module is loaded on all DUTs. | | ... | If parameter force_load is set to True, then try to load. @@ -168,18 +148,21 @@ | | | Run Keyword | ${dut}.Set Node | ${nodes['${dut}']} | node_key=${dut} | | | Run Keyword | ${dut}.Add Unix Log | | | Run Keyword | ${dut}.Add Unix CLI Listen -| | | Run Keyword | ${dut}.Add Unix Nodaemon +| | | Run Keyword | ${dut}.Add Unix CLI No Pager +| | | Run Keyword | ${dut}.Add Unix GID +| | | Run Keyword | ${dut}.Add API Segment Prefix | ${dut} | | | Run Keyword | ${dut}.Add Unix Coredump | | | Run Keyword | ${dut}.Add Socksvr | ${SOCKSVR_PATH} -| | | Run Keyword | ${dut}.Add Main Heap Size | ${${heap_size_mult}*${2}}G -| | | Run Keyword | ${dut}.Add Main Heap Page Size | 2M -| | | Run Keyword | ${dut}.Add Statseg Size | 2G -| | | Run Keyword | ${dut}.Add Statseg Page Size | 2M +| | | Run Keyword | ${dut}.Add Main Heap Size | ${${heap_size_mult}*${3}}G +| | | Run Keyword | ${dut}.Add Main Heap Page Size | ${page_size} +| | | Run Keyword | ${dut}.Add Default Hugepage Size | ${page_size} +| | | Run Keyword | ${dut}.Add Statseg Size | 3G +| | | Run Keyword | ${dut}.Add Statseg Page Size | ${page_size} | | | Run Keyword | ${dut}.Add Statseg Per Node Counters | on | | | Run Keyword | ${dut}.Add Plugin | disable | default | | | Run Keyword | ${dut}.Add Plugin | enable | @{plugins_to_enable} | | | Run Keyword | ${dut}.Add IP6 Hash Buckets | 2000000 -| | | Run Keyword | ${dut}.Add IP6 Heap Size | 4G +| | | Run Keyword | ${dut}.Add IP6 Heap Size | 3G | | | Run Keyword | ${dut}.Add Graph Node Variant | ${GRAPH_NODE_VARIANT} | | END @@ -204,15 +187,12 @@ | | [Arguments] | ${phy_cores} | ${rx_queues}=${None} | ${rxd}=${None} | | ... | ${txd}=${None} | | +| | Create compute resources variables +| | ... | ${phy_cores} | rx_queues=${rx_queues} | rxd=${rxd} | txd=${txd} | | FOR | ${dut} | IN | @{duts} -| | | &{compute_resource_info}= | Get Affinity Vswitch -| | | ... | ${nodes} | ${dut} | ${phy_cores} | rx_queues=${rx_queues} -| | | ... | rxd=${rxd} | txd=${txd} -| | | Set Test Variable | &{compute_resource_info} -| | | Create compute resources variables -| | | Run Keyword | ${dut}.Add CPU Main Core | ${cpu_main} +| | | Run Keyword | ${dut}.Add CPU Main Core | ${${dut}_cpu_main} | | | Run Keyword If | ${cpu_count_int} > 0 -| | | ... | ${dut}.Add CPU Corelist Workers | ${cpu_wt} +| | | ... | ${dut}.Add CPU Corelist Workers | ${${dut}_cpu_wt} | | | Run Keyword | ${dut}.Add Buffers Per Numa | ${buffers_numa} | | END @@ -223,6 +203,22 @@ | | ... | _NOTE:_ This KW sets various suite variables based on computed | | ... | resources. | | +| | ... | *Arguments:* +| | ... | - phy_cores - Number of physical cores to use. Type: integer +| | ... | - rx_queues - Number of RX queues. Type: integer +| | ... | - rxd - Number of RX descriptors. Type: integer +| | ... | - txd - Number of TX descriptors. Type: integer +| | +| | ... | *Example:* +| | +| | ... | \| Create compute resources variables \| ${1} \| ${1} \| +| | +| | [Arguments] | ${phy_cores} | ${rx_queues}=${None} +| | ... | ${rxd}=${None} | ${txd}=${None} +| | +| | &{compute_resource_info}= | Get Affinity Vswitch +| | ... | ${nodes} | ${phy_cores} | rx_queues=${rx_queues} +| | ... | rxd=${rxd} | txd=${txd} | | ${variables}= | Get Dictionary Keys | ${compute_resource_info} | | FOR | ${variable} | IN | @{variables} | | | ${value}= | Get From Dictionary | ${compute_resource_info} | ${variable} @@ -232,24 +228,6 @@ | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD | | Set Tags | ${dp_count_int}T${cpu_count_int}C -| Add DPDK VLAN strip offload switch off between DUTs -| | [Documentation] -| | ... | Add VLAN Strip Offload switch off on PCI devices between DUTs to VPP -| | ... | configuration file. -| | -| | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1 -| | | ${_even}= | Evaluate | ${pf} % 2 -| | | Run Keyword Unless | ${even} -| | | ... | DUT1.Add DPDK Dev Parameter | ${DUT1_${int}${pf}_pci}[0] -| | | ... | vlan-strip-offload | off -| | END -| | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1 -| | | ${_even}= | Evaluate | ${pf} % 2 -| | | Run Keyword If | ${even} -| | | ... | DUT2.Add DPDK Dev Parameter | ${DUT2_${int}${pf}_pci}[0] -| | | ... | vlan-strip-offload | off -| | END - | Add NAT to all DUTs | | [Documentation] | Add NAT configuration to all DUTs. | | diff --git a/resources/libraries/robot/shared/interfaces.robot b/resources/libraries/robot/shared/interfaces.robot index 0c669247d6..b4d6959d01 100644 --- a/resources/libraries/robot/shared/interfaces.robot +++ b/resources/libraries/robot/shared/interfaces.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# 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: @@ -16,13 +16,14 @@ | Library | resources.libraries.python.VhostUser *** Variables *** +| ${dpdk_enable_tcp_udp_checksum}= | ${False} | ${dpdk_no_tx_checksum_offload}= | ${True} *** Keywords *** | Set single interfaces in path up | | [Documentation] | | ... | *Set UP state on single physical VPP interfaces in path on all DUT -| | ... | nodes and set maximal MTU.* +| | ... | nodes.* | | | | ... | *Arguments:* | | ... | - pf - NIC physical function (physical port). @@ -41,8 +42,7 @@ | Set interfaces in path up | | [Documentation] -| | ... | *Set UP state on VPP interfaces in path on all DUT nodes and set -| | ... | maximal MTU.* +| | ... | *Set UP state on VPP interfaces in path on all DUT nodes.* | | | | ... | *Arguments:* | | ... | - validate - Validate interfaces are up. @@ -58,8 +58,7 @@ | Set interfaces in path up on node | | [Documentation] -| | ... | *Set UP state on VPP interfaces in path on specified DUT node and -| | ... | set maximal MTU.* +| | ... | *Set UP state on VPP interfaces in path on specified DUT node.* | | | | ... | *Arguments:* | | ... | - dut - DUT node on which to set the interfaces up. @@ -77,8 +76,7 @@ | Set interfaces in path up on node on PF | | [Documentation] -| | ... | *Set UP state on VPP interfaces in path on specified DUT node and -| | ... | set maximal MTU.* +| | ... | *Set UP state on VPP interfaces in path on specified DUT node.* | | | | ... | *Arguments:* | | ... | - dut - DUT node on which to set the interfaces up. @@ -97,7 +95,6 @@ | | ${_id}= | Set Variable If | '${_chains}' == 'PASS' | _1 | ${EMPTY} | | FOR | ${if} | IN | @{${dut}_${int}${pf}${_id}} | | | Set Interface State | ${nodes['${dut}']} | ${if} | up -| | | VPP Set Interface MTU | ${nodes['${dut}']} | ${if} | | END | Pre-initialize layer driver @@ -137,13 +134,22 @@ | | Run Keyword If | ${index} >= 0 | Return From Keyword | | FOR | ${dut} | IN | @{duts} | | | Stop VPP Service | ${nodes['${dut}']} -| | | PCI Driver Unbind List | ${nodes['${dut}']} | @{${dut}_pf_pci} +| | | Unbind PCI Devices From Other Driver | ${nodes['${dut}']} | vfio-pci | +| | | ... | @{${dut}_pf_pci} | | | Run keyword | ${dut}.Add DPDK Dev | @{${dut}_pf_pci} +| | | Run Keyword If | ${dpdk_enable_tcp_udp_checksum} +| | | ... | ${dut}.Add DPDK Enable TCP UDP Checksum | | | Run Keyword If | ${dpdk_no_tx_checksum_offload} | | | ... | ${dut}.Add DPDK No Tx Checksum Offload | | | Run Keyword | ${dut}.Add DPDK Log Level | debug | | | Run Keyword | ${dut}.Add DPDK Uio Driver | vfio-pci | | | Run Keyword | ${dut}.Add DPDK Dev Default RXQ | ${rxq_count_int} +| | | Run Keyword If | '${nic_name}' == 'Amazon-Nitro-100G' +| | | ... | ${dut}.Add DPDK Dev Default Devargs | +| | | ... | "normal_llq_hdr=1,enable_llq=1,control_path_poll_interval=0" +| | | Run Keyword If | '${nic_name}' == 'Amazon-Nitro-200G' +| | | ... | ${dut}.Add DPDK Dev Default Devargs | +| | | ... | "normal_llq_hdr=1,enable_llq=1,control_path_poll_interval=0" | | | Run Keyword If | not ${jumbo} | | | ... | ${dut}.Add DPDK No Multi Seg | | | Run Keyword If | ${nic_rxq_size} > 0 @@ -154,10 +160,6 @@ | | | ... | ${dut}.Add DPDK Cryptodev | ${dp_count_int} | | | Run Keyword | ${dut}.Add DPDK Max Simd Bitwidth | ${GRAPH_NODE_VARIANT} | | END -| | ${_vlan_strip} | ${value}= | Run Keyword And Ignore Error -| | ... | Variable Should Exist | ${vlan_strip_off} -| | Run keyword If | '${_vlan_strip}' == 'PASS' and ${duts_count} == 2 -| | ... | Add DPDK VLAN strip offload switch off between DUTs | Pre-initialize layer avf on all DUTs | | [Documentation] @@ -172,6 +174,8 @@ | | FOR | ${dut} | IN | @{duts} | | | Set Interface State PCI | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | state=up +| | | Set Interface XDP off +| | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | | | Set Interface Channels | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | num_queues=${rxq_count_int} | | | ... | channel=combined @@ -182,11 +186,8 @@ | | ... | Pre-initialize rdma-core driver. | | | | FOR | ${dut} | IN | @{duts} -| | | Run Keyword If | ${jumbo} -| | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=9200 -| | | ... | ELSE -| | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=1518 -| | FOR | ${dut} | IN | @{duts} +| | | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} +| | | ... | mtu=${recommended_mtu} | | | Set Interface Flow Control | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rxf="off" | txf="off" | | END @@ -196,13 +197,29 @@ | | ... | Pre-initialize mlx5_core driver. | | | | FOR | ${dut} | IN | @{duts} -| | | Run Keyword If | ${jumbo} -| | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=9200 -| | | ... | ELSE -| | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=1518 | | | Set Interface Flow Control | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rxf="off" | txf="off" | | END +| | ${index}= | Get Index From List | ${TEST TAGS} | DPDK +| | Run Keyword If | ${index} >= 0 | Return From Keyword +| | FOR | ${dut} | IN | @{duts} +| | | Run keyword | ${dut}.Add DPDK Dev | @{${dut}_pf_pci} +| | | Run Keyword If | ${dpdk_enable_tcp_udp_checksum} +| | | ... | ${dut}.Add DPDK Enable TCP UDP Checksum +| | | Run Keyword If | ${dpdk_no_tx_checksum_offload} +| | | ... | ${dut}.Add DPDK No Tx Checksum Offload +| | | Run Keyword | ${dut}.Add DPDK Log Level | debug +| | | Run Keyword | ${dut}.Add DPDK Dev Default RXQ | ${rxq_count_int} +| | | Run Keyword If | not ${jumbo} +| | | ... | ${dut}.Add DPDK No Multi Seg +| | | Run Keyword If | ${nic_rxq_size} > 0 +| | | ... | ${dut}.Add DPDK Dev Default RXD | ${nic_rxq_size} +| | | Run Keyword If | ${nic_txq_size} > 0 +| | | ... | ${dut}.Add DPDK Dev Default TXD | ${nic_txq_size} +| | | Run Keyword If | '${crypto_type}' != '${None}' +| | | ... | ${dut}.Add DPDK Cryptodev | ${dp_count_int} +| | | Run Keyword | ${dut}.Add DPDK Max Simd Bitwidth | ${GRAPH_NODE_VARIANT} +| | END | Initialize layer driver | | [Documentation] @@ -340,7 +357,7 @@ | Initialize layer vfio-pci on node | | [Documentation] | | ... | Initialize vfio-pci interfaces on DUT on NIC PF. -| | ... | Currently no operation. +| | ... | Currently just set MTU to the recommended value. | | | | ... | *Arguments:* | | ... | - dut - DUT node. Type: string @@ -352,7 +369,9 @@ | | | | [Arguments] | ${dut} | ${pf} | | -| | No operation +| | Set Interface State | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0] | down +| | VPP Set Interface MTU +| | ... | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0] | mtu=${recommended_mtu} | Initialize layer avf on node | | [Documentation] @@ -440,9 +459,21 @@ | Initialize layer mlx5_core on node | | [Documentation] | | ... | Initialize mlx5_core interfaces on DUT on NIC PF. -| | ... | Currently no operation. +| | ... | Currently just set MTU to the recommended value. | | -| | No operation +| | ... | *Arguments:* +| | ... | - dut - DUT node. Type: string +| | ... | - pf - NIC physical function (physical port). Type: integer +| | +| | ... | *Example:* +| | +| | ... | \| Initialize layer rdma-core on node \| DUT1 \| 1 \| +| | +| | [Arguments] | ${dut} | ${pf} +| | +| | Set Interface State | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0] | down +| | VPP Set Interface MTU +| | ... | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0] | mtu=${recommended_mtu} | Initialize layer interface | | [Documentation] @@ -832,3 +863,23 @@ | | | | ${vhost_dump}= | Vhost User Dump | ${dut} | | Return From Keyword | ${vhost_dump} + +| Lower DUT1-DUT2 MTU For Fragmentation +| | [Documentation] | Set lower MTU on both ends of DUT1-DUT2 link. +| | +| | ... | This should force VPP to fragment (and reassembly) packets. +| | ... | Should be called after Initialize Layer Interface. +| | ... | Suite variables such as \${dut2_if1} should be defined by then. +| | +| | ... | As VPP (at least dpdk plugin) require interface to be down +| | ... | before MTU can be changed, interfaces are temporarily downed. +| | +| | # TODO: ip_reassembly_set to increase max_reassembly_length so jumbo passes. +| | Set Interface State | ${nodes['DUT1']} | ${dut1_if2} | down +| | Set Interface State | ${nodes['DUT2']} | ${dut2_if1} | down +| | VPP Set Interface MTU +| | ... | ${nodes['DUT1']} | ${dut1_if2} | ${MTU_FOR_FRAGMENTATION} +| | VPP Set Interface MTU +| | ... | ${nodes['DUT2']} | ${dut2_if1} | ${MTU_FOR_FRAGMENTATION} +| | Set Interface State | ${nodes['DUT1']} | ${dut1_if2} | up +| | Set Interface State | ${nodes['DUT2']} | ${dut2_if1} | up diff --git a/resources/libraries/robot/shared/suite_setup.robot b/resources/libraries/robot/shared/suite_setup.robot index 26d7f52205..5c92ad9f52 100644 --- a/resources/libraries/robot/shared/suite_setup.robot +++ b/resources/libraries/robot/shared/suite_setup.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 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: @@ -18,12 +18,14 @@ | Library | resources.libraries.python.InterfaceUtil | Library | resources.libraries.python.NGINX.NGINXTools | Library | resources.tools.ab.ABTools +| Library | resources.libraries.python.Iperf3 | Library | resources.libraries.python.NodePath | Library | resources.libraries.python.topology.Topology | Library | resources.libraries.python.TrafficGenerator | Variables | resources/libraries/python/Constants.py | | Documentation | Suite setup keywords. + *** Keywords *** | Create suite topology variables | | [Documentation] @@ -83,12 +85,14 @@ | | | | [Arguments] | @{actions} | | +| | Start Suite Setup Export | | ${nic_model_list}= | Create list | ${nic_name} | | &{info}= | Compute Circular Topology | | ... | ${nodes} | filter_list=${nic_model_list} | nic_pfs=${nic_pfs} | | ... | always_same_link=${False} | topo_has_tg=${True} | | Set suite variable | &{topology_info} | &{info} | | Create suite topology variables | @{actions} +| | Finalize Suite Setup Export | Setup suite topology interfaces with no TG | | [Documentation] @@ -104,12 +108,14 @@ | | | | [Arguments] | @{actions} | | +| | Start Suite Setup Export | | ${nic_model_list}= | Create list | ${nic_name} | | &{info}= | Compute Circular Topology | | ... | ${nodes} | filter_list=${nic_model_list} | nic_pfs=${nic_pfs} | | ... | always_same_link=${True} | topo_has_tg=${False} | | Set suite variable | &{topology_info} | &{info} | | Create suite topology variables | @{actions} +| | Finalize Suite Setup Export | Setup suite topology interfaces with no DUT | | [Documentation] @@ -125,17 +131,20 @@ | | | | [Arguments] | @{actions} | | +| | Start Suite Setup Export | | ${nic_model_list}= | Create list | ${nic_name} | | &{info}= | Compute Circular Topology | | ... | ${nodes} | filter_list=${nic_model_list} | nic_pfs=${nic_pfs} | | ... | always_same_link=${True} | topo_has_tg=${True} | topo_has_dut=${False} | | Set suite variable | &{topology_info} | &{info} | | Create suite topology variables | @{actions} +| | Finalize Suite Setup Export | Additional Suite Setup Action For scapy | | [Documentation] | | ... | Additional Setup for suites which uses scapy as Traffic generator. | | +| | Export TG Type And Version | scapy | 2.4.3 | | FOR | ${dut} | IN | @{duts} | | | Set Suite Variable | ${${dut}_vf1} | ${${dut}_${int}1} | | | Set Suite Variable | ${${dut}_vf2} | ${${dut}_${int}2} @@ -147,6 +156,8 @@ | | [Documentation] | | ... | Additional Setup for suites which uses dpdk. | | +| | ${version} = | Get Dpdk Version | ${nodes}[DUT1] +| | Export Dut Type And Version | dpdk | ${version} | | FOR | ${dut} | IN | @{duts} | | | Initialize DPDK Framework | ${nodes['${dut}']} | | | ... | ${${dut}_${int}1}[0] | ${${dut}_${int}2}[0] | ${nic_driver} @@ -227,64 +238,90 @@ | | | ... | ELSE | | | ... | Additional Suite Setup Action For performance pf | ${dut} | | END -| | Initialize traffic generator -| | ... | ${tg} | ${TG_pf1}[0] | ${TG_pf2}[0] -| | ... | ${dut1} | ${DUT1_${int}1}[0] -| | ... | ${dut${duts_count}} | ${DUT${duts_count}_${int}2}[0] -| | ... | ${osi_layer} +| | ${type} = | Get TG Type | ${nodes}[TG] +| | ${version} = | Get TG Version | ${nodes}[TG] +| | Export TG Type And Version | ${type} | ${version} +| | Initialize traffic generator | ${osi_layer} | ${nic_pfs} | Additional Suite Setup Action For performance_tg_nic | | [Documentation] | | ... | Additional Setup for suites which uses performance measurement -| | ... | for L1 cross connect tests +| | ... | for L1 cross connect tests. +| | +| | ${type} = | Get TG Type | ${nodes}[TG] +| | ${version} = | Get TG Version | ${nodes}[TG] +| | Export Dut Type And Version | ${type} | ${version} +| | Export TG Type And Version | ${type} | ${version} +| | Initialize traffic generator | ${osi_layer} | ${nic_pfs} + +| Additional Suite Setup Action For iPerf3 +| | [Documentation] +| | ... | Additional Setup for suites which uses performance measurement over +| | ... | iPerf3. | | -| | Initialize traffic generator -| | ... | ${tg} | ${TG_pf1}[0] | ${TG_pf2}[0] -| | ... | ${tg} | ${TG_pf2}[0] -| | ... | ${tg} | ${TG_pf1}[0] -| | ... | ${osi_layer} +| | ${type} = | Get iPerf Type +| | ${version} = | Get iPerf Version | ${nodes}[TG] +| | Export TG Type And Version | ${type} | ${version} -| Additional Suite Setup Action For ipsechw +| Additional Suite Setup Action For cryptohw | | [Documentation] | | ... | Additional Setup for suites which uses QAT HW. | | -| | ${numvfs}= | Set Variable If -| | ... | '${crypto_type}' == 'HW_DH895xcc' | ${32} -| | ... | '${crypto_type}' == 'HW_C3xxx' | ${16} -| | Configure crypto device on all DUTs | ${crypto_type} | numvfs=${numvfs} -| | ... | force_init=${True} -| | Configure kernel module on all DUTs | vfio_pci | force_load=${True} +| | Crypto Device Verify on all DUTs | ${nodes} | Additional Suite Setup Action For nginx | | [Documentation] | | ... | Additional Setup for suites which uses Nginx. | | | | Install NGINX framework on all DUTs | ${nodes} | ${packages_dir} -| | ... | ${nginx_version} +| | ... | ${nginx_version} + +| Additional Suite Setup Action For vppecho +| | [Documentation] +| | ... | Additional Setup for suites which uses performance measurement over +| | ... | VPP Echo. +| | +| | Export DUT Type And Version | ${DUT_TYPE} | ${DUT_VERSION} +| | Export TG Type And Version | ${DUT_TYPE} | ${DUT_VERSION} | Additional Suite Setup Action For ab | | [Documentation] | | ... | Additional Setup for suites which uses ab TG. | | -| | Verify Program Installed | ${tg} | ab | | Iface update numa node | ${tg} | | ${running}= | Is TRex running | ${tg} | | Run keyword if | ${running}==${True} | Teardown traffic generator | ${tg} | | ${curr_driver}= | Get PCI dev driver | ${tg} -| | ... | ${tg['interfaces']['${tg_if1}']['pci_address']} +| | ... | ${tg['interfaces']['${TG_pf1}[0]']['pci_address']} | | Run keyword if | '${curr_driver}'!='${None}' | | ... | PCI Driver Unbind | ${tg} | -| | ... | ${tg['interfaces']['${tg_if1}']['pci_address']} -| | ${driver}= | Get Variable Value | ${tg['interfaces']['${tg_if1}']['driver']} +| | ... | ${tg['interfaces']['${TG_pf1}[0]']['pci_address']} +| | ${driver}= | Get Variable Value +| | ... | ${tg['interfaces']['${TG_pf1}[0]']['driver']} | | PCI Driver Bind | ${tg} -| | ... | ${tg['interfaces']['${tg_if1}']['pci_address']} | ${driver} +| | ... | ${tg['interfaces']['${TG_pf1}[0]']['pci_address']} | ${driver} | | ${intf_name}= | Get Linux interface name | ${tg} -| | ... | ${tg['interfaces']['${tg_if1}']['pci_address']} +| | ... | ${tg['interfaces']['${TG_pf1}[0]']['pci_address']} | | FOR | ${ip_addr} | IN | @{ab_ip_addrs} | | | ${ip_addr_on_intf}= | Linux interface has IP | ${tg} | ${intf_name} | | | ... | ${ip_addr} | ${ab_ip_prefix} | | | Run Keyword If | ${ip_addr_on_intf}==${False} | Set Linux interface IP | | | ... | ${tg} | ${intf_name} | ${ip_addr} | ${ab_ip_prefix} | | END -| | Set Linux interface up | ${tg} | ${intf_name} -| | Check ab | ${tg} +| | Set Linux interface up | ${nodes}[TG] | ${intf_name} +| | ${curr_driver}= | Get PCI dev driver | ${tg} +| | ... | ${tg['interfaces']['${TG_pf2}[0]']['pci_address']} +| | Run keyword if | '${curr_driver}'!='${None}' +| | ... | PCI Driver Unbind | ${tg} | +| | ... | ${tg['interfaces']['${TG_pf2}[0]']['pci_address']} +| | ${driver}= | Get Variable Value +| | ... | ${tg['interfaces']['${TG_pf2}[0]']['driver']} +| | PCI Driver Bind | ${tg} +| | ... | ${tg['interfaces']['${TG_pf2}[0]']['pci_address']} | ${driver} +| | ${intf_name}= | Get Linux interface name | ${tg} +| | ... | ${tg['interfaces']['${TG_pf2}[0]']['pci_address']} +| | Set Linux interface up | ${nodes}[TG] | ${intf_name} +| | Check AB | ${tg} +| | ${type} = | Get AB Type | ${nodes}[TG] +| | ${version} = | Get AB Version | ${nodes}[TG] +| | Export TG Type And Version | ${type} | ${version} diff --git a/resources/libraries/robot/shared/suite_teardown.robot b/resources/libraries/robot/shared/suite_teardown.robot index 20b2776eec..810c8bb066 100644 --- a/resources/libraries/robot/shared/suite_teardown.robot +++ b/resources/libraries/robot/shared/suite_teardown.robot @@ -30,10 +30,12 @@ | | | | [Arguments] | @{actions} | | +| | Start Suite Teardown Export | | FOR | ${action} | IN | @{actions} | | | Run Keyword | Additional Suite Tear Down Action For ${action} | | END | | Remove All Added VIF Ports On All DUTs From Topology | ${nodes} +| | Finalize Suite Teardown Export | Additional Suite Tear Down Action For ab | | [Documentation] @@ -71,3 +73,4 @@ | | FOR | ${dut} | IN | @{duts} | | | Kill Program | ${nodes['${dut}']} | iperf3 | | | Kill Program | ${nodes['${dut}']} | vpp_echo +| | END diff --git a/resources/libraries/robot/shared/test_setup.robot b/resources/libraries/robot/shared/test_setup.robot index e2fcfc5f87..22e017fd6f 100644 --- a/resources/libraries/robot/shared/test_setup.robot +++ b/resources/libraries/robot/shared/test_setup.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2022 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: @@ -21,13 +21,14 @@ *** Keywords *** | Setup test | | [Documentation] -| | ... | Common test setup for tests. +| | ... | Common test setup for VPP tests. | | | | ... | *Arguments:* | | ... | - ${actions} - Additional setup action. Type: list | | | | [Arguments] | @{actions} | | +| | Start Test Export | | Reset PAPI History On All DUTs | ${nodes} | | ${int} = | Set Variable If | ${nic_vfs} > 0 | prevf | pf | | Create base startup configuration of VPP on all DUTs @@ -48,4 +49,4 @@ | | ... | Additional Setup for tests which uses namespace. | | | | ${trex_running}= | Is Trex Running | ${tg} -| | Run Keyword Unless | ${trex_running} | Startup Trex | ${tg} | ${osi_layer} +| | Run Keyword If | not ${trex_running} | Startup Trex | ${tg} | ${osi_layer} diff --git a/resources/libraries/robot/shared/test_teardown.robot b/resources/libraries/robot/shared/test_teardown.robot index 3fe5e6a8ee..f590e8a7cd 100644 --- a/resources/libraries/robot/shared/test_teardown.robot +++ b/resources/libraries/robot/shared/test_teardown.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 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: @@ -14,7 +14,7 @@ """Keywords used in test teardowns.""" *** Settings *** -| Resource | resources/libraries/robot/shared/container.robot +| Resource | resources/libraries/robot/shared/default.robot | Library | resources.libraries.python.PapiHistory | Library | resources.libraries.python.topology.Topology | Variables | resources/libraries/python/Constants.py @@ -45,6 +45,7 @@ | | | Run Keyword | Additional Test Tear Down Action For ${action} | | END | | Clean Sockets On All Nodes | ${nodes} +| | Finalize Test Export | Tear down test raw | | [Documentation] @@ -60,6 +61,7 @@ | | | Run Keyword | Additional Test Tear Down Action For ${action} | | END | | Clean Sockets On All Nodes | ${nodes} +| | Finalize Test Export # Additional Test Tear Down Actions in alphabetical order | Additional Test Tear Down Action For acl @@ -128,6 +130,16 @@ | | | ... | Show Ipsec Security Association | ${nodes['${dut}']} | | END +| Additional Test Tear Down Action For ipsec_all +| | [Documentation] +| | ... | Additional teardown for tests which use varied IPSec configuration. +| | ... | Databases. +| | +| | FOR | ${dut} | IN | @{duts} +| | | Run Keyword If Test Failed +| | | ... | Vpp Ipsec Show All | ${nodes['${dut}']} +| | END + | Additional Test Tear Down Action For linux_bridge | | [Documentation] | | ... | Additional teardown for tests which uses linux_bridge. @@ -187,6 +199,8 @@ | | ${rate_for_teardown} = | Get Rate For Teardown | | Call Resetter | | Set Test Variable | \${extended_debug} | ${True} +| | Set Test Variable | ${telemetry_rate} | ${EMPTY} +| | Set Test Variable | ${telemetry_export} | ${False} | | Send traffic at specified rate | | ... | trial_duration=${1.0} | | ... | rate=${rate_for_teardown} @@ -220,4 +234,4 @@ | | | | ${vnf_status} | ${value}= | Run Keyword And Ignore Error | | ... | Keyword Should Exist | vnf_manager.Kill All VMs -| | Run Keyword If | '${vnf_status}' == 'PASS' | vnf_manager.Kill All VMs
\ No newline at end of file +| | Run Keyword If | '${vnf_status}' == 'PASS' | vnf_manager.Kill All VMs diff --git a/resources/libraries/robot/shared/vm.robot b/resources/libraries/robot/shared/vm.robot index eb6acb371f..5b45718a03 100644 --- a/resources/libraries/robot/shared/vm.robot +++ b/resources/libraries/robot/shared/vm.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 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: @@ -38,7 +38,7 @@ | | | | ... | *Example:* | | -| | ... | \| Configure chains of VMs connected via vhost-user +| | ... | \| Configure chains of NFs connected via vhost-user | | ... | \| 1 \| 1 \| False \| 1024 \| False \| False \| vpp \| True \| | | | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${jumbo}=${False} @@ -59,7 +59,7 @@ | | ... | vnf=${vnf} | tg_pf1_mac=${TG_pf1_mac}[0] | tg_pf2_mac=${TG_pf2_mac}[0] | | ... | vs_dtc=${cpu_count_int} | nf_dtc=${nf_dtc} | nf_dtcr=${nf_dtcr} | | ... | rxq_count_int=${rxq_count_int} -| | ... | virtio_feature_mask=${virtio_feature_mask} +| | ... | virtio_feature_mask=${virtio_feature_mask} | page_size=${page_size} | | ${cpu_wt}= | Run Keyword | vnf_manager.Start All VMs | pinning=${pinning} | | ${cpu_alloc_str}= | Catenate | SEPARATOR=, | ${cpu_alloc_str} | ${cpu_wt} | | Set Test Variable | ${cpu_alloc_str} @@ -114,10 +114,11 @@ | | ... | vnf=${vnf} | tg_pf1_mac=${TG_pf1_mac}[0] | tg_pf2_mac=${TG_pf2_mac}[0] | | ... | vs_dtc=${cpu_count_int} | nf_dtc=${nf_dtc} | nf_dtcr=${nf_dtcr} | | ... | rxq_count_int=${rxq_count_int} -| | ... | virtio_feature_mask=${virtio_feature_mask} +| | ... | virtio_feature_mask=${virtio_feature_mask} | page_size=${page_size} | | ${cpu_wt}= | Run Keyword | vnf_manager.Start All VMs | pinning=${pinning} -| | ${cpu_alloc_str}= | Catenate | SEPARATOR=, | ${cpu_alloc_str} | ${cpu_wt} -| | Set Test Variable | ${cpu_alloc_str} +| | ${cpu_alloc_str}= | Catenate | SEPARATOR=, +| | ... | ${${node}_cpu_alloc_str} | ${cpu_wt} +| | Set Test Variable | ${${node}_cpu_alloc_str} | ${cpu_alloc_str} | | Run Keyword If | ${validate} | | ... | All VPP Interfaces Ready Wait | ${nodes} | retries=${300} | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=Virtual @@ -143,7 +144,7 @@ | | | | ... | *Example:* | | -| | ... | \| Configure chains of VMs connected via passtrough +| | ... | \| Configure chains of NFs connected via passtrough | | ... | \| 1 \| 1 \| False \| 1024 \| False \| False \| vpp \| True \| | | | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${jumbo}=${False} @@ -164,7 +165,7 @@ | | ... | vnf=${vnf} | tg_pf1_mac=${TG_pf1_mac}[0] | tg_pf2_mac=${TG_pf2_mac}[0] | | ... | vs_dtc=${cpu_count_int} | nf_dtc=${nf_dtc} | nf_dtcr=${nf_dtcr} | | ... | rxq_count_int=${rxq_count_int} -| | ... | virtio_feature_mask=${virtio_feature_mask} +| | ... | virtio_feature_mask=${virtio_feature_mask} | page_size=${page_size} | | ... | if1=${DUT1_${int}1}[0] | if2=${DUT1_${int}2}[0] | | ${cpu_wt}= | Run Keyword | vnf_manager.Start All VMs | pinning=${pinning} | | ${cpu_alloc_str}= | Catenate | SEPARATOR=, | ${cpu_alloc_str} | ${cpu_wt} diff --git a/resources/libraries/robot/wireguard/wireguard.robot b/resources/libraries/robot/wireguard/wireguard.robot new file mode 100644 index 0000000000..f85c0eb7b1 --- /dev/null +++ b/resources/libraries/robot/wireguard/wireguard.robot @@ -0,0 +1,66 @@ +# Copyright (c) 2022 Intel 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 | String +| Library | resources.libraries.python.InterfaceUtil +| Library | resources.libraries.python.WireGuardUtil +| Library | resources.libraries.python.IPUtil +| Library | resources.libraries.python.IPv6Util +| +| Documentation | Wireguard keywords. + +*** Keywords *** +| Generate keys for WireGuard +| | [Documentation] | Generate a pair of keys for WireGuard +| | +| | ... | _NOTE:_ This KW sets following test case variable: +| | ... | - private_key - wireguard Private key. Type: bytes +| | ... | - pub_key - wireguard public key. Type: bytes +| | +| | ... | *Example:* +| | ... | \| ${private_key} | ${pub_key} | +| | ... | \| Generate Wireguard Privatekey and Pubkey \| +| | +| | ${private_key} | ${pub_key} | Generate Wireguard Privatekey and Pubkey +| | Set Test Variable | ${private_key} +| | Set Test Variable | ${pub_key} + +| Initialize WireGuard in 3-node circular topology +| | [Documentation] +| | ... | Set UP state on VPP interfaces in path on nodes in 3-node circular +| | ... | topology. Get the interface MAC addresses and setup ARP on VPP +| | ... | interfaces towards TG. Setup IPv4 addresses with /24 prefix on DUT-TG +| | ... | links. Set routing for decrypted traffic on both DUT nodes +| | ... | with prefix /8 and next hop of neighbour TG interface IPv4 address. +| | +| | VPP Interface Set IP Address +| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${dut1_if1_ip4} | 24 +| | VPP Interface Set IP Address +| | ... | ${dut2} | ${DUT2_${int}2}[0] | ${dut2_if2_ip4} | 24 +| | VPP Add IP Neighbor +| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${tg_if1_ip4} | ${TG_pf1_mac}[0] +| | VPP Add IP Neighbor +| | ... | ${dut2} | ${DUT2_${int}2}[0] | ${tg_if2_ip4} | ${TG_pf2_mac}[0] +| | Vpp Route Add | ${dut1} | ${laddr_ip4} | 8 | gateway=${tg_if1_ip4} +| | ... | interface=${DUT1_${int}1}[0] +| | Vpp Route Add | ${dut2} | ${raddr_ip4} | 8 | gateway=${tg_if2_ip4} +| | ... | interface=${DUT2_${int}2}[0] + +| VPP Enable Wireguard Async Mode on all VPP DUTs +| | [Documentation] +| | ... | Enable wireguard async mode on all DUT nodes. +| | +| | FOR | ${dut} | IN | @{duts} +| | | VPP Wireguard Set Async Mode | ${nodes['${dut}']} +| | END |