fix(ipsec): Prepare IPsecUtil for upcoming changes
[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 statistics on all DUTs
32 | | [Documentation] | Show VPP statistics on all DUTs after the test failed
33 | | Sleep | 10 | Waiting for statistics to be collected
34 | | ${duts}= | Get Matches | ${nodes} | DUT*
35 | | :FOR | ${dut} | IN | @{duts}
36 | | | Vpp show stats | ${nodes['${dut}']}
37
38 | Setup '${m}' worker threads and rss '${n}' without HTT on all DUTs
39 | | [Documentation] |  Setup M worker threads without HTT and rss N in startup
40 | | ...             |  configuration of VPP on all DUTs
41 | | ${cpu}= | Catenate | main-core | 0 | corelist-workers
42 | | ${cpu}= | Run Keyword If | '${m}' == '1' | Catenate | ${cpu} | 1
43 | | ...     | ELSE IF        | '${m}' == '2' | Catenate | ${cpu} | 1-2
44 | | ...     | ELSE IF        | '${m}' == '4' | Catenate | ${cpu} | 1-4
45 | | ...     | ELSE IF        | '${m}' == '6' | Catenate | ${cpu} | 1-6
46 | | ...     | ELSE           | Fail | Not supported combination
47 | | ${rss}= | Catenate | rss | ${n}
48 | | Setup worker threads and rss on all DUTs | ${cpu} | ${rss}
49
50 | Setup '${m}' worker threads and rss '${n}' with HTT on all DUTs
51 | | [Documentation] |  Setup M worker threads with HTT and rss N in startup
52 | | ...             |  configuration of VPP on all DUTs
53 | | ${cpu}= | Catenate | main-core | 0 | corelist-workers
54 | | ${cpu}= | Run Keyword If | '${m}' == '2' | Catenate | ${cpu} | 1,10
55 | | ...     | ELSE IF        | '${m}' == '4' | Catenate | ${cpu} | 1-2,10-11
56 | | ...     | ELSE IF        | '${m}' == '6' | Catenate | ${cpu} | 1-3,10-12
57 | | ...     | ELSE IF        | '${m}' == '8' | Catenate | ${cpu} | 1-4,10-13
58 | | ...     | ELSE           | Fail | Not supported combination
59 | | ${rss}= | Catenate | rss | ${n}
60 | | Setup worker threads and rss on all DUTs | ${cpu} | ${rss}
61
62 | Setup worker threads and rss on all DUTs
63 | | [Documentation] |  Setup worker threads and rss in startup configuration of
64 | | ...             |  VPP on all DUTs
65 | | [Arguments] | ${cpu} | ${rss}
66 | | ${duts}= | Get Matches | ${nodes} | DUT*
67 | | :FOR | ${dut} | IN | @{duts}
68 | | | Add CPU config | ${nodes['${dut}']}
69 | | | ...            | ${cpu}
70 | | | Add PCI device | ${nodes['${dut}']}
71 | | | Add RSS config | ${nodes['${dut}']}
72 | | | ...            | ${rss}
73 | | | Apply config | ${nodes['${dut}']}
74
75 | Reset startup configuration of VPP on all DUTs
76 | | [Documentation] | Reset startup configuration of VPP on all DUTs
77 | | ${cpu}= | Catenate | main-core | 1
78 | | ${duts}= | Get Matches | ${nodes} | DUT*
79 | | :FOR | ${dut} | IN | @{duts}
80 | | | Remove All PCI Devices | ${nodes['${dut}']}
81 | | | Remove All CPU Config | ${nodes['${dut}']}
82 | | | Remove Socketmem Config | ${nodes['${dut}']}
83 | | | Remove Heapsize Config | ${nodes['${dut}']}
84 | | | Remove RSS Config | ${nodes['${dut}']}
85 | | | Add CPU Config | ${nodes['${dut}']}
86 | | | ...            | ${cpu}
87 | | | Add PCI Device | ${nodes['${dut}']}
88 | | | Apply Config | ${nodes['${dut}']}
89