8602f705ef32aeee585a9a761d12b20e68bf96a8
[csit.git] / resources / libraries / robot / default.robot
1 # Copyright (c) 2016 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 | Variables | resources/libraries/python/topology.py
16 | Library | resources.libraries.python.topology.Topology
17 | Library | resources.libraries.python.CpuUtils
18 | Library | resources.libraries.python.DUTSetup
19 | Library | resources.libraries.python.TGSetup
20 | Library | resources/libraries/python/VppConfigGenerator.py
21 | Library | resources/libraries/python/VppCounters.py
22 | Library | Collections
23
24 *** Keywords ***
25 | Setup all DUTs before test
26 | | [Documentation] | Setup all DUTs in topology before test execution
27 | | Setup All DUTs | ${nodes}
28
29 | Setup all TGs before traffic script
30 | | [Documentation] | Prepare all TGs before traffic scripts execution
31 | | All TGs Set Interface Default Driver | ${nodes}
32
33 | Show vpp version on all DUTs
34 | | [Documentation] | Show VPP version verbose on all DUTs
35 | | ${duts}= | Get Matches | ${nodes} | DUT*
36 | | :FOR | ${dut} | IN | @{duts}
37 | | | Vpp show version verbose | ${nodes['${dut}']}
38
39 | Show Vpp Errors on All DUTs
40 | | [Documentation] | Show VPP errors verbose on all DUTs
41 | | ${duts}= | Get Matches | ${nodes} | DUT*
42 | | :FOR | ${dut} | IN | @{duts}
43 | | | Vpp Show Errors | ${nodes['${dut}']}
44
45 | Show vpp trace dump on all DUTs
46 | | [Documentation] | Save API trace and dump output on all DUTs
47 | | ${duts}= | Get Matches | ${nodes} | DUT*
48 | | :FOR | ${dut} | IN | @{duts}
49 | | | Vpp api trace save | ${nodes['${dut}']}
50 | | | Vpp api trace dump | ${nodes['${dut}']}
51
52 | Show Vpp Vhost On All DUTs
53 | | [Documentation] | Show Vhost User on all DUTs
54 | | ${duts}= | Get Matches | ${nodes} | DUT*
55 | | :FOR | ${dut} | IN | @{duts}
56 | | | Vpp Show Vhost | ${nodes['${dut}']}
57
58 | Add '${m}' worker threads and rxqueues '${n}' in 3-node single-link topo
59 | | [Documentation] | Setup M worker threads and N rxqueues in vpp startup
60 | | ...             | configuration on all DUTs in 3-node single-link topology.
61 | | ${m_int}= | Convert To Integer | ${m}
62 | | ${dut1_numa}= | Get interfaces numa node | ${dut1}
63 | | ...           | ${dut1_if1} | ${dut1_if2}
64 | | ${dut2_numa}= | Get interfaces numa node | ${dut2}
65 | | ...           | ${dut2_if1} | ${dut2_if2}
66 | | ${dut1_cpu_main}= | Cpu list per node str | ${dut1} | ${dut1_numa}
67 | | ...               | cpu_cnt=${1}
68 | | ${dut1_cpu_w}= | Cpu list per node str | ${dut1} | ${dut1_numa}
69 | | ...            | skip_cnt=${1} | cpu_cnt=${m_int}
70 | | ${dut2_cpu_main}= | Cpu list per node str | ${dut2} | ${dut2_numa}
71 | | ...               | cpu_cnt=${1}
72 | | ${dut2_cpu_w}= | Cpu list per node str | ${dut2} | ${dut2_numa}
73 | | ...            | skip_cnt=${1} | cpu_cnt=${m_int}
74 | | ${dut1_cpu}= | Catenate | main-core | ${dut1_cpu_main}
75 | | ...          | corelist-workers | ${dut1_cpu_w}
76 | | ${dut2_cpu}= | Catenate | main-core | ${dut2_cpu_main}
77 | | ...          | corelist-workers | ${dut2_cpu_w}
78 | | ${rxqueues}= | Catenate | num-rx-queues | ${n}
79 | | Add CPU config | ${dut1} | ${dut1_cpu}
80 | | Add CPU config | ${dut2} | ${dut2_cpu}
81 | | Add rxqueues config | ${dut1} | ${rxqueues}
82 | | Add rxqueues config | ${dut2} | ${rxqueues}
83
84 | Add worker threads and rxqueues to all DUTs
85 | | [Documentation] | Setup worker threads and rxqueues in VPP startup
86 | | ...             | configuration to all DUTs
87 | | ...
88 | | ... | *Arguments:*
89 | | ... | - ${cpu} - CPU configuration. Type: string
90 | | ... | - ${rxqueues} - rxqueues configuration. Type: string
91 | | ...
92 | | ... | *Example:*
93 | | ...
94 | | ... | \| Add worker threads and rxqueues to all DUTs \| main-core 0 \
95 | | ... | \| rxqueues 2
96 | | [Arguments] | ${cpu} | ${rxqueues}
97 | | ${duts}= | Get Matches | ${nodes} | DUT*
98 | | :FOR | ${dut} | IN | @{duts}
99 | | | Add CPU config | ${nodes['${dut}']}
100 | | | ...            | ${cpu}
101 | | | Add rxqueues config | ${nodes['${dut}']}
102 | | | ...            | ${rxqueues}
103
104 | Add all PCI devices to all DUTs
105 | | [Documentation] | Add all available PCI devices from topology file to VPP
106 | | ...             | startup configuration to all DUTs
107 | | ${duts}= | Get Matches | ${nodes} | DUT*
108 | | :FOR | ${dut} | IN | @{duts}
109 | | | Add PCI all devices | ${nodes['${dut}']}
110
111 | Add PCI device to DUT
112 | | [Documentation] | Add PCI device to VPP startup configuration
113 | | ...             | to DUT specified as argument
114 | | ...
115 | | ... | *Arguments:*
116 | | ... | - ${node} - DUT node. Type: dictionary
117 | | ... | - ${pci_address} - PCI address. Type: string
118 | | ...
119 | | ... | *Example:*
120 | | ...
121 | | ... | \| Add PCI device to DUT \| ${nodes['DUT1']} \
122 | | ... | \| 0000:00:00.0
123 | | [Arguments] | ${node} | ${pci_address}
124 | | Add PCI device | ${node} | ${pci_address}
125
126 | Add Heapsize Config to all DUTs
127 | | [Documentation] | Add Add Heapsize Config to VPP startup configuration
128 | | ...             | to all DUTs
129 | | ... | *Arguments:*
130 | | ... | - ${heapsize} - Heapsize string (5G, 200M, ...)
131 | | [Arguments] | ${heapsize}
132 | | ${duts}= | Get Matches | ${nodes} | DUT*
133 | | :FOR | ${dut} | IN | @{duts}
134 | | | Add Heapsize Config | ${nodes['${dut}']} | ${heapsize}
135
136 | Add No Multi Seg to all DUTs
137 | | [Documentation] | Add No Multi Seg to VPP startup configuration to all
138 | | ...             | DUTs
139 | | ${duts}= | Get Matches | ${nodes} | DUT*
140 | | :FOR | ${dut} | IN | @{duts}
141 | | | Add No Multi Seg Config | ${nodes['${dut}']}
142
143 | Add Enable Vhost User to all DUTs
144 | | [Documentation] | Add Enable Vhost User to VPP startup configuration to all
145 | | ...             | DUTs
146 | | ${duts}= | Get Matches | ${nodes} | DUT*
147 | | :FOR | ${dut} | IN | @{duts}
148 | | | Add Enable Vhost User Config | ${nodes['${dut}']}
149
150 | Remove startup configuration of VPP from all DUTs
151 | | [Documentation] | Remove VPP startup configuration from all DUTs
152 | | ${duts}= | Get Matches | ${nodes} | DUT*
153 | | :FOR | ${dut} | IN | @{duts}
154 | | | Remove All PCI Devices | ${nodes['${dut}']}
155 | | | Remove All CPU Config | ${nodes['${dut}']}
156 | | | Remove Socketmem Config | ${nodes['${dut}']}
157 | | | Remove Heapsize Config | ${nodes['${dut}']}
158 | | | Remove Rxqueues Config | ${nodes['${dut}']}
159 | | | Remove No Multi Seg Config | ${nodes['${dut}']}
160 | | | Remove Enable Vhost User Config | ${nodes['${dut}']}
161
162 | Setup default startup configuration of VPP on all DUTs
163 | | [Documentation] | Setup default startup configuration of VPP to all DUTs
164 | | Remove startup configuration of VPP from all DUTs
165 | | Add '1' worker threads and rxqueues '1' in 3-node single-link topo
166 | | Add all PCI devices to all DUTs
167 | | Apply startup configuration on all VPP DUTs
168
169 | Apply startup configuration on all VPP DUTs
170 | | [Documentation] | Apply startup configuration of VPP and restart VPP on all
171 | | ...             | DUTs
172 | | ${duts}= | Get Matches | ${nodes} | DUT*
173 | | :FOR | ${dut} | IN | @{duts}
174 | | | Apply Config | ${nodes['${dut}']}
175 | | Update All Interface Data On All Nodes | ${nodes} | skip_tg=${TRUE}