CSIT-163: Add show vpp version verbose
[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.DUTSetup
18 | Library | resources.libraries.python.TGSetup
19 | Library | resources/libraries/python/VppConfigGenerator.py
20 | Library | Collections
21
22 *** Keywords ***
23 | Setup all DUTs before test
24 | | [Documentation] | Setup all DUTs in topology before test execution
25 | | Setup All DUTs | ${nodes}
26
27 | Setup all TGs before traffic script
28 | | [Documentation] | Prepare all TGs before traffic scripts execution
29 | | All TGs Set Interface Default Driver | ${nodes}
30
31 | Show vpp version on all DUTs
32 | | [Documentation] | Show VPP version verbose on all DUTs
33 | | ${duts}= | Get Matches | ${nodes} | DUT*
34 | | :FOR | ${dut} | IN | @{duts}
35 | | | Vpp show version verbose | ${nodes['${dut}']}
36
37 | Add '${m}' worker threads and rxqueues '${n}' without HTT to all DUTs
38 | | [Documentation] |  Setup M worker threads without HTT and rxqueues N in
39 | | ...             |  startup configuration of VPP to all DUTs
40 | | ${cpu}= | Catenate | main-core | 0 | corelist-workers
41 | | ${cpu}= | Run Keyword If | '${m}' == '1' | Catenate | ${cpu} | 1
42 | | ...     | ELSE IF        | '${m}' == '2' | Catenate | ${cpu} | 1-2
43 | | ...     | ELSE IF        | '${m}' == '4' | Catenate | ${cpu} | 1-4
44 | | ...     | ELSE IF        | '${m}' == '6' | Catenate | ${cpu} | 1-6
45 | | ...     | ELSE           | Fail | Not supported combination
46 | | ${rxqueues}= | Catenate | num-rx-queues | ${n}
47 | | Add worker threads and rxqueues to all DUTs | ${cpu} | ${rxqueues}
48
49 | Add '${m}' worker threads and rxqueues '${n}' with HTT to all DUTs
50 | | [Documentation] |  Setup M worker threads with HTT and rxqueues N in
51 | | ...             |  startup configuration of VPP to all DUTs
52 | | ${cpu}= | Catenate | main-core | 0 | corelist-workers
53 | | ${cpu}= | Run Keyword If | '${m}' == '2' | Catenate | ${cpu} | 1,10
54 | | ...     | ELSE IF        | '${m}' == '4' | Catenate | ${cpu} | 1-2,10-11
55 | | ...     | ELSE IF        | '${m}' == '6' | Catenate | ${cpu} | 1-3,10-12
56 | | ...     | ELSE IF        | '${m}' == '8' | Catenate | ${cpu} | 1-4,10-13
57 | | ...     | ELSE           | Fail | Not supported combination
58 | | ${rxqueues}= | Catenate | num-rx-queues | ${n}
59 | | Add worker threads and rxqueues to all DUTs | ${cpu} | ${rxqueues}
60
61 | Add worker threads and rxqueues to all DUTs
62 | | [Documentation] | Setup worker threads and rxqueues in VPP startup
63 | | ...             | configuration to all DUTs
64 | | ...
65 | | ... | *Arguments:*
66 | | ... | - ${cpu} - CPU configuration. Type: string
67 | | ... | - ${rxqueues} - rxqueues configuration. Type: string
68 | | ...
69 | | ... | *Example:*
70 | | ...
71 | | ... | \| Add worker threads and rxqueues to all DUTs \| main-core 0 \
72 | | ... | \| rxqueues 2
73 | | [Arguments] | ${cpu} | ${rxqueues}
74 | | ${duts}= | Get Matches | ${nodes} | DUT*
75 | | :FOR | ${dut} | IN | @{duts}
76 | | | Add CPU config | ${nodes['${dut}']}
77 | | | ...            | ${cpu}
78 | | | Add rxqueues config | ${nodes['${dut}']}
79 | | | ...            | ${rxqueues}
80
81 | Add all PCI devices to all DUTs
82 | | [Documentation] | Add all available PCI devices from topology file to VPP
83 | | ...             | startup configuration to all DUTs
84 | | ${duts}= | Get Matches | ${nodes} | DUT*
85 | | :FOR | ${dut} | IN | @{duts}
86 | | | Add PCI device | ${nodes['${dut}']}
87
88 | Add PCI device to DUT
89 | | [Documentation] | Add PCI device to VPP startup configuration
90 | | ...             | to DUT specified as argument
91 | | ...
92 | | ... | *Arguments:*
93 | | ... | - ${node} - DUT node. Type: dictionary
94 | | ... | - ${pci_address} - PCI address. Type: string
95 | | ...
96 | | ... | *Example:*
97 | | ...
98 | | ... | \| Add PCI device to DUT \| ${nodes['DUT1']} \
99 | | ... | \| 0000:00:00.0
100 | | [Arguments] | ${node} | ${pci_address}
101 | | Add PCI device | ${node} | ${pci_address}
102
103 | Add No Multi Seg to all DUTs
104 | | [Documentation] | Add No Multi Seg to VPP startup configuration to all
105 | | ...             | DUTs
106 | | ${duts}= | Get Matches | ${nodes} | DUT*
107 | | :FOR | ${dut} | IN | @{duts}
108 | | | Add No Multi Seg Config | ${nodes['${dut}']}
109
110 | Remove startup configuration of VPP from all DUTs
111 | | [Documentation] | Remove VPP startup configuration from all DUTs
112 | | ${duts}= | Get Matches | ${nodes} | DUT*
113 | | :FOR | ${dut} | IN | @{duts}
114 | | | Remove All PCI Devices | ${nodes['${dut}']}
115 | | | Remove All CPU Config | ${nodes['${dut}']}
116 | | | Remove Socketmem Config | ${nodes['${dut}']}
117 | | | Remove Heapsize Config | ${nodes['${dut}']}
118 | | | Remove Rxqueues Config | ${nodes['${dut}']}
119 | | | Remove No Multi Seg Config | ${nodes['${dut}']}
120
121 | Setup default startup configuration of VPP on all DUTs
122 | | [Documentation] | Setup default startup configuration of VPP to all DUTs
123 | | Remove startup configuration of VPP from all DUTs
124 | | Add '1' worker threads and rxqueues '1' without HTT to all DUTs
125 | | Add all PCI devices to all DUTs
126 | | Apply startup configuration on all VPP DUTs
127
128 | Apply startup configuration on all VPP DUTs
129 | | [Documentation] | Apply startup configuration of VPP and restart VPP on all
130 | | ...             | DUTs
131 | | ${duts}= | Get Matches | ${nodes} | DUT*
132 | | :FOR | ${dut} | IN | @{duts}
133 | | | Apply Config | ${nodes['${dut}']}