CSIT-106 Vpp config - use only test-related interfaces
[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 | Show vpp trace dump on all DUTs
38 | | [Documentation] | Save API trace and dump output on all DUTs
39 | | ${duts}= | Get Matches | ${nodes} | DUT*
40 | | :FOR | ${dut} | IN | @{duts}
41 | | | Vpp api trace save | ${nodes['${dut}']}
42 | | | Vpp api trace dump | ${nodes['${dut}']}
43
44 | Add '${m}' worker threads and rxqueues '${n}' without HTT to all DUTs
45 | | [Documentation] |  Setup M worker threads without HTT and rxqueues N in
46 | | ...             |  startup configuration of VPP to all DUTs
47 | | ${cpu}= | Catenate | main-core | 0 | corelist-workers
48 | | ${cpu}= | Run Keyword If | '${m}' == '1' | Catenate | ${cpu} | 1
49 | | ...     | ELSE IF        | '${m}' == '2' | Catenate | ${cpu} | 1-2
50 | | ...     | ELSE IF        | '${m}' == '4' | Catenate | ${cpu} | 1-4
51 | | ...     | ELSE IF        | '${m}' == '6' | Catenate | ${cpu} | 1-6
52 | | ...     | ELSE           | Fail | Not supported combination
53 | | ${rxqueues}= | Catenate | num-rx-queues | ${n}
54 | | Add worker threads and rxqueues to all DUTs | ${cpu} | ${rxqueues}
55
56 | Add '${m}' worker threads and rxqueues '${n}' with HTT to all DUTs
57 | | [Documentation] |  Setup M worker threads with HTT and rxqueues N in
58 | | ...             |  startup configuration of VPP to all DUTs
59 | | ${cpu}= | Catenate | main-core | 0 | corelist-workers
60 | | ${cpu}= | Run Keyword If | '${m}' == '2' | Catenate | ${cpu} | 1,10
61 | | ...     | ELSE IF        | '${m}' == '4' | Catenate | ${cpu} | 1-2,10-11
62 | | ...     | ELSE IF        | '${m}' == '6' | Catenate | ${cpu} | 1-3,10-12
63 | | ...     | ELSE IF        | '${m}' == '8' | Catenate | ${cpu} | 1-4,10-13
64 | | ...     | ELSE           | Fail | Not supported combination
65 | | ${rxqueues}= | Catenate | num-rx-queues | ${n}
66 | | Add worker threads and rxqueues to all DUTs | ${cpu} | ${rxqueues}
67
68 | Add worker threads and rxqueues to all DUTs
69 | | [Documentation] | Setup worker threads and rxqueues in VPP startup
70 | | ...             | configuration to all DUTs
71 | | ...
72 | | ... | *Arguments:*
73 | | ... | - ${cpu} - CPU configuration. Type: string
74 | | ... | - ${rxqueues} - rxqueues configuration. Type: string
75 | | ...
76 | | ... | *Example:*
77 | | ...
78 | | ... | \| Add worker threads and rxqueues to all DUTs \| main-core 0 \
79 | | ... | \| rxqueues 2
80 | | [Arguments] | ${cpu} | ${rxqueues}
81 | | ${duts}= | Get Matches | ${nodes} | DUT*
82 | | :FOR | ${dut} | IN | @{duts}
83 | | | Add CPU config | ${nodes['${dut}']}
84 | | | ...            | ${cpu}
85 | | | Add rxqueues config | ${nodes['${dut}']}
86 | | | ...            | ${rxqueues}
87
88 | Add all PCI devices to all DUTs
89 | | [Documentation] | Add all available PCI devices from topology file to VPP
90 | | ...             | startup configuration to all DUTs
91 | | ${duts}= | Get Matches | ${nodes} | DUT*
92 | | :FOR | ${dut} | IN | @{duts}
93 | | | Add PCI all devices | ${nodes['${dut}']}
94
95 | Add PCI device to DUT
96 | | [Documentation] | Add PCI device to VPP startup configuration
97 | | ...             | to DUT specified as argument
98 | | ...
99 | | ... | *Arguments:*
100 | | ... | - ${node} - DUT node. Type: dictionary
101 | | ... | - ${pci_address} - PCI address. Type: string
102 | | ...
103 | | ... | *Example:*
104 | | ...
105 | | ... | \| Add PCI device to DUT \| ${nodes['DUT1']} \
106 | | ... | \| 0000:00:00.0
107 | | [Arguments] | ${node} | ${pci_address}
108 | | Add PCI device | ${node} | ${pci_address}
109
110 | Add No Multi Seg to all DUTs
111 | | [Documentation] | Add No Multi Seg to VPP startup configuration to all
112 | | ...             | DUTs
113 | | ${duts}= | Get Matches | ${nodes} | DUT*
114 | | :FOR | ${dut} | IN | @{duts}
115 | | | Add No Multi Seg Config | ${nodes['${dut}']}
116
117 | Add Enable Vhost User to all DUTs
118 | | [Documentation] | Add Enable Vhost User to VPP startup configuration to all
119 | | ...             | DUTs
120 | | ${duts}= | Get Matches | ${nodes} | DUT*
121 | | :FOR | ${dut} | IN | @{duts}
122 | | | Add Enable Vhost User Config | ${nodes['${dut}']}
123
124 | Remove startup configuration of VPP from all DUTs
125 | | [Documentation] | Remove VPP startup configuration from all DUTs
126 | | ${duts}= | Get Matches | ${nodes} | DUT*
127 | | :FOR | ${dut} | IN | @{duts}
128 | | | Remove All PCI Devices | ${nodes['${dut}']}
129 | | | Remove All CPU Config | ${nodes['${dut}']}
130 | | | Remove Socketmem Config | ${nodes['${dut}']}
131 | | | Remove Heapsize Config | ${nodes['${dut}']}
132 | | | Remove Rxqueues Config | ${nodes['${dut}']}
133 | | | Remove No Multi Seg Config | ${nodes['${dut}']}
134 | | | Remove Enable Vhost User Config | ${nodes['${dut}']}
135
136 | Setup default startup configuration of VPP on all DUTs
137 | | [Documentation] | Setup default startup configuration of VPP to all DUTs
138 | | Remove startup configuration of VPP from all DUTs
139 | | Add '1' worker threads and rxqueues '1' without HTT to all DUTs
140 | | Add all PCI devices to all DUTs
141 | | Apply startup configuration on all VPP DUTs
142
143 | Apply startup configuration on all VPP DUTs
144 | | [Documentation] | Apply startup configuration of VPP and restart VPP on all
145 | | ...             | DUTs
146 | | ${duts}= | Get Matches | ${nodes} | DUT*
147 | | :FOR | ${dut} | IN | @{duts}
148 | | | Apply Config | ${nodes['${dut}']}
149 | | Update All Interface Data On All Nodes | ${nodes} | skip_tg=${TRUE}