Python3: resources and libraries
[csit.git] / resources / libraries / robot / shared / vm.robot
1 # Copyright (c) 2019 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Documentation | Keywords related to vm lifecycle management
16 ...
17 | Library | resources.libraries.python.InterfaceUtil
18
19 *** Keywords ***
20 | Configure chains of NFs connected via vhost-user
21 | | [Documentation]
22 | | ... | Start 1..N chains of 1..N QEMU guests (VNFs) with two vhost-user\
23 | | ... | interfaces and interconnecting NF.
24 | |
25 | | ... | *Arguments:*
26 | | ... | - nf_chains - Number of chains of NFs. Type: integer
27 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
28 | | ... | - jumbo - Jumbo frames are used (True) or are not used (False)
29 | | ... | in the test. Type: boolean
30 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: integer
31 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
32 | | ... | Type: boolean
33 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
34 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
35 | | ... | - vnf - Network function as a payload. Type: string
36 | | ... | - pinning - Whether to pin QEMU VMs to specific cores
37 | |
38 | | ... | *Example:*
39 | |
40 | | ... | \| Configure chains of VMs connected via vhost-user
41 | | ... | \| 1 \| 1 \| False \| 1024 \| False \| False \| vpp \| True \|
42 | |
43 | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | ${jumbo}=${False}
44 | | ... | ${perf_qemu_qsz}=${1024} | ${use_tuned_cfs}=${False}
45 | | ... | ${auto_scale}=${True} | ${vnf}=vpp | ${pinning}=${True}
46 | |
47 | | Import Library | resources.libraries.python.QemuManager | ${nodes}
48 | | ... | WITH NAME | vnf_manager
49 | | Run Keyword | vnf_manager.Construct VMs on all nodes
50 | | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} | jumbo=${jumbo}
51 | | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${use_tuned_cfs}
52 | | ... | auto_scale=${auto_scale} | vnf=${vnf}
53 | | ... | tg_if1_mac=${tg_if1_mac} | tg_if2_mac=${tg_if2_mac}
54 | | ... | vs_dtc=${cpu_count_int} | nf_dtc=${nf_dtc} | nf_dtcr=${nf_dtcr}
55 | | ... | rxq_count_int=${rxq_count_int}
56 | | Run Keyword | vnf_manager.Start All VMs | pinning=${pinning}
57 | | All VPP Interfaces Ready Wait | ${nodes} | retries=${300}
58 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=Virtual
59
60 | Configure chains of NFs connected via vhost-user on single node
61 | | [Documentation]
62 | | ... | Start 1..N chains of 1..N QEMU guests (VNFs) with two vhost-user\
63 | | ... | interfaces and interconnecting NF on single DUT node.
64 | |
65 | | ... | *Arguments:*
66 | | ... | - node - DUT node. Type: dictionary
67 | | ... | - nf_chains - Number of chains of NFs. Type: integer
68 | | ... | - nf_nodes - Number of NFs nodes per chain. Type: integer
69 | | ... | - jumbo - Jumbo frames are used (True) or are not used (False)
70 | | ... | in the test. Type: boolean
71 | | ... | - perf_qemu_qsz - Virtio Queue Size. Type: integer
72 | | ... | - use_tuned_cfs - Set True if CFS RR should be used for Qemu SMP.
73 | | ... | Type: boolean
74 | | ... | - auto_scale - Whether to use same amount of RXQs for memif interface
75 | | ... | in containers as vswitch, otherwise use single RXQ. Type: boolean
76 | | ... | - vnf - Network function as a payload. Type: string
77 | | ... | - pinning - Whether to pin QEMU VMs to specific cores
78 | |
79 | | ... | *Example:*
80 | |
81 | | ... | \| Configure chains of NFs connected via vhost-user on single node
82 | | ... | \| DUT1 \| 1 \| 1 \| False \| 1024 \| False \| False \| vpp \|
83 | | ... | True \|
84 | |
85 | | [Arguments] | ${node} | ${nf_chains}=${1} | ${nf_nodes}=${1}
86 | | ... | ${jumbo}=${False} | ${perf_qemu_qsz}=${1024}
87 | | ... | ${use_tuned_cfs}=${False} | ${auto_scale}=${True} | ${vnf}=vpp
88 | | ... | ${pinning}=${True}
89 | |
90 | | Import Library | resources.libraries.python.QemuManager | ${nodes}
91 | | ... | WITH NAME | vnf_manager
92 | | Run Keyword | vnf_manager.Initialize
93 | | Run Keyword | vnf_manager.Construct VMs on node
94 | | ... | node=${node}
95 | | ... | nf_chains=${nf_chains} | nf_nodes=${nf_nodes} | jumbo=${jumbo}
96 | | ... | perf_qemu_qsz=${perf_qemu_qsz} | use_tuned_cfs=${use_tuned_cfs}
97 | | ... | auto_scale=${auto_scale} | vnf=${vnf}
98 | | ... | tg_if1_mac=${tg_if1_mac} | tg_if2_mac=${tg_if2_mac}
99 | | ... | vs_dtc=${cpu_count_int} | nf_dtc=${nf_dtc} | nf_dtcr=${nf_dtcr}
100 | | ... | rxq_count_int=${rxq_count_int}
101 | | Run Keyword | vnf_manager.Start All VMs | pinning=${pinning}
102 | | All VPP Interfaces Ready Wait | ${nodes} | retries=${300}
103 | | VPP round robin RX placement on all DUTs | ${nodes} | prefix=Virtual