aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/robot/shared/suite_setup.robot
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/robot/shared/suite_setup.robot')
-rw-r--r--resources/libraries/robot/shared/suite_setup.robot161
1 files changed, 144 insertions, 17 deletions
diff --git a/resources/libraries/robot/shared/suite_setup.robot b/resources/libraries/robot/shared/suite_setup.robot
index a9e57e7024..5c92ad9f52 100644
--- a/resources/libraries/robot/shared/suite_setup.robot
+++ b/resources/libraries/robot/shared/suite_setup.robot
@@ -1,4 +1,4 @@
-# Copyright (c) 2020 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:
@@ -16,12 +16,16 @@
*** Settings ***
| Library | resources.libraries.python.DPDK.DPDKTools
| 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]
@@ -81,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]
@@ -102,17 +108,43 @@
| |
| | [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]
+| | ... | Common suite setup for single link tests with no device under test
+| | ... | node.
+| | ... |
+| | ... | Compute path for testing on given topology nodes in circular topology
+| | ... | based on interface model provided as an argument and set
+| | ... | corresponding suite variables.
+| |
+| | ... | *Arguments:*
+| | ... | - ${actions} - Additional setup action. Type: list
+| |
+| | [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}
@@ -124,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}
@@ -139,15 +173,15 @@
| |
| | ... | *Example:*
| |
-| | ... | \| Additional Suite Setup Action For performance_dut \| DUT1 \|
+| | ... | \| Additional Suite Setup Action For performance vf \| DUT1 \|
| |
| | [Arguments] | ${dut}
| |
| | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
| | | ${_vf}=
-| | | ... | Run Keyword | Init ${nic_driver} interface
-| | | ... | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0] | numvfs=${nic_vfs}
-| | | ... | osi_layer=${osi_layer}
+| | | ... | Run Keyword | Init interface
+| | | ... | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0] | driver=${nic_driver}
+| | | ... | numvfs=${nic_vfs} | osi_layer=${osi_layer}
| | | ${_mac}=
| | | ... | Create List | ${EMPTY}
| | | ${_ip4_addr}=
@@ -174,6 +208,26 @@
| | Set Suite Variable
| | ... | ${int} | prevf
+| Additional Suite Setup Action For performance pf
+| | [Documentation]
+| | ... | Additional Setup for suites which uses performance measurement for
+| | ... | single DUT (inner loop).
+| |
+| | ... | *Arguments:*
+| | ... | - dut - DUT node. Type: string
+| |
+| | ... | *Example:*
+| |
+| | ... | \| Additional Suite Setup Action For performance pf \| DUT1 \|
+| |
+| | [Arguments] | ${dut}
+| |
+| | FOR | ${pf} | IN RANGE | 1 | ${nic_pfs} + 1
+| | | Run Keyword | Init interface
+| | | ... | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0] | driver=${nic_driver}
+| | | ... | numvfs=${0} | osi_layer=${osi_layer}
+| | END
+
| Additional Suite Setup Action For performance
| | [Documentation]
| | ... | Additional Setup for suites which uses performance measurement.
@@ -181,20 +235,93 @@
| | FOR | ${dut} | IN | @{duts}
| | | Run Keyword If | ${nic_vfs} > 0
| | | ... | Additional Suite Setup Action For performance vf | ${dut}
+| | | ... | 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.
+| |
+| | ${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 ipsechw
+| Additional Suite Setup Action For iPerf3
+| | [Documentation]
+| | ... | Additional Setup for suites which uses performance measurement over
+| | ... | iPerf3.
+| |
+| | ${type} = | Get iPerf Type
+| | ${version} = | Get iPerf Version | ${nodes}[TG]
+| | Export TG Type And Version | ${type} | ${version}
+
+| 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}
+
+| 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.
+| |
+| | 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_pf1}[0]']['pci_address']}
+| | Run keyword if | '${curr_driver}'!='${None}'
+| | ... | PCI Driver Unbind | ${tg} |
+| | ... | ${tg['interfaces']['${TG_pf1}[0]']['pci_address']}
+| | ${driver}= | Get Variable Value
+| | ... | ${tg['interfaces']['${TG_pf1}[0]']['driver']}
+| | PCI Driver Bind | ${tg}
+| | ... | ${tg['interfaces']['${TG_pf1}[0]']['pci_address']} | ${driver}
+| | ${intf_name}= | Get Linux interface name | ${tg}
+| | ... | ${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 | ${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}