aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/robot
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/robot')
-rw-r--r--resources/libraries/robot/performance/performance_utils.robot7
-rw-r--r--resources/libraries/robot/shared/container.robot149
-rw-r--r--resources/libraries/robot/shared/counters.robot26
-rw-r--r--resources/libraries/robot/shared/default.robot11
-rw-r--r--resources/libraries/robot/shared/test_teardown.robot1
-rw-r--r--resources/libraries/robot/shared/traffic.robot2
6 files changed, 115 insertions, 81 deletions
diff --git a/resources/libraries/robot/performance/performance_utils.robot b/resources/libraries/robot/performance/performance_utils.robot
index bffd35d05e..8ac7155605 100644
--- a/resources/libraries/robot/performance/performance_utils.robot
+++ b/resources/libraries/robot/performance/performance_utils.robot
@@ -441,7 +441,8 @@
| | Clear and show runtime counters with running traffic | ${trial_duration}
| | ... | ${rate} | ${frame_size} | ${traffic_profile}
| | ... | ${unidirection} | ${tx_port} | ${rx_port}
-| | Run Keyword If | ${dut_stats}==${True} | Clear all counters on all DUTs
+| | Run Keyword If | ${dut_stats}==${True}
+| | ... | Clear statistics on all DUTs | ${nodes}
| | Run Keyword If | ${dut_stats}==${True} and ${pkt_trace}==${True}
| | ... | VPP Enable Traces On All DUTs | ${nodes} | fail_on_error=${False}
| | Run Keyword If | ${dut_stats}==${True}
@@ -493,10 +494,10 @@
| | ... | warmup_time=${0} | async_call=${True} | latency=${False}
| | ... | unidirection=${unidirection} | tx_port=${tx_port} | rx_port=${rx_port}
| | Run Keyword If | ${dut_stats}==${True}
-| | ... | Clear runtime counters on all DUTs | ${nodes}
+| | ... | VPP clear runtime counters on all DUTs | ${nodes}
| | Sleep | ${duration}
| | Run Keyword If | ${dut_stats}==${True}
-| | ... | Show runtime counters on all DUTs | ${nodes}
+| | ... | VPP show runtime counters on all DUTs | ${nodes}
| | Stop traffic on tg
| Start Traffic on Background
diff --git a/resources/libraries/robot/shared/container.robot b/resources/libraries/robot/shared/container.robot
index cb3bc29490..f440768df5 100644
--- a/resources/libraries/robot/shared/container.robot
+++ b/resources/libraries/robot/shared/container.robot
@@ -42,6 +42,38 @@
| | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${nf_chain}=${1}
| | ... | ${nf_node}=${1} | ${auto_scale}=${True} | ${pinning}=${True}
| | ...
+| | ${duts}= | Get Matches | ${nodes} | DUT*
+| | :FOR | ${dut} | IN | @{duts}
+| | | Run Keyword | Construct container on DUT | ${dut}
+| | | ... | ${nf_chains} | ${nf_nodes} | ${nf_chain}
+| | | ... | ${nf_node} | ${auto_scale} | ${pinning}
+
+| Construct container on DUT
+| | [Documentation] | Construct 1 CNF of specific technology on specific DUT.
+| | ...
+| | ... | *Arguments:*
+| | ... | - dut: DUT node to construct the CNF on. Type: string
+| | ... | - nf_chains: Total number of chains (Optional). Type: integer, default
+| | ... | value: ${1}
+| | ... | - nf_nodes: Total number of nodes per chain (Optional). Type: integer,
+| | ... | default value: ${1}
+| | ... | - nf_chain: Chain ID (Optional). Type: integer, default value: ${1}
+| | ... | - nf_node: Node ID (Optional). Type: integer, default value: ${1}
+| | ... | - auto_scale - If True, use same amount of Dataplane threads for
+| | ... | network function as DUT, otherwise use single physical core for
+| | ... | every network function. Type: boolean
+| | ... | - pinning: Set True if CPU pinning should be done on starting
+| | ... | containers. Type: boolean, default value: ${False}
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Construct container on DUT \| DUT1 \| 1 \| 1 \| 1 \| 1 \|
+| | ... | \| ${True} \|
+| | ...
+| | [Arguments] | ${dut}
+| | ... | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${nf_chain}=${1}
+| | ... | ${nf_node}=${1} | ${auto_scale}=${True} | ${pinning}=${True}
+| | ...
| | ${nf_dtcr_status} | ${value}= | Run Keyword And Ignore Error
| | ... | Variable Should Exist | ${nf_dtcr}
| | ${nf_dtcr}= | Run Keyword If | '${nf_dtcr_status}' == 'PASS'
@@ -49,39 +81,41 @@
| | ${nf_dtc}= | Run Keyword If | ${pinning}
| | ... | Set Variable If | ${auto_scale} | ${cpu_count_int}
| | ... | ${nf_dtc}
-| | ${duts}= | Get Matches | ${nodes} | DUT*
-| | :FOR | ${dut} | IN | @{duts}
-| | | ${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}
-| | | ... | ELSE | Set Variable | ${EMPTY}
-| | | ${node_arch}= | Get Node Arch | ${nodes['${dut}']}
-| | | ${mnt}= | Create List
-| | | ... | ${root}/tmp/:/mnt/host/
-| | | ... | ${root}/dev/vfio/:/dev/vfio/
-| | | ... | ${root}/usr/bin/vpp:/usr/bin/vpp
-| | | ... | ${root}/usr/bin/vppctl:/usr/bin/vppctl
-| | | ... | ${root}/usr/lib/${node_arch}-linux-gnu/:/usr/lib/${node_arch}-linux-gnu/
-| | | ... | ${root}/usr/share/vpp/:/usr/share/vpp/
-| | | ${nf_cpus}= | Set Variable | ${None}
-| | | ${nf_cpus}= | Run Keyword If | ${pinning}
-| | | ... | Get Affinity NF | ${nodes} | ${dut}
-| | | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes}
-| | | ... | nf_chain=${nf_chain} | nf_node=${nf_node}
-| | | ... | vs_dtc=${cpu_count_int} | nf_dtc=${nf_dtc} | nf_dtcr=${nf_dtcr}
-| | | &{cont_args}= | Create Dictionary
-| | | ... | name=${dut}_${container_group}${nf_id}${DUT1_UUID}
-| | | ... | node=${nodes['${dut}']} | mnt=${mnt} | env=${env}
-| | | Run Keyword If | ${pinning}
-| | | ... | Set To Dictionary | ${cont_args} | cpuset_cpus=${nf_cpus}
-| | | Run Keyword | ${container_group}.Construct container | &{cont_args}
+| | ${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}
+| | ... | ELSE | Set Variable | ${EMPTY}
+| | ${node_arch}= | Get Node Arch | ${nodes['${dut}']}
+| | ${name}= | Set Variable | ${dut}_${container_group}${nf_id}${DUT1_UUID}
+| | ${mnt}= | Create List
+| | ... | ${root}/tmp/:/mnt/host/
+| | ... | ${root}/tmp/vpp_sockets/${name}/:/run/vpp/
+| | ... | ${root}/dev/vfio/:/dev/vfio/
+| | ... | ${root}/usr/bin/vpp:/usr/bin/vpp
+| | ... | ${root}/usr/bin/vppctl:/usr/bin/vppctl
+| | ... | ${root}/usr/lib/${node_arch}-linux-gnu/:/usr/lib/${node_arch}-linux-gnu/
+| | ... | ${root}/usr/share/vpp/:/usr/share/vpp/
+| | ${nf_cpus}= | Set Variable | ${None}
+| | ${nf_cpus}= | Run Keyword If | ${pinning}
+| | ... | Get Affinity NF | ${nodes} | ${dut}
+| | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes}
+| | ... | nf_chain=${nf_chain} | nf_node=${nf_node}
+| | ... | 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}
+| | Run Keyword If | ${pinning}
+| | ... | Set To Dictionary | ${cont_args} | cpuset_cpus=${nf_cpus}
+| | Run Keyword | ${container_group}.Construct container | &{cont_args}
-| Construct chain of containers on all DUTs
-| | [Documentation] | Construct 1 chain of 1..N CNFs on all DUT nodes.
+| Construct chain of containers
+| | [Documentation] | Construct 1 chain of 1..N CNFs on selected/all DUT nodes.
| | ...
| | ... | *Arguments:*
+| | ... | - dut: DUT node to start the containers on. Run on all nodes if None.
+| | ... | Type: string or None
| | ... | - nf_chains: Total number of chains. Type: integer
| | ... | - nf_nodes: Total number of nodes per chain. Type: integer
| | ... | - nf_chain: Chain ID. Type: integer
@@ -93,21 +127,28 @@
| | ...
| | ... | *Example:*
| | ...
-| | ... | \| Construct chain of containers on all DUTs \| 1 \| 1 \| 1 \
-| | ... | \| ${True} \|
+| | ... | \| Construct chain of containers \| 1 \| 1 \| 1 \| ${True} \|
| | ...
-| | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${nf_chain}=${1}
-| | ... | ${auto_scale}=${True} | ${pinning}=${True}
+| | [Arguments] | ${dut}=${None} | ${nf_chains}=${1} | ${nf_nodes}=${1}
+| | ... | ${nf_chain}=${1} | ${auto_scale}=${True} | ${pinning}=${True}
| | ...
| | :FOR | ${nf_node} | IN RANGE | 1 | ${nf_nodes}+1
-| | | Construct container on all DUTs | nf_chains=${nf_chains}
-| | | ... | nf_nodes=${nf_nodes} | nf_chain=${nf_chain} | nf_node=${nf_node}
-| | | ... | auto_scale=${auto_scale} | pinning=${pinning}
+| | | Run Keyword If | '${dut}' == '${None}'
+| | | ... | Construct container on all DUTs
+| | | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} | nf_chain=${nf_chain}
+| | | ... | nf_node=${nf_node} | auto_scale=${auto_scale} | pinning=${pinning}
+| | | ... | ELSE
+| | | ... | Construct container on DUT | ${dut}
+| | | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} | nf_chain=${nf_chain}
+| | | ... | nf_node=${nf_node} | auto_scale=${auto_scale} | pinning=${pinning}
-| Construct chains of containers on all DUTs
-| | [Documentation] | Construct 1..N chains of 1..N CNFs on all DUT nodes.
+| Construct chains of containers
+| | [Documentation] | Construct 1..N chains of 1..N CNFs on selected/all DUT
+| | ... | nodes.
| | ...
| | ... | *Arguments:*
+| | ... | - dut: DUT node to start the containers on. Run on all nodes if None.
+| | ... | Type: string or None
| | ... | - nf_chains: Total number of chains (Optional). Type: integer, default
| | ... | value: ${1}
| | ... | - nf_nodes: Total number of nodes per chain (Optional). Type: integer,
@@ -120,15 +161,15 @@
| | ...
| | ... | *Example:*
| | ...
-| | ... | \| Construct chains of containers on all DUTs \| 1 \| 1 \|
+| | ... | \| Construct chains of containers \| 1 \| 1 \|
| | ...
-| | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
-| | ... | ${pinning}=${True}
+| | [Arguments] | ${dut}=${None} | ${nf_chains}=${1} | ${nf_nodes}=${1}
+| | ... | ${auto_scale}=${True} | ${pinning}=${True}
| | ...
| | :FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains}+1
-| | | Construct chain of containers on all DUTs | nf_chains=${nf_chains}
-| | | ... | nf_nodes=${nf_nodes} | nf_chain=${nf_chain}
-| | | ... | auto_scale=${auto_scale} | pinning=${pinning}
+| | | Construct chain of containers
+| | | ... | dut=${dut} | nf_chains=${nf_chains} | nf_nodes=${nf_nodes}
+| | | ... | nf_chain=${nf_chain} | auto_scale=${auto_scale} | pinning=${pinning}
| Acquire all '${group}' containers
| | [Documentation] | Acquire all container(s) in specific container group on
@@ -158,12 +199,21 @@
| | [Documentation] | Configure VPP on all container(s) in specific container
| | ... | group on all DUT nodes.
| | ...
+| | ... | *Test (or broader scope) variables read:*
+| | ... | - container_chain_topology - Topology type used for configuring CNF
+| | ... | (VPP) in container. Type: string
+| | ...
| | ${dut1_if2} = | Get Variable Value | \${dut1_if2} | ${None}
| | ${dut2_if2} = | Get Variable Value | \${dut2_if2} | ${None}
| | Run Keyword If | '${container_chain_topology}' == 'chain_ip4'
| | ... | ${group}.Configure VPP In All Containers | ${container_chain_topology}
| | ... | tg_if1_mac=${tg_if1_mac} | tg_if2_mac=${tg_if2_mac}
| | ... | nodes=${nf_nodes}
+| | ... | ELSE IF | '${container_chain_topology}' == 'chain_ipsec'
+| | ... | ${group}.Configure VPP In All Containers | ${container_chain_topology}
+| | ... | tg_if2_ip4=${tg_if2_ip4} | tg_if2_mac=${tg_if2_mac}
+| | ... | dut2_if1_ip4=${dut2_if1_ip4} | dut2_if2_ip4=${dut2_if2_ip4}
+| | ... | raddr_ip4=${raddr_ip4} | nodes=${nodes} | nf_nodes=${nf_nodes}
| | ... | ELSE IF | '${container_chain_topology}' == 'pipeline_ip4'
| | ... | ${group}.Configure VPP In All Containers | ${container_chain_topology}
| | ... | tg_if1_mac=${tg_if1_mac} | tg_if2_mac=${tg_if2_mac}
@@ -191,6 +241,8 @@
| | ... | Start containers for test.
| | ...
| | ... | *Arguments:*
+| | ... | - dut: DUT node to start the containers on. Run on all nodes if None.
+| | ... | Type: string or None
| | ... | - nf_chains: Total number of chains. Type: integer
| | ... | - nf_nodes: Total number of nodes per chain. Type: integer
| | ... | - auto_scale - If True, use same amount of Dataplane threads for
@@ -203,15 +255,16 @@
| | ...
| | ... | \| Start containers for test \| 1 \| 1 \|
| | ...
-| | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${auto_scale}=${True}
-| | ... | ${pinning}=${True}
+| | [Arguments] | ${dut}=${None} | ${nf_chains}=${1} | ${nf_nodes}=${1}
+| | ... | ${auto_scale}=${True} | ${pinning}=${True}
| | ...
| | Set Test Variable | @{container_groups} | @{EMPTY}
| | Set Test Variable | ${container_group} | CNF
| | Set Test Variable | ${nf_nodes}
| | Import Library | resources.libraries.python.ContainerUtils.ContainerManager
| | ... | engine=${container_engine} | WITH NAME | ${container_group}
-| | Construct chains of containers on all DUTs | ${nf_chains} | ${nf_nodes}
+| | Construct chains of containers
+| | ... | dut=${dut} | nf_chains=${nf_chains} | nf_nodes=${nf_nodes}
| | ... | auto_scale=${auto_scale} | pinning=${pinning}
| | Acquire all '${container_group}' containers
| | Create all '${container_group}' containers
diff --git a/resources/libraries/robot/shared/counters.robot b/resources/libraries/robot/shared/counters.robot
deleted file mode 100644
index 2746a1abc9..0000000000
--- a/resources/libraries/robot/shared/counters.robot
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (c) 2019 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.VppCounters
-| ...
-| Documentation | VPP counters keywords
-
-*** Keywords ***
-| Clear all counters on all DUTs
-| | [Documentation] | Clear runtime, interface, hardware and error counters
-| | ... | on all DUTs with VPP instance
-| | Clear runtime counters on all DUTs | ${nodes}
-| | Clear interface counters on all DUTs | ${nodes}
-| | Clear hardware counters on all DUTs | ${nodes}
-| | Clear error counters on all DUTs | ${nodes}
diff --git a/resources/libraries/robot/shared/default.robot b/resources/libraries/robot/shared/default.robot
index fd7ceebbb7..3da2026ba6 100644
--- a/resources/libraries/robot/shared/default.robot
+++ b/resources/libraries/robot/shared/default.robot
@@ -52,7 +52,6 @@
| Resource | resources/libraries/robot/performance/performance_configuration.robot
| Resource | resources/libraries/robot/performance/performance_limits.robot
| Resource | resources/libraries/robot/performance/performance_utils.robot
-| Resource | resources/libraries/robot/shared/counters.robot
| Resource | resources/libraries/robot/shared/interfaces.robot
| Resource | resources/libraries/robot/shared/container.robot
| Resource | resources/libraries/robot/shared/memif.robot
@@ -114,7 +113,7 @@
| | | Run keyword | ${dut}.Add Unix CLI Listen
| | | Run keyword | ${dut}.Add Unix Nodaemon
| | | Run keyword | ${dut}.Add Unix Coredump
-| | | Run keyword | ${dut}.Add Socksvr
+| | | Run keyword | ${dut}.Add Socksvr | ${SOCKSVR_PATH}
| | | Run keyword | ${dut}.Add DPDK No Tx Checksum Offload
| | | Run keyword | ${dut}.Add DPDK Log Level | debug
| | | Run keyword | ${dut}.Add DPDK Uio Driver
@@ -489,6 +488,8 @@
| | ...
| | :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}
| | Save VPP PIDs
| | Enable Coredump Limit VPP on All DUTs | ${nodes}
| | Update All Interface Data On All Nodes | ${nodes} | skip_tg=${True}
@@ -532,6 +533,10 @@
| | All TGs Set Interface Default Driver | ${nodes}
| | Update All Interface Data On All Nodes | ${nodes}
| | Reset PAPI History On All DUTs | ${nodes}
+| | ${duts}= | Get Matches | ${nodes} | DUT*
+| | :FOR | ${dut} | IN | @{duts}
+| | | Add New Socket | ${nodes['${dut}']} | PAPI | ${dut} | ${SOCKSVR_PATH}
+| | | Add New Socket | ${nodes['${dut}']} | STATS | ${dut} | ${SOCKSTAT_PATH}
| Tear down functional test
| | [Documentation] | Common test teardown for functional tests.
@@ -541,6 +546,7 @@
| | Show PAPI History On All DUTs | ${nodes}
| | Vpp Show Errors On All DUTs | ${nodes}
| | Verify VPP PID in Teardown
+| | Clean Sockets On All Nodes | ${nodes}
| Tear down LISP functional test
| | [Documentation] | Common test teardown for functional tests with LISP.
@@ -552,3 +558,4 @@
| | Show Vpp Settings | ${nodes['DUT2']}
| | Vpp Show Errors On All DUTs | ${nodes}
| | Verify VPP PID in Teardown
+| | Clean Sockets On All Nodes | ${nodes}
diff --git a/resources/libraries/robot/shared/test_teardown.robot b/resources/libraries/robot/shared/test_teardown.robot
index 5d2c2fa165..8ba914b946 100644
--- a/resources/libraries/robot/shared/test_teardown.robot
+++ b/resources/libraries/robot/shared/test_teardown.robot
@@ -39,6 +39,7 @@
| | ... | Verify VPP PID in Teardown
| | :FOR | ${action} | IN | @{actions}
| | | Run Keyword | Additional Test Tear Down Action For ${action}
+| | Clean Sockets On All Nodes | ${nodes}
| Additional Test Tear Down Action For performance
| | [Documentation]
diff --git a/resources/libraries/robot/shared/traffic.robot b/resources/libraries/robot/shared/traffic.robot
index 9a0728a967..dc3cc054b2 100644
--- a/resources/libraries/robot/shared/traffic.robot
+++ b/resources/libraries/robot/shared/traffic.robot
@@ -21,8 +21,6 @@
| Library | resources.libraries.python.topology.Topology
| Library | resources.libraries.python.TrafficScriptExecutor
| ...
-| Resource | resources/libraries/robot/shared/counters.robot
-| ...
| Documentation | Traffic keywords
*** Keywords ***