diff options
author | Jan Gelety <jgelety@cisco.com> | 2019-11-12 05:27:43 +0100 |
---|---|---|
committer | Jan Gelety <jgelety@cisco.com> | 2019-11-28 18:26:21 +0100 |
commit | d68951ac245150eeefa6e0f4156e4c1b5c9e9325 (patch) | |
tree | 487554a7547218d27f0a61ec02b70502c32cdcb4 /resources/libraries/robot/shared/default.robot | |
parent | ed0258a440cfad7023d643f717ab78ac568dc59b (diff) |
Python3: resources and libraries
Change-Id: I1392c06b1d64f62b141d24c0d42a8e36913b15e2
Signed-off-by: Jan Gelety <jgelety@cisco.com>
Diffstat (limited to 'resources/libraries/robot/shared/default.robot')
-rw-r--r-- | resources/libraries/robot/shared/default.robot | 98 |
1 files changed, 54 insertions, 44 deletions
diff --git a/resources/libraries/robot/shared/default.robot b/resources/libraries/robot/shared/default.robot index c0b61fcea9..26fcbb0c3f 100644 --- a/resources/libraries/robot/shared/default.robot +++ b/resources/libraries/robot/shared/default.robot @@ -15,11 +15,11 @@ | Variables | resources/libraries/python/topology.py | Variables | resources/libraries/python/PapiHistory.py | Variables | resources/libraries/python/Constants.py -| ... +| | Library | Collections | Library | OperatingSystem | Library | String -| ... +| | Library | resources.libraries.python.Classify | Library | resources.libraries.python.CpuUtils | Library | resources.libraries.python.CoreDumpUtil @@ -40,7 +40,7 @@ | Library | resources.libraries.python.Trace | Library | resources.libraries.python.VppCounters | Library | resources.libraries.python.VPPUtil -| ... +| | Resource | resources/libraries/robot/lb/load_balancer.robot | Resource | resources/libraries/robot/crypto/ipsec.robot | Resource | resources/libraries/robot/features/acl.robot @@ -77,45 +77,46 @@ | | [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. | | ... | Type: string, default value: HW_DH895xcc | | ... | - numvfs - Number of VFs to initialize, 0 - disable the VFs | | ... | Type: integer, default value: ${32} | | ... | - 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} +| | +| | 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. -| | ... +| | | | ... | *Arguments:* | | ... | - module - Module to verify. Type: string | | ... | - force_load - Try to load module. Type: boolean -| | ... +| | | | ... | *Example:* -| | ... +| | | | ... | \| Configure kernel module on all DUTs \| ${True} \| -| | ... +| | | | [Arguments] | ${module} | ${force_load}=${False} -| | ... +| | | | Verify Kernel Module on All DUTs | ${nodes} | ${module} | | ... | force_load=${force_load} | Create base startup configuration of VPP on all DUTs | | [Documentation] | Create base startup configuration of VPP to all DUTs. -| | ... -| | :FOR | ${dut} | IN | @{duts} +| | +| | FOR | ${dut} | IN | @{duts} | | | Import Library | resources.libraries.python.VppConfigGenerator | | | ... | WITH NAME | ${dut} | | | Run keyword | ${dut}.Set Node | ${nodes['${dut}']} @@ -132,6 +133,7 @@ | | | Run keyword | ${dut}.Add IP6 Hash Buckets | 2000000 | | | Run keyword | ${dut}.Add IP6 Heap Size | 4G | | | Run keyword | ${dut}.Add IP Heap Size | 4G +| | END | Add worker threads to all DUTs | | [Documentation] | Setup worker threads in vpp startup configuration on all @@ -142,25 +144,25 @@ | | ... | RXQ are computed automatically by dividing thread count with number 2 | | ... | (TODO: Add division by actual number of interfaces). User can manually | | ... | override RX, RXD, TXD parameters if needed. -| | ... +| | | | ... | *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:* -| | ... +| | | | ... | \| Add worker threads to all DUTs \| ${1} \| ${1} \| -| | ... +| | | | [Arguments] | ${phy_cores} | ${rx_queues}=${None} | ${rxd}=${None} | | ... | ${txd}=${None} -| | ... +| | | | ${cpu_count_int} | Convert to Integer | ${phy_cores} | | ${thr_count_int} | Convert to Integer | ${phy_cores} | | ${rxd_count_int}= | Set variable | ${rxd} | | ${txd_count_int}= | Set variable | ${txd} -| | :FOR | ${dut} | IN | @{duts} +| | FOR | ${dut} | IN | @{duts} | | | ${if1_status} | ${value}= | Run Keyword And Ignore Error | | | ... | Variable Should Exist | ${${dut}_if1} | | | @{if_list}= | Run Keyword If | '${if1_status}' == 'PASS' @@ -201,6 +203,7 @@ | | | Run keyword if | ${thr_count_int} > 1 | | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD | | | Set Tags | ${thr_count_int}T${cpu_count_int}C +| | END | | Set Test Variable | ${smt_used} | | Set Test Variable | ${thr_count_int} | | Set Test Variable | ${cpu_count_int} @@ -211,8 +214,8 @@ | Add DPDK pci devices to all DUTs | | [Documentation] | | ... | Add PCI devices to VPP configuration file. -| | ... -| | :FOR | ${dut} | IN | @{duts} +| | +| | FOR | ${dut} | IN | @{duts} | | | ${if1_status} | ${value}= | Run Keyword And Ignore Error | | | ... | Variable Should Exist | ${${dut}_if1} | | | ${if1_pci}= | Run Keyword If | '${if1_status}' == 'PASS' @@ -250,18 +253,20 @@ | | | ... | Set Test Variable | ${${dut}_if2_1_pci} | ${if2_1_pci} | | | Run Keyword Unless | '${if2_status}' == 'PASS' | | | ... | Set Test Variable | ${${dut}_if2_2_pci} | ${if2_2_pci} +| | END | Add DPDK no PCI to all DUTs | | [Documentation] | Add DPDK no-pci to VPP startup configuration to all DUTs. -| | ... -| | :FOR | ${dut} | IN | @{duts} +| | +| | FOR | ${dut} | IN | @{duts} | | | Run keyword | ${dut}.Add DPDK no PCI +| | END | Add VLAN strip offload switch off between DUTs in 3-node single link topology | | [Documentation] | | ... | Add VLAN Strip Offload switch off on PCI devices between DUTs to VPP | | ... | configuration file. -| | ... +| | | | Run keyword | DUT1.Add DPDK Dev Parameter | ${dut1_if2_pci} | | ... | vlan-strip-offload | off | | Run keyword | DUT2.Add DPDK Dev Parameter | ${dut2_if1_pci} @@ -271,7 +276,7 @@ | | [Documentation] | | ... | Add VLAN Strip Offload switch off on PCI devices between DUTs to VPP | | ... | configuration file -| | ... +| | | | Run keyword | DUT1.Add DPDK Dev Parameter | ${dut1_if2_1_pci} | | ... | vlan-strip-offload | off | | Run keyword | DUT1.Add DPDK Dev Parameter | ${dut1_if2_2_pci} @@ -283,33 +288,36 @@ | Add NAT to all DUTs | | [Documentation] | Add NAT configuration to all DUTs. -| | ... -| | :FOR | ${dut} | IN | @{duts} +| | +| | FOR | ${dut} | IN | @{duts} | | | Run keyword | ${dut}.Add NAT +| | END | Write startup configuration on all VPP DUTs | | [Documentation] | Write VPP startup configuration without restarting VPP. -| | ... -| | :FOR | ${dut} | IN | @{duts} +| | +| | FOR | ${dut} | IN | @{duts} | | | Run keyword | ${dut}.Write Config +| | END | Apply startup configuration on all VPP DUTs | | [Documentation] | Write VPP startup configuration and restart VPP on all | | ... | DUTs. -| | ... +| | | | ... | *Arguments:* | | ... | - with_trace - Enable packet trace after VPP restart Type: boolean -| | ... +| | | | ... | *Example:* -| | ... +| | | | ... | \| Apply startup configuration on all VPP DUTs \| False \| -| | ... +| | | | [Arguments] | ${with_trace}=${False} -| | ... -| | :FOR | ${dut} | IN | @{duts} +| | +| | FOR | ${dut} | IN | @{duts} | | | Run keyword | ${dut}.Apply Config | | | Add New Socket | ${nodes['${dut}']} | PAPI | ${dut} | ${SOCKSVR_PATH} | | | Add New Socket | ${nodes['${dut}']} | STATS | ${dut} | ${SOCKSTAT_PATH} +| | END | | Save VPP PIDs | | Enable Coredump Limit VPP on All DUTs | ${nodes} | | Update All Interface Data On All Nodes | ${nodes} | skip_tg=${True} @@ -319,20 +327,21 @@ | | [Documentation] | Get PIDs of VPP processes from all DUTs in topology and\ | | ... | set it as a test variable. The PIDs are stored as dictionary items\ | | ... | where the key is the host and the value is the PID. -| | ... +| | | | ${setup_vpp_pids}= | Get VPP PIDs | ${nodes} | | ${keys}= | Get Dictionary Keys | ${setup_vpp_pids} | | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${key} | IN | @{keys} +| | FOR | ${key} | IN | @{keys} | | | ${pid}= | Get From Dictionary | ${setup_vpp_pids} | ${key} | | | Run Keyword If | $pid is None | FAIL | No VPP PID found on node ${key} +| | END | | Set Test Variable | ${setup_vpp_pids} | Verify VPP PID in Teardown | | [Documentation] | Check if the VPP PIDs on all DUTs are the same at the end\ | | ... | of test as they were at the begining. If they are not, only a message\ | | ... | is printed on console and to log. The test will not fail. -| | ... +| | | | ${teardown_vpp_pids}= | Get VPP PIDs | ${nodes} | | ${err_msg}= | Catenate | ${SUITE NAME} - ${TEST NAME} | | ... | \nThe VPP PIDs are not equal!\nTest Setup VPP PIDs: @@ -346,7 +355,7 @@ # TODO: Cleanup when VIRL is gone. | Set up functional test | | [Documentation] | Common test setup for functional tests. -| | ... +| | | | Restart Vpp Service On All Duts | ${nodes} | | Verify Vpp On All Duts | ${nodes} | | VPP Enable Traces On All Duts | ${nodes} @@ -355,14 +364,15 @@ | | Update All Interface Data On All Nodes | ${nodes} | | Reset PAPI History On All DUTs | ${nodes} | | ${duts}= | Get Matches | ${nodes} | DUT* -| | :FOR | ${dut} | IN | @{duts} +| | FOR | ${dut} | IN | @{duts} | | | Add New Socket | ${nodes['${dut}']} | PAPI | ${dut} | ${SOCKSVR_PATH} | | | Add New Socket | ${nodes['${dut}']} | STATS | ${dut} | ${SOCKSTAT_PATH} +| | END # TODO: Cleanup when VIRL is gone. | Tear down functional test | | [Documentation] | Common test teardown for functional tests. -| | ... +| | | | Remove All Added Ports On All DUTs From Topology | ${nodes} | | Show Packet Trace on All DUTs | ${nodes} | | Show PAPI History On All DUTs | ${nodes} |