diff options
Diffstat (limited to 'resources/libraries/robot/shared')
-rw-r--r-- | resources/libraries/robot/shared/container.robot | 14 | ||||
-rw-r--r-- | resources/libraries/robot/shared/default.robot | 92 | ||||
-rw-r--r-- | resources/libraries/robot/shared/interfaces.robot | 105 | ||||
-rw-r--r-- | resources/libraries/robot/shared/suite_setup.robot | 93 | ||||
-rw-r--r-- | resources/libraries/robot/shared/suite_teardown.robot | 3 | ||||
-rw-r--r-- | resources/libraries/robot/shared/test_setup.robot | 7 | ||||
-rw-r--r-- | resources/libraries/robot/shared/test_teardown.robot | 20 | ||||
-rw-r--r-- | resources/libraries/robot/shared/vm.robot | 17 |
8 files changed, 220 insertions, 131 deletions
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} |