aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/robot/shared
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/robot/shared')
-rw-r--r--resources/libraries/robot/shared/default.robot2
-rw-r--r--resources/libraries/robot/shared/qemu.robot51
-rw-r--r--resources/libraries/robot/shared/test_teardown.robot4
-rw-r--r--resources/libraries/robot/shared/vm.robot103
4 files changed, 105 insertions, 55 deletions
diff --git a/resources/libraries/robot/shared/default.robot b/resources/libraries/robot/shared/default.robot
index a25919d9d6..89609f563b 100644
--- a/resources/libraries/robot/shared/default.robot
+++ b/resources/libraries/robot/shared/default.robot
@@ -42,12 +42,12 @@
| Resource | resources/libraries/robot/performance/performance_utils.robot
| Resource | resources/libraries/robot/shared/container.robot
| Resource | resources/libraries/robot/features/policer.robot
-| Resource | resources/libraries/robot/shared/qemu.robot
| Resource | resources/libraries/robot/shared/suite_teardown.robot
| Resource | resources/libraries/robot/shared/suite_setup.robot
| Resource | resources/libraries/robot/shared/test_teardown.robot
| Resource | resources/libraries/robot/shared/test_setup.robot
| Resource | resources/libraries/robot/shared/traffic.robot
+| Resource | resources/libraries/robot/shared/vm.robot
*** Keywords ***
| Show Vpp Errors On All DUTs
diff --git a/resources/libraries/robot/shared/qemu.robot b/resources/libraries/robot/shared/qemu.robot
deleted file mode 100644
index 1178fa93b4..0000000000
--- a/resources/libraries/robot/shared/qemu.robot
+++ /dev/null
@@ -1,51 +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.L2Util
-| Library | resources.libraries.python.InterfaceUtil
-
-*** Keywords ***
-| Configure VM for vhost L2BD forwarding
-| | [Documentation] | Setup QEMU and start VM with two vhost interfaces.
-| | ...
-| | ... | *Arguments:*
-| | ... | - ${dut_node} - DUT node to start VM on. Type: dictionary
-| | ... | - ${sock1} - Socket path for first Vhost-User interface. Type: string
-| | ... | - ${sock2} - Socket path for second Vhost-User interface. Type: string
-| | ... | - ${qemu_name} - Qemu instance name by which the object will be
-| | ... | accessed (Optional). Type: string
-| | ...
-| | ... | _NOTE:_ This KW sets following test case variable:
-| | ... | - ${${qemu_name}} - VM node info. Type: dictionary
-| | ...
-| | ... | *Example:*
-| | ...
-| | ... | \| Configure VM for vhost L2BD forwarding \| ${nodes['DUT1']} \
-| | ... | \| /tmp/sock1 \| /tmp/sock2 \|
-| | ... | \| Configure VM for vhost L2BD forwarding \| ${nodes['DUT2']} \
-| | ... | \| /tmp/sock1 \| /tmp/sock2 \| qemu_instance_2 \|
-| | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${qemu_name}=vm_node
-| | Import Library | resources.libraries.python.QemuUtils | node=${dut_node} |
-| | ... | WITH NAME | ${qemu_name}
-| | Set Test Variable | ${${qemu_name}} | ${None}
-| | Run Keyword | ${qemu_name}.Qemu Add Vhost User If | ${sock1}
-| | Run Keyword | ${qemu_name}.Qemu Add Vhost User If | ${sock2}
-| | ${vm}= | Run keyword | ${qemu_name}.Qemu Start
-| | ${br}= | Set Variable | br0
-| | ${vhost1}= | Get Vhost User If Name By Sock | ${vm} | ${sock1}
-| | ${vhost2}= | Get Vhost User If Name By Sock | ${vm} | ${sock2}
-| | Linux Add Bridge | ${vm} | ${br} | ${vhost1} | ${vhost2}
-| | Set Interface State | ${vm} | ${vhost1} | up | if_type=name
-| | Set Interface State | ${vm} | ${vhost2} | up | if_type=name
-| | Set Interface State | ${vm} | ${br} | up | if_type=name
-| | Set Test Variable | ${${qemu_name}} | ${vm}
diff --git a/resources/libraries/robot/shared/test_teardown.robot b/resources/libraries/robot/shared/test_teardown.robot
index cec0655e19..cad3c620e0 100644
--- a/resources/libraries/robot/shared/test_teardown.robot
+++ b/resources/libraries/robot/shared/test_teardown.robot
@@ -15,7 +15,6 @@
*** Settings ***
| Resource | resources/libraries/robot/shared/container.robot
-| Resource | resources/libraries/robot/shared/qemu.robot
| Library | resources.libraries.python.PapiHistory
| Library | resources.libraries.python.topology.Topology
| ...
@@ -66,8 +65,7 @@
| | ... | Additional teardown for tests which uses vhost(s) and VM(s).
| | ...
| | Show VPP vhost on all DUTs | ${nodes}
-| | Run Keyword If | "PERFTEST" in @{TEST TAGS} | vnf_manager.Kill All VMs
-| | Run Keyword If | "DEVICETEST" in @{TEST TAGS} | vm_node.Qemu Kill
+| | vnf_manager.Kill All VMs
| Additional Test Tear Down Action For nat
| | [Documentation]
diff --git a/resources/libraries/robot/shared/vm.robot b/resources/libraries/robot/shared/vm.robot
new file mode 100644
index 0000000000..c6e5373c8b
--- /dev/null
+++ b/resources/libraries/robot/shared/vm.robot
@@ -0,0 +1,103 @@
+# 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 ***
+| Documentation | Keywords related to vm lifecycle management
+...
+| Library | resources.libraries.python.InterfaceUtil
+
+*** Keywords ***
+| Configure chains of NFs connected via vhost-user
+| | [Documentation]
+| | ... | Start 1..N chains of 1..N QEMU guests (VNFs) with two vhost-user\
+| | ... | interfaces and interconnecting NF.
+| | ...
+| | ... | *Arguments:*
+| | ... | - nf_chains - Number of chains of NFs. Type: integer
+| | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
+| | ... | - jumbo - Jumbo frames are used (True) or are not used (False)
+| | ... | in the test. Type: boolean
+| | ... | - perf_qemu_qsz - Virtio Queue Size. Type: integer
+| | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
+| | ... | Type: boolean
+| | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
+| | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
+| | ... | - vnf - Network function as a payload. Type: string
+| | ... | - pinning - Whether to pin QEMU VMs to specific cores
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Configure chains of VMs connected via vhost-user
+| | ... | \| 1 \| 1 \| False \| 1024 \| False \| False \| vpp \| True \|
+| | ...
+| | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${jumbo}=${False}
+| | ... | ${perf_qemu_qsz}=${1024} | ${use_tuned_cfs}=${False}
+| | ... | ${auto_scale}=${True} | ${vnf}=vpp | ${pinning}=${True}
+| | ...
+| | Import Library | resources.libraries.python.QemuManager | ${nodes}
+| | ... | WITH NAME | vnf_manager
+| | Run Keyword | vnf_manager.Construct VMs on all nodes
+| | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} | jumbo=${jumbo}
+| | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${use_tuned_cfs}
+| | ... | auto_scale=${auto_scale} | vnf=${vnf}
+| | ... | tg_if1_mac=${tg_if1_mac} | tg_if2_mac=${tg_if2_mac}
+| | ... | vs_dtc=${cpu_count_int} | nf_dtc=${nf_dtc} | nf_dtcr=${nf_dtcr}
+| | ... | rxq_count_int=${rxq_count_int}
+| | Run Keyword | vnf_manager.Start All VMs | pinning=${pinning}
+| | All VPP Interfaces Ready Wait | ${nodes} | retries=${300}
+| | VPP round robin RX placement on all DUTs | ${nodes} | prefix=Virtual
+
+| Configure chains of NFs connected via vhost-user on single node
+| | [Documentation]
+| | ... | Start 1..N chains of 1..N QEMU guests (VNFs) with two vhost-user\
+| | ... | interfaces and interconnecting NF on single DUT node.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - DUT node. Type: dictionary
+| | ... | - nf_chains - Number of chains of NFs. Type: integer
+| | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
+| | ... | - jumbo - Jumbo frames are used (True) or are not used (False)
+| | ... | in the test. Type: boolean
+| | ... | - perf_qemu_qsz - Virtio Queue Size. Type: integer
+| | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
+| | ... | Type: boolean
+| | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
+| | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
+| | ... | - vnf - Network function as a payload. Type: string
+| | ... | - pinning - Whether to pin QEMU VMs to specific cores
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| Configure chains of NFs connected via vhost-user on single node
+| | ... | \| DUT1 \| 1 \| 1 \| False \| 1024 \| False \| False \| vpp \|
+| | ... | True \|
+| | ...
+| | [Arguments] | ${node} | ${nf_chains}=${1} | ${nf_nodes}=${1}
+| | ... | ${jumbo}=${False} | ${perf_qemu_qsz}=${1024}
+| | ... | ${use_tuned_cfs}=${False} | ${auto_scale}=${True} | ${vnf}=vpp
+| | ... | ${pinning}=${True}
+| | ...
+| | Import Library | resources.libraries.python.QemuManager | ${nodes}
+| | ... | WITH NAME | vnf_manager
+| | Run Keyword | vnf_manager.Initialize
+| | Run Keyword | vnf_manager.Construct VMs on node
+| | ... | node=${node}
+| | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} | jumbo=${jumbo}
+| | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${use_tuned_cfs}
+| | ... | auto_scale=${auto_scale} | vnf=${vnf}
+| | ... | tg_if1_mac=${tg_if1_mac} | tg_if2_mac=${tg_if2_mac}
+| | ... | vs_dtc=${cpu_count_int} | nf_dtc=${nf_dtc} | nf_dtcr=${nf_dtcr}
+| | ... | rxq_count_int=${rxq_count_int}
+| | Run Keyword | vnf_manager.Start All VMs | pinning=${pinning}
+| | All VPP Interfaces Ready Wait | ${nodes} | retries=${300}
+| | VPP round robin RX placement on all DUTs | ${nodes} | prefix=Virtual