X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Frobot%2Fshared%2Fdefault.robot;h=58bbb97acbe9ac7c3bf8671363936cc1401c69ae;hp=f060032b0c681269259b1e4d9da1a1d81ab40dc4;hb=648fa787d8ed7a045da18cf1a0761f3ca0d5b947;hpb=1be82a8542da6764f4ec8562cbcece0c65c8173a diff --git a/resources/libraries/robot/shared/default.robot b/resources/libraries/robot/shared/default.robot index f060032b0c..58bbb97acb 100644 --- a/resources/libraries/robot/shared/default.robot +++ b/resources/libraries/robot/shared/default.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. +# 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: @@ -20,20 +20,23 @@ | Library | OperatingSystem | Library | String | +| Library | resources.libraries.python.Adl | Library | resources.libraries.python.Classify | Library | resources.libraries.python.CpuUtils | Library | resources.libraries.python.CoreDumpUtil -| Library | resources.libraries.python.Cop | Library | resources.libraries.python.DUTSetup +| Library | resources.libraries.python.FlowUtil | Library | resources.libraries.python.L2Util | Library | resources.libraries.python.InterfaceUtil | Library | resources.libraries.python.IPUtil | Library | resources.libraries.python.IPv6Util +| Library | resources.libraries.python.IrqUtil | Library | resources.libraries.python.NodePath | Library | resources.libraries.python.Namespaces | Library | resources.libraries.python.PapiHistory | Library | resources.libraries.python.SchedUtils | Library | resources.libraries.python.Tap +| Library | resources.libraries.python.Tap.TapFeatureMask | Library | resources.libraries.python.TestConfig | Library | resources.libraries.python.TGSetup | Library | resources.libraries.python.topology.Topology @@ -58,7 +61,6 @@ | Resource | resources/libraries/robot/overlay/lisp.robot | Resource | resources/libraries/robot/overlay/lispgpe.robot | Resource | resources/libraries/robot/overlay/lisp_api.robot -| Resource | resources/libraries/robot/performance/performance_limits.robot | Resource | resources/libraries/robot/performance/performance_utils.robot | Resource | resources/libraries/robot/shared/interfaces.robot | Resource | resources/libraries/robot/shared/container.robot @@ -74,6 +76,24 @@ | ${cpu_alloc_str}= | ${0} *** Keywords *** +| Call Resetter +| | [Documentation] +| | ... | Check for a presence of test variable \${resetter}. +| | ... | 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 \| +| | +| | ${resetter} = | Get Resetter +| | # See http://robotframework.org/robotframework/3.1.2/libraries/BuiltIn.html +| | # #Evaluating%20expressions for $variable (without braces) syntax. +| | # 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 @@ -169,9 +189,7 @@ | | ... | automatically map also the sibling logical cores. | | ... | Keyword will automatically set the appropriate test TAGs in format | | ... | mTnC, where m=logical_core_count and n=physical_core_count. -| | ... | 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. +| | ... | User can manually override RXQ, RXD, TXD parameters if needed. | | | | ... | *Arguments:* | | ... | - phy_cores - Number of physical cores to use. Type: integer @@ -186,50 +204,33 @@ | | [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} -| | | ${numa}= | Get interfaces numa node -| | | ... | ${nodes['${dut}']} | @{${dut}_pf_keys} -| | | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']} -| | | ${skip_cnt}= | Set variable | ${CPU_CNT_SYSTEM} -| | | ${cpu_main}= | Cpu list per node str | ${nodes['${dut}']} | ${numa} -| | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${CPU_CNT_MAIN} -| | | ${skip_cnt}= | Evaluate | ${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN} -| | | ${cpu_wt}= | Run Keyword If | ${cpu_count_int} > 0 | -| | | ... | Cpu list per node str | ${nodes['${dut}']} | ${numa} -| | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${cpu_count_int} -| | | ... | smt_used=${smt_used} -| | | ${thr_count_int}= | Run Keyword If | ${smt_used} -| | | ... | Evaluate | int(${cpu_count_int}*2) -| | | ... | ELSE | Set variable | ${thr_count_int} -| | | ${rxq_count_int}= | Run Keyword If | ${rx_queues} -| | | ... | Set variable | ${rx_queues} -| | | ... | ELSE | Evaluate | int(${thr_count_int}/2) -| | | ${rxq_count_int}= | Run Keyword If | ${rxq_count_int} == 0 -| | | ... | Set variable | ${1} -| | | ... | ELSE | Set variable | ${rxq_count_int} +| | | &{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 If | ${cpu_count_int} > 0 | | | ... | ${dut}.Add CPU Corelist Workers | ${cpu_wt} -| | | Run Keyword If | ${smt_used} -| | | ... | Run Keyword | ${dut}.Add Buffers Per Numa | ${215040} | ELSE -| | | ... | Run Keyword | ${dut}.Add Buffers Per Numa | ${107520} -| | | Run Keyword If | ${thr_count_int} > 1 -| | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD -| | | Set Tags | ${thr_count_int}T${cpu_count_int}C +| | | Run Keyword | ${dut}.Add Buffers Per Numa | ${buffers_numa} +| | END + +| Create compute resources variables +| | [Documentation] +| | ... | Create compute resources variables +| | +| | ... | _NOTE:_ This KW sets various suite variables based on computed +| | ... | resources. +| | +| | ${variables}= | Get Dictionary Keys | ${compute_resource_info} +| | FOR | ${variable} | IN | @{variables} +| | | ${value}= | Get From Dictionary | ${compute_resource_info} | ${variable} +| | | Set Test Variable | ${${variable}} | ${value} | | END -| | ${cpu_alloc_str}= | Catenate | SEPARATOR=, | ${cpu_alloc_str} | ${cpu_main} -| | ${cpu_alloc_str}= | Catenate | SEPARATOR=, | ${cpu_alloc_str} | ${cpu_wt} -| | Set Test Variable | ${smt_used} -| | Set Test Variable | ${cpu_alloc_str} -| | Set Test Variable | ${cpu_count_int} -| | Set Test Variable | ${thr_count_int} -| | Set Test Variable | ${rxd_count_int} -| | Set Test Variable | ${txd_count_int} -| | Set Test Variable | ${rxq_count_int} +| | Run Keyword If | ${dp_count_int} > 1 +| | ... | 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]