CSIT-411 Show Vhost User
[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 '${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}
95
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}
107
108 | Add worker threads and rxqueues to all DUTs
109 | | [Documentation] | Setup worker threads and rxqueues in VPP startup
110 | | ...             | configuration to all DUTs
111 | | ...
112 | | ... | *Arguments:*
113 | | ... | - ${cpu} - CPU configuration. Type: string
114 | | ... | - ${rxqueues} - rxqueues configuration. Type: string
115 | | ...
116 | | ... | *Example:*
117 | | ...
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}']}
124 | | | ...            | ${cpu}
125 | | | Add rxqueues config | ${nodes['${dut}']}
126 | | | ...            | ${rxqueues}
127
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}']}
134
135 | Add PCI device to DUT
136 | | [Documentation] | Add PCI device to VPP startup configuration
137 | | ...             | to DUT specified as argument
138 | | ...
139 | | ... | *Arguments:*
140 | | ... | - ${node} - DUT node. Type: dictionary
141 | | ... | - ${pci_address} - PCI address. Type: string
142 | | ...
143 | | ... | *Example:*
144 | | ...
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}
149
150 | Add No Multi Seg to all DUTs
151 | | [Documentation] | Add No Multi Seg to VPP startup configuration to all
152 | | ...             | DUTs
153 | | ${duts}= | Get Matches | ${nodes} | DUT*
154 | | :FOR | ${dut} | IN | @{duts}
155 | | | Add No Multi Seg Config | ${nodes['${dut}']}
156
157 | Add Enable Vhost User to all DUTs
158 | | [Documentation] | Add Enable Vhost User to VPP startup configuration to all
159 | | ...             | DUTs
160 | | ${duts}= | Get Matches | ${nodes} | DUT*
161 | | :FOR | ${dut} | IN | @{duts}
162 | | | Add Enable Vhost User Config | ${nodes['${dut}']}
163
164 | Remove startup configuration of VPP from all DUTs
165 | | [Documentation] | Remove VPP startup configuration from all DUTs
166 | | ${duts}= | Get Matches | ${nodes} | DUT*
167 | | :FOR | ${dut} | IN | @{duts}
168 | | | Remove All PCI Devices | ${nodes['${dut}']}
169 | | | Remove All CPU Config | ${nodes['${dut}']}
170 | | | Remove Socketmem Config | ${nodes['${dut}']}
171 | | | Remove Heapsize Config | ${nodes['${dut}']}
172 | | | Remove Rxqueues Config | ${nodes['${dut}']}
173 | | | Remove No Multi Seg Config | ${nodes['${dut}']}
174 | | | Remove Enable Vhost User Config | ${nodes['${dut}']}
175
176 | Setup default startup configuration of VPP on all DUTs
177 | | [Documentation] | Setup default startup configuration of VPP to all DUTs
178 | | Remove startup configuration of VPP from all DUTs
179 | | Add '1' worker threads and rxqueues '1' without HTT to all DUTs
180 | | Add all PCI devices to all DUTs
181 | | Apply startup configuration on all VPP DUTs
182
183 | Apply startup configuration on all VPP DUTs
184 | | [Documentation] | Apply startup configuration of VPP and restart VPP on all
185 | | ...             | DUTs
186 | | ${duts}= | Get Matches | ${nodes} | DUT*
187 | | :FOR | ${dut} | IN | @{duts}
188 | | | Apply Config | ${nodes['${dut}']}
189 | | Update All Interface Data On All Nodes | ${nodes} | skip_tg=${TRUE}