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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
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
25 | Setup all DUTs before test
26 | | [Documentation] | Setup all DUTs in topology before test execution
27 | | Setup All DUTs | ${nodes}
29 | Setup all TGs before traffic script
30 | | [Documentation] | Prepare all TGs before traffic scripts execution
31 | | All TGs Set Interface Default Driver | ${nodes}
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}']}
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}']}
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}']}
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}']}
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}
84 | Add '${m}' worker threads and rxqueues '${n}' without HTT to all DUTs
85 | | [Documentation] | Setup M worker threads without HTT and rxqueues N in
86 | | ... | startup configuration of VPP to all DUTs
87 | | ${cpu}= | Catenate | main-core | 0 | corelist-workers
88 | | ${cpu}= | Run Keyword If | '${m}' == '1' | Catenate | ${cpu} | 1
89 | | ... | ELSE IF | '${m}' == '2' | Catenate | ${cpu} | 1-2
90 | | ... | ELSE IF | '${m}' == '4' | Catenate | ${cpu} | 1-4
91 | | ... | ELSE IF | '${m}' == '6' | Catenate | ${cpu} | 1-6
92 | | ... | ELSE | Fail | Not supported combination
93 | | ${rxqueues}= | Catenate | num-rx-queues | ${n}
94 | | Add worker threads and rxqueues to all DUTs | ${cpu} | ${rxqueues}
96 | Add '${m}' worker threads and rxqueues '${n}' with HTT to all DUTs
97 | | [Documentation] | Setup M worker threads with HTT and rxqueues N in
98 | | ... | startup configuration of VPP to all DUTs
99 | | ${cpu}= | Catenate | main-core | 0 | corelist-workers
100 | | ${cpu}= | Run Keyword If | '${m}' == '2' | Catenate | ${cpu} | 1,10
101 | | ... | ELSE IF | '${m}' == '4' | Catenate | ${cpu} | 1-2,10-11
102 | | ... | ELSE IF | '${m}' == '6' | Catenate | ${cpu} | 1-3,10-12
103 | | ... | ELSE IF | '${m}' == '8' | Catenate | ${cpu} | 1-4,10-13
104 | | ... | ELSE | Fail | Not supported combination
105 | | ${rxqueues}= | Catenate | num-rx-queues | ${n}
106 | | Add worker threads and rxqueues to all DUTs | ${cpu} | ${rxqueues}
108 | Add worker threads and rxqueues to all DUTs
109 | | [Documentation] | Setup worker threads and rxqueues in VPP startup
110 | | ... | configuration to all DUTs
112 | | ... | *Arguments:*
113 | | ... | - ${cpu} - CPU configuration. Type: string
114 | | ... | - ${rxqueues} - rxqueues configuration. Type: string
118 | | ... | \| Add worker threads and rxqueues to all DUTs \| main-core 0 \
119 | | ... | \| rxqueues 2
120 | | [Arguments] | ${cpu} | ${rxqueues}
121 | | ${duts}= | Get Matches | ${nodes} | DUT*
122 | | :FOR | ${dut} | IN | @{duts}
123 | | | Add CPU config | ${nodes['${dut}']}
125 | | | Add rxqueues config | ${nodes['${dut}']}
126 | | | ... | ${rxqueues}
128 | Add all PCI devices to all DUTs
129 | | [Documentation] | Add all available PCI devices from topology file to VPP
130 | | ... | startup configuration to all DUTs
131 | | ${duts}= | Get Matches | ${nodes} | DUT*
132 | | :FOR | ${dut} | IN | @{duts}
133 | | | Add PCI all devices | ${nodes['${dut}']}
135 | Add PCI device to DUT
136 | | [Documentation] | Add PCI device to VPP startup configuration
137 | | ... | to DUT specified as argument
139 | | ... | *Arguments:*
140 | | ... | - ${node} - DUT node. Type: dictionary
141 | | ... | - ${pci_address} - PCI address. Type: string
145 | | ... | \| Add PCI device to DUT \| ${nodes['DUT1']} \
146 | | ... | \| 0000:00:00.0
147 | | [Arguments] | ${node} | ${pci_address}
148 | | Add PCI device | ${node} | ${pci_address}
150 | Add Heapsize Config to all DUTs
151 | | [Documentation] | Add Add Heapsize Config to VPP startup configuration
152 | | ... | to all DUTs
153 | | ... | *Arguments:*
154 | | ... | - ${heapsize} - Heapsize string (5G, 200M, ...)
155 | | [Arguments] | ${heapsize}
156 | | ${duts}= | Get Matches | ${nodes} | DUT*
157 | | :FOR | ${dut} | IN | @{duts}
158 | | | Add Heapsize Config | ${nodes['${dut}']} | ${heapsize}
160 | Add No Multi Seg to all DUTs
161 | | [Documentation] | Add No Multi Seg to VPP startup configuration to all
163 | | ${duts}= | Get Matches | ${nodes} | DUT*
164 | | :FOR | ${dut} | IN | @{duts}
165 | | | Add No Multi Seg Config | ${nodes['${dut}']}
167 | Add Enable Vhost User to all DUTs
168 | | [Documentation] | Add Enable Vhost User to VPP startup configuration to all
170 | | ${duts}= | Get Matches | ${nodes} | DUT*
171 | | :FOR | ${dut} | IN | @{duts}
172 | | | Add Enable Vhost User Config | ${nodes['${dut}']}
174 | Remove startup configuration of VPP from all DUTs
175 | | [Documentation] | Remove VPP startup configuration from all DUTs
176 | | ${duts}= | Get Matches | ${nodes} | DUT*
177 | | :FOR | ${dut} | IN | @{duts}
178 | | | Remove All PCI Devices | ${nodes['${dut}']}
179 | | | Remove All CPU Config | ${nodes['${dut}']}
180 | | | Remove Socketmem Config | ${nodes['${dut}']}
181 | | | Remove Heapsize Config | ${nodes['${dut}']}
182 | | | Remove Rxqueues Config | ${nodes['${dut}']}
183 | | | Remove No Multi Seg Config | ${nodes['${dut}']}
184 | | | Remove Enable Vhost User Config | ${nodes['${dut}']}
186 | Setup default startup configuration of VPP on all DUTs
187 | | [Documentation] | Setup default startup configuration of VPP to all DUTs
188 | | Remove startup configuration of VPP from all DUTs
189 | | Add '1' worker threads and rxqueues '1' without HTT to all DUTs
190 | | Add all PCI devices to all DUTs
191 | | Apply startup configuration on all VPP DUTs
193 | Apply startup configuration on all VPP DUTs
194 | | [Documentation] | Apply startup configuration of VPP and restart VPP on all
196 | | ${duts}= | Get Matches | ${nodes} | DUT*
197 | | :FOR | ${dut} | IN | @{duts}
198 | | | Apply Config | ${nodes['${dut}']}
199 | | Update All Interface Data On All Nodes | ${nodes} | skip_tg=${TRUE}