blob: 51e08eb501fb6a51e9bafa8b16c1c4b16bbd6f01 [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
26# The power limits are documented at
27# open-power/witherspoon-xml/master/witherspoon.xml.
28
29
30
31*** Test Cases ***
32
33
34Escale Base Test Inactive Monitoring
35 [Documentation] Run base power tests with DCMI power montoring off.
36 [Tags] Escale_Base_Test_Deactive_Monitoring
37
38 Deactivate DCMI Power And Verify
39 Verify Power Limits
40
41
42Escale Base Test Active Monitoring
43 [Documentation] Run base power tests with DCMI power montoring on.
44 [Tags] Escale_Base_Test_Active_Monitoring
45
46 Activate DCMI Power And Verify
47 Verify Power Limits
48
49
50
51*** Keywords ***
52
53
54Verify Power Limits
55 [Documentation] Set power levels and verify limits.
56
57 Set DCMI Power Limit And Verify ${mid_power}
58 Test Power Limit ${min_power} ${below_min_power}
59 Test Power Limit ${min_power} ${zero_power}
60 Test Power Limit ${max_power} ${over_max_power}
61
62
63Test Power Limit
64 [Documentation] Set power and check limit.
65 [Arguments] ${good_power} ${outside_bounds_power}
66
67 # Description of argument(s):
68 # good_power A valid power setting, usually at a limit.
69 # outside_bounds_power A power level that is beyond the limit.
70
71 Set DCMI Power Limit And Verify ${good_power}
72
73 # Try to set out of bounds.
74 ${expected_error}= Set Variable
75 ... Failed setting dcmi power limit to ${outside_bounds_power} watts.
76 Run Keyword and Expect Error ${expected_error}
77 ... Set DCMI Power Limit And Verify ${outside_bounds_power}
78
79
80Suite Setup Execution
81 [Documentation] Do test setup initialization.
82
83 # Save the deactivation/activation setting.
84 ${cmd}= Catenate dcmi power get_limit | grep State
85 ${resp}= Run External IPMI Standard Command ${cmd}
86 # Response is either "Power Limit Active" or "No Active Power Limit".
87 ${initial_deactivation}= Get Count ${resp} No
88 # If deactivated: initial_deactivation = 1, 0 otherwise.
89 Set Suite Variable ${initial_deactivation} children=true
90
91 # Save the power limit setting.
92 ${initial_power_setting}= Get DCMI Power Limit
93 Set Suite Variable ${initial_power_setting} children=true
94
95
96Test Teardown Execution
97 [Documentation] Do the post test teardown.
98
99 FFDC On Test Case Fail
100
101 # Restore the system's intial power limit setting.
102 Run Keyword If '${initial_power_setting}' != '${0}'
103 ... Set DCMI Power Limit And Verify ${initial_power_setting}
104
105 # Restore the system's intial deactivation/activation setting.
106 Run Keyword If '${initial_deactivation}' == '${1}'
107 ... Deactivate DCMI Power And Verify ELSE Activate DCMI Power And Verify