Fix Tap failing tests
[csit.git] / resources / libraries / robot / honeycomb / performance.robot
1 # Copyright (c) 2017 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 | Library | resources.libraries.python.honeycomb.Performance
16 | Library | resources.libraries.python.InterfaceUtil
17 | Resource | resources/libraries/robot/honeycomb/honeycomb.robot
18 | Documentation | Keywords used in Honeycomb performance testing.
19
20 *** Keywords ***
21 | Configure Honeycomb Netconf threads
22 | | [Documentation] | Modify thread configuration of Honeycomb's Netconf server,
23 | | ... | Requires a restart of Honeycomb to take effect.
24 | | ...
25 | | ... | *Arguments:*
26 | | ... | - node - Node to change configuration on. Type: dictionary
27 | | ... | - threads - Number of threads to configure. Type: integer
28 | | ...
29 | | ... | *Example:*
30 | | ...
31 | | ... | \| Configure Honeycomb Netconf Threads \| ${nodes[DUT1]} \| ${2} \|
32 | | ...
33 | | [Arguments] | ${node} | ${threads}
34 | | Configure Netconf Threads | ${node} | ${threads}
35
36 | Run base operational read performance trial
37 | | [Documentation] | Send Netconf requests over plain TCP to obtain VPP version
38 | | ... | from Honeycomb operational data.
39 | | ...
40 | | ... | *Arguments:*
41 | | ... | - node - Node to run test on. Type: dictionary
42 | | ... | - cores - Number of available processor cores. Type: integer
43 | | ... | - cycles - Number of test cycles to run. Final results will\
44 | | ... | be averaged across all runs. Type: integer
45 | | ... | - threads - Number of threads to use for generating traffic.\
46 | | ... | Type: integer
47 | | ... | - requests - Number of requests to send in each thread and cycle.\
48 | | ... | Type: integer
49 | | ...
50 | | ... | *Example:*
51 | | ...
52 | | ... | \| Run base operational read performance trial \| ${nodes[DUT1]} \
53 | | ... | \| ${36} \| ${1} \| ${4} \| ${10000} \|
54 | | ...
55 | | [Arguments] | ${node} | ${cores} | ${cycles} | ${threads} | ${requests}
56 | | ${result}= | Run traffic script on DUT | ${node} | read_vpp_version.py
57 | | ... | ${cores} | cycles=${cycles} | threads=${threads}
58 | | ... | requests=${requests}
59 | | Set Test Message | ${result}
60
61 | Generate VPP Startup Configuration for Honeycomb Test on DUT
62 | | [Arguments] | ${node}
63 | | [Documentation] | Create VPP base startup configuration on DUT, then restart
64 | | ... | VPP to apply the configuration.
65 | | ...
66 | | ... | *Arguments:*
67 | | ... | - node - VPP node to configure. Type: dictionary
68 | | ...
69 | | ... | *Example:*
70 | | ...
71 | | ... | \| Generate VPP Startup Configuration for Honeycomb Test on DUT \
72 | | ... | \| ${nodes[DUT1]} \|
73 | | ...
74 | | Import Library | resources.libraries.python.VppConfigGenerator
75 | | ... | WITH NAME | VPP_config
76 | | Run keyword | VPP_config.Set Node | ${node}
77 | | Run keyword | VPP_config.Add Unix Log
78 | | Run keyword | VPP_config.Add Unix CLI Listen
79 | | Run keyword | VPP_config.Add Unix Nodaemon
80 | | Run keyword | VPP_config.Add CPU Main Core | ${1}
81 | | Run keyword | VPP_config.Apply Config
82
83 | Log Honeycomb and VPP process distribution on cores
84 | | [Documentation] | Log the distribution of VPP and Honeycomb child processes
85 | | ... | over the CPU cores.
86 | | ...
87 | | ... | *Arguments:*
88 | | ... | - node - Honeycomb node. Type: dictionary
89 | | ...
90 | | ... | *Example:*
91 | | ...
92 | | ... | \| Log Honeycomb and VPP process distribution on cores \
93 | | ... | \| ${nodes[DUT1]} \|
94 | | ...
95 | | [Arguments] | ${node}
96 | | Log Core Schedule | ${node} | vpp
97 | | Log Core Schedule | ${node} | java
98
99 | Generate Honeycomb startup configuration for performance test
100 | | [Documentation] | Create HC startup configuration and apply to config
101 | | ... | file on DUT. Requires Honeycomb restart to take effect.
102 | | ...
103 | | ... | *Arguments:*
104 | | ... | - node - Honeycomb node. Type: dictionary
105 | | ...
106 | | ... | *Example:*
107 | | ...
108 | | ... | \| Generate Honeycomb startup configuration for performance test \
109 | | ... | \| ${nodes[DUT1]} \|
110 | | ...
111 | | [Arguments] | ${node} | ${cores}
112 | | Import Library | resources.libraries.python.honeycomb.HoneycombSetup.HoneycombStartupConfig
113 | | ... | WITH NAME | HC_config
114 | | Run Keyword | HC_config.Set CPU Scheduler | FIFO
115 | | Run Keyword | HC_config.Set CPU Core Affinity | ${2} | ${cores}
116 | | Run Keyword | HC_config.Set JIT Compiler Mode | server
117 | | Run Keyword | HC_config.Set Memory Size | ${512} | ${2048}
118 | | Run Keyword | HC_config.Set Metaspace Size | ${128} | ${512}
119 | | Run Keyword | HC_config.Set NUMA Optimization
120 | | Run Keyword | HC_config.apply config | ${node}