Adjust short test treshold based on latest results
[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 | Add '${m}' worker threads and rxqueues '${n}' without HTT to all DUTs
32 | | [Documentation] |  Setup M worker threads without HTT and rxqueues N in
33 | | ...             |  startup configuration of VPP to all DUTs
34 | | ${cpu}= | Catenate | main-core | 0 | corelist-workers
35 | | ${cpu}= | Run Keyword If | '${m}' == '1' | Catenate | ${cpu} | 1
36 | | ...     | ELSE IF        | '${m}' == '2' | Catenate | ${cpu} | 1-2
37 | | ...     | ELSE IF        | '${m}' == '4' | Catenate | ${cpu} | 1-4
38 | | ...     | ELSE IF        | '${m}' == '6' | Catenate | ${cpu} | 1-6
39 | | ...     | ELSE           | Fail | Not supported combination
40 | | ${rxqueues}= | Catenate | num-rx-queues | ${n}
41 | | Add worker threads and rxqueues to all DUTs | ${cpu} | ${rxqueues}
42
43 | Add '${m}' worker threads and rxqueues '${n}' with HTT to all DUTs
44 | | [Documentation] |  Setup M worker threads with HTT and rxqueues N in
45 | | ...             |  startup configuration of VPP to all DUTs
46 | | ${cpu}= | Catenate | main-core | 0 | corelist-workers
47 | | ${cpu}= | Run Keyword If | '${m}' == '2' | Catenate | ${cpu} | 1,10
48 | | ...     | ELSE IF        | '${m}' == '4' | Catenate | ${cpu} | 1-2,10-11
49 | | ...     | ELSE IF        | '${m}' == '6' | Catenate | ${cpu} | 1-3,10-12
50 | | ...     | ELSE IF        | '${m}' == '8' | Catenate | ${cpu} | 1-4,10-13
51 | | ...     | ELSE           | Fail | Not supported combination
52 | | ${rxqueues}= | Catenate | num-rx-queues | ${n}
53 | | Add worker threads and rxqueues to all DUTs | ${cpu} | ${rxqueues}
54
55 | Add worker threads and rxqueues to all DUTs
56 | | [Documentation] | Setup worker threads and rxqueues in VPP startup
57 | | ...             | configuration to all DUTs
58 | | ...
59 | | ... | *Arguments:*
60 | | ... | - ${cpu} - CPU configuration. Type: string
61 | | ... | - ${rxqueues} - rxqueues configuration. Type: string
62 | | ...
63 | | ... | *Example:*
64 | | ...
65 | | ... | \| Add worker threads and rxqueues to all DUTs \| main-core 0 \
66 | | ... | \| rxqueues 2
67 | | [Arguments] | ${cpu} | ${rxqueues}
68 | | ${duts}= | Get Matches | ${nodes} | DUT*
69 | | :FOR | ${dut} | IN | @{duts}
70 | | | Add CPU config | ${nodes['${dut}']}
71 | | | ...            | ${cpu}
72 | | | Add rxqueues config | ${nodes['${dut}']}
73 | | | ...            | ${rxqueues}
74
75 | Add all PCI devices to all DUTs
76 | | [Documentation] | Add all available PCI devices from topology file to VPP
77 | | ...             | startup configuration to all DUTs
78 | | ${duts}= | Get Matches | ${nodes} | DUT*
79 | | :FOR | ${dut} | IN | @{duts}
80 | | | Add PCI device | ${nodes['${dut}']}
81
82 | Add PCI device to DUT
83 | | [Documentation] | Add PCI device to VPP startup configuration
84 | | ...             | to DUT specified as argument
85 | | ...
86 | | ... | *Arguments:*
87 | | ... | - ${node} - DUT node. Type: dictionary
88 | | ... | - ${pci_address} - PCI address. Type: string
89 | | ...
90 | | ... | *Example:*
91 | | ...
92 | | ... | \| Add PCI device to DUT \| ${nodes['DUT1']} \
93 | | ... | \| 0000:00:00.0
94 | | [Arguments] | ${node} | ${pci_address}
95 | | Add PCI device | ${node} | ${pci_address}
96
97 | Add No Multi Seg to all DUTs
98 | | [Documentation] | Add No Multi Seg to VPP startup configuration to all
99 | | ...             | DUTs
100 | | ${duts}= | Get Matches | ${nodes} | DUT*
101 | | :FOR | ${dut} | IN | @{duts}
102 | | | Add No Multi Seg Config | ${nodes['${dut}']}
103
104 | Remove startup configuration of VPP from all DUTs
105 | | [Documentation] | Remove VPP startup configuration from all DUTs
106 | | ${duts}= | Get Matches | ${nodes} | DUT*
107 | | :FOR | ${dut} | IN | @{duts}
108 | | | Remove All PCI Devices | ${nodes['${dut}']}
109 | | | Remove All CPU Config | ${nodes['${dut}']}
110 | | | Remove Socketmem Config | ${nodes['${dut}']}
111 | | | Remove Heapsize Config | ${nodes['${dut}']}
112 | | | Remove Rxqueues Config | ${nodes['${dut}']}
113 | | | Remove No Multi Seg Config | ${nodes['${dut}']}
114
115 | Setup default startup configuration of VPP on all DUTs
116 | | [Documentation] | Setup default startup configuration of VPP to all DUTs
117 | | Remove startup configuration of VPP from all DUTs
118 | | Add '1' worker threads and rxqueues '1' without HTT to all DUTs
119 | | Add all PCI devices to all DUTs
120 | | Apply startup configuration on all VPP DUTs
121
122 | Apply startup configuration on all VPP DUTs
123 | | [Documentation] | Apply startup configuration of VPP and restart VPP on all
124 | | ...             | DUTs
125 | | ${duts}= | Get Matches | ${nodes} | DUT*
126 | | :FOR | ${dut} | IN | @{duts}
127 | | | Apply Config | ${nodes['${dut}']}