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