blob: 4907ae2163bc9268a34c041e386507692ac68db7 [file] [log] [blame]
Steven Sombarfc4d5752017-11-28 11:56:35 -06001*** Settings ***
2Documentation Energy scale base tests.
3
4
5# Test Parameters:
6# OPENBMC_HOST The BMC host name or IP address.
7
8
9Resource ../lib/energy_scale_utils.robot
10Resource ../lib/openbmc_ffdc.robot
11
12
13Suite Setup Suite Setup Execution
14Test Teardown Test Teardown Execution
15
16
17
18*** Variables ****
19
20${over_max_power} 3051
21${max_power} 3050
22${mid_power} 1950
23${min_power} 500
24${below_min_power} 499
25${zero_power} 0
Steven Sombarc4351022018-01-15 13:47:38 -060026# The power limits shown above are documented at
Steven Sombarfc4d5752017-11-28 11:56:35 -060027# open-power/witherspoon-xml/master/witherspoon.xml.
28
29
Steven Sombarfc4d5752017-11-28 11:56:35 -060030*** Test Cases ***
31
32
33Escale Base Test Inactive Monitoring
34 [Documentation] Run base power tests with DCMI power montoring off.
35 [Tags] Escale_Base_Test_Deactive_Monitoring
36
37 Deactivate DCMI Power And Verify
38 Verify Power Limits
39
40
41Escale Base Test Active Monitoring
Steven Sombarc4351022018-01-15 13:47:38 -060042 [Documentation] Run base power tests with DCMI power monitoring on.
Steven Sombarfc4d5752017-11-28 11:56:35 -060043 [Tags] Escale_Base_Test_Active_Monitoring
44
45 Activate DCMI Power And Verify
46 Verify Power Limits
47
48
Steven Sombarc4351022018-01-15 13:47:38 -060049Escale Power Setting Via REST And Verify
50 [Documentation] Set power via REST and check using IPMI.
51 [Tags] Escale_Power_Setting_Via_REST_And_Verify
52
53 # A convenient power level bewtwwn maximum and minimum.
54 ${test_power}= Set Variable 1700
55
56 # Set the power limit via REST.
57 Set DCMI Power Limit Via REST ${test_power}
58
59 # Read the power limit using IPMI.
60 ${power_limit}= Get DCMI Power Limit
61 Should Be True ${power_limit} == ${test_power}
62 ... msg=Reading Power limit with IPMI failed after setting it with REST.
63
64
65Escale Power Setting Via IPMI And Verify
66 [Documentation] Set power via IPMI then check via REST.
67 [Tags] Escale_Power_Setting_Via_IPMI_And_Verify
68
69 # A convenient power level bewtwwn maximum and minimum.
70 ${test_power}= Set Variable 2200
71
72 # Set DCMI Power via IPMI.
73 Set DCMI Power Limit And Verify ${test_power}
74
75 # Read the limit via REST.
76 ${power_limit}= Get DCMI Power Limit Via REST
77 Should Be True ${power_limit} == ${test_power}
78 ... msg=Reading power limit with REST failed after setting it with IPMI.
79
80
81Escale Activation Test Via REST
82 [Documentation] Activate power monitoring via REST then check via IPMI.
83 [Tags] Escale_Activation_Test_Via_REST
84
85 Activate DCMI Power Via REST
86 # Confirm activation state using IPMI.
87 Fail If DCMI Power Is Not Activated
88
89
90Escale Dectivation Test Via REST
91 [Documentation] Deactivate power monitoring via REST and check via IPMI.
92 [Tags] Escale_Deactivation_Test_Via_REST
93
94 Deactivate DCMI Power Via REST
95 # Confirm activation state using IPMI.
96 Fail If DCMI Power Is Not Deactivated
97
Steven Sombarfc4d5752017-11-28 11:56:35 -060098
99*** Keywords ***
100
101
102Verify Power Limits
103 [Documentation] Set power levels and verify limits.
104
105 Set DCMI Power Limit And Verify ${mid_power}
106 Test Power Limit ${min_power} ${below_min_power}
107 Test Power Limit ${min_power} ${zero_power}
108 Test Power Limit ${max_power} ${over_max_power}
109
110
111Test Power Limit
112 [Documentation] Set power and check limit.
113 [Arguments] ${good_power} ${outside_bounds_power}
114
115 # Description of argument(s):
116 # good_power A valid power setting, usually at a limit.
117 # outside_bounds_power A power level that is beyond the limit.
118
119 Set DCMI Power Limit And Verify ${good_power}
120
121 # Try to set out of bounds.
122 ${expected_error}= Set Variable
123 ... Failed setting dcmi power limit to ${outside_bounds_power} watts.
124 Run Keyword and Expect Error ${expected_error}
125 ... Set DCMI Power Limit And Verify ${outside_bounds_power}
126
127
128Suite Setup Execution
129 [Documentation] Do test setup initialization.
130
131 # Save the deactivation/activation setting.
132 ${cmd}= Catenate dcmi power get_limit | grep State
133 ${resp}= Run External IPMI Standard Command ${cmd}
134 # Response is either "Power Limit Active" or "No Active Power Limit".
135 ${initial_deactivation}= Get Count ${resp} No
136 # If deactivated: initial_deactivation = 1, 0 otherwise.
137 Set Suite Variable ${initial_deactivation} children=true
138
139 # Save the power limit setting.
140 ${initial_power_setting}= Get DCMI Power Limit
141 Set Suite Variable ${initial_power_setting} children=true
142
143
144Test Teardown Execution
145 [Documentation] Do the post test teardown.
146
147 FFDC On Test Case Fail
148
149 # Restore the system's intial power limit setting.
150 Run Keyword If '${initial_power_setting}' != '${0}'
151 ... Set DCMI Power Limit And Verify ${initial_power_setting}
152
153 # Restore the system's intial deactivation/activation setting.
154 Run Keyword If '${initial_deactivation}' == '${1}'
155 ... Deactivate DCMI Power And Verify ELSE Activate DCMI Power And Verify