blob: f7535aa39c3dab0e6bc616fd81eef50b2edd0c4f [file] [log] [blame]
Steven Sombar43fae662017-09-22 09:05:58 -05001*** Settings ***
2Documentation Energy scale power capping tests.
3
Steven Sombar433b5262017-09-28 11:44:34 -05004
5# Acronyms
6# PL Power Limit
7# OCC On Chip Controller
8
9
10Resource ../lib/energy_scale_utils.robot
11Resource ../lib/rest_client.robot
12Resource ../lib/openbmc_ffdc.robot
13Resource ../lib/boot_utils.robot
14Resource ../lib/ipmi_client.robot
Steven Sombar43fae662017-09-22 09:05:58 -050015
16Suite Setup Suite Setup Execution
17Test Teardown Test Teardown Execution
18
19
20*** Test Cases ***
21
22
23Escale System On And PL Enabled
Steven Sombar433b5262017-09-28 11:44:34 -050024 [Documentation] Change active power limit with system power on and
25 ... Power limit active.
Steven Sombar43fae662017-09-22 09:05:58 -050026 [Tags] Escale_System_On_And_PL_Enabled
27
Steven Sombar43fae662017-09-22 09:05:58 -050028 REST Power On stack_mode=skip
29
30 OCC Tool Upload Setup
31
32 # Get OCC data from OS.
33 ${cmd}= Set Variable /tmp/occtoolp9 -p | grep -e State: -e Sensor:
34 ${output} ${stderr} ${rc}= OS Execute Command ${cmd}
35
36 # Check for expected responses.
37 Should Contain ${output} ACTIVE
38 Should Contain ${output} Sensor: TEMP
39 Should Contain ${output} Sensor: FREQ
40 Should Contain ${output} Sensor: POWR
41
42 ${power}= Get DCMI Power Limit
43 Should Be True ${power} == ${0}
44 ... msg=Initial dcmi power limit should be zero.
45
46 Activate DCMI Power And Verify
47
48 Set DCMI Power Limit And Verify 300
49
50
51Escale System On And PL Disabled
George Keishing56f33502017-10-16 02:12:46 -050052 [Documentation] Change active power limit with system power on and
Steven Sombar433b5262017-09-28 11:44:34 -050053 ... deactivate power limit prior to change.
Steven Sombar43fae662017-09-22 09:05:58 -050054 [Tags] Escale_System_On_And_PL_Disabled
55
Steven Sombar43fae662017-09-22 09:05:58 -050056 ${power_setting}= Set Variable ${600}
57
58 REST Power On stack_mode=skip
59
60 Activate DCMI Power And Verify
61
62 Set DCMI Power Limit And Verify ${power_setting}
63
64 # Deactivate and check limit
65 Deactivate DCMI Power And Verify
66
67 ${cmd}= Catenate dcmi power set_limit limit 500
68 Run External IPMI Standard Command ${cmd}
69 ${power}= Get DCMI Power Limit
70
Steven Sombar6f72d882017-10-16 07:55:58 -050071 Should Be True ${power} == ${500}
72 ... msg=Could not set power limit when power limiting deactivated.
Steven Sombar43fae662017-09-22 09:05:58 -050073
74
75Escale Check Settings System On Then Off
Steven Sombar433b5262017-09-28 11:44:34 -050076 [Documentation] Set power limit and activate power limit before
77 ... BMC state is power on.
Steven Sombar43fae662017-09-22 09:05:58 -050078 [Tags] Escale_Check_Settings_System_On_Then_Off
79
Steven Sombar43fae662017-09-22 09:05:58 -050080 ${power_setting}= Set Variable ${800}
81
82 REST Power On stack_mode=skip
83
84 Set DCMI Power Limit And Verify ${power_setting}
85 Deactivate DCMI Power And Verify
86
87 ${power}= Get DCMI Power Limit
88 Should Be True ${power} == ${power_setting}
89 ... msg=dcmi power limit not set to ${power_setting} as expected.
90
91 Smart Power Off
92
93 Activate DCMI Power And Verify
94
95 REST Power On
96
97 ${power}= Get DCMI Power Limit
98 Should Be True ${power} == ${power_setting}
99 ... msg=Power limit setting of watts not retained at Runtime.
100
101 Set DCMI Power Limit And Verify 0
102 Deactivate DCMI Power And Verify
103
104
105Escale Check Settings System Off Then On
Steven Sombar433b5262017-09-28 11:44:34 -0500106 [Documentation] Set and activate power limit with system power off.
Steven Sombar43fae662017-09-22 09:05:58 -0500107 [Tags] Escale_Check_Settings_System_Off_Then_On
108
Steven Sombar43fae662017-09-22 09:05:58 -0500109 ${power_setting}= Set Variable ${500}
110
111 Smart Power Off
112
113 # Check that DCMI power limiting is deactivated and that the initial
114 # power limit setting = 0.
115 Fail If DCMI Power Is Not Deactivated
116 ${power}= Get DCMI Power Limit
117 Should Be True ${power} == ${0}
118 ... msg=Initial dcmi power limit should be zero.
119
120 Activate DCMI Power And Verify
121 Set DCMI Power Limit And Verify ${power_setting}
122
123 REST Power On
124
125 Fail If DCMI Power Is Not Activated
126
127 ${power}= Get DCMI Power Limit
128 Should Be True ${power} == ${power_setting}
129 ... msg=Power limit setting not retained at Runtime.
130
131
132Escale Change Limit At Runtime
Steven Sombar433b5262017-09-28 11:44:34 -0500133 [Documentation] Change power limit at runtime.
Steven Sombar43fae662017-09-22 09:05:58 -0500134 [Tags] Escale_Change_Limit_At_Runtime
135
Steven Sombar43fae662017-09-22 09:05:58 -0500136 ${power_setting}= Set Variable ${600}
137
138 Smart Power Off
139
140 Set DCMI Power Limit And Verify ${power_setting}
141 Activate DCMI Power And Verify
142
143 REST Power On stack_mode=skip
144
145 # Check that DCMI power limit setting = ${power_setting}.
146 ${power}= Get DCMI Power Limit
147 Should Be True ${power} == ${power_setting}
148 ... msg=DCMI power limit not set to ${power_setting} watts as expected.
149
150 Set DCMI Power Limit And Verify 800
151
152
153Escale Disable And Enable At Runtime
Steven Sombar433b5262017-09-28 11:44:34 -0500154 [Documentation] Disable/enable power limit at runtime.
Steven Sombar43fae662017-09-22 09:05:58 -0500155 [Tags] Escale_Disable_And_Enable_At_Runtime
156
Steven Sombar43fae662017-09-22 09:05:58 -0500157 ${power_setting}= Set Variable ${500}
158
159 Smart Power Off
160
161 Set DCMI Power Limit And Verify ${power_setting}
162 Activate DCMI Power And Verify
163
164 # Power on the system.
165 REST Power On
166
167 # Check that DCMI power limit setting = ${power_setting}.
168 ${power}= Get DCMI Power Limit
169 Should Be True ${power} == ${power_setting}
170 ... msg=DCMI power limit not set to ${power_setting} watts as expected.
171
172 Deactivate DCMI Power And Verify
173
174 Activate DCMI Power And Verify
175
176 ${power}= Get DCMI Power Limit
177 Should Be True ${power} == ${power_setting}
178 ... msg=DCMI power limit not set to ${power_setting} watts as expected.
179
180
181*** Keywords ***
182
183
184Suite Setup Execution
185 [Documentation] Do test setup initialization.
186 # Power Off if system if not already off.
187 # Deactivate power and set limit = 0.
188 Smart Power Off
189 Deactivate DCMI Power And Verify
190 Set DCMI Power Limit And Verify 0
191
192
193Test Teardown Execution
194 [Documentation] Do the post test teardown.
195 # FFDC on test case fail.
196 # Power off the OS and wait for power off state.
197 # Set deactivated DCMI power enablement and power limit = 0.
198
199 FFDC On Test Case Fail
200 Smart Power Off
201 Deactivate DCMI Power And Verify
202 Set DCMI Power Limit And Verify 0