Steven Sombar | fc4d575 | 2017-11-28 11:56:35 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Energy scale base tests. |
| 3 | |
| 4 | |
| 5 | # Test Parameters: |
| 6 | # OPENBMC_HOST The BMC host name or IP address. |
| 7 | |
| 8 | |
| 9 | Resource ../lib/energy_scale_utils.robot |
| 10 | Resource ../lib/openbmc_ffdc.robot |
| 11 | |
| 12 | |
| 13 | Suite Setup Suite Setup Execution |
| 14 | Test 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 Sombar | c435102 | 2018-01-15 13:47:38 -0600 | [diff] [blame] | 26 | # The power limits shown above are documented at |
Steven Sombar | fc4d575 | 2017-11-28 11:56:35 -0600 | [diff] [blame] | 27 | # open-power/witherspoon-xml/master/witherspoon.xml. |
| 28 | |
| 29 | |
Steven Sombar | fc4d575 | 2017-11-28 11:56:35 -0600 | [diff] [blame] | 30 | *** Test Cases *** |
| 31 | |
| 32 | |
| 33 | Escale 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 | |
| 41 | Escale Base Test Active Monitoring |
Steven Sombar | c435102 | 2018-01-15 13:47:38 -0600 | [diff] [blame] | 42 | [Documentation] Run base power tests with DCMI power monitoring on. |
Steven Sombar | fc4d575 | 2017-11-28 11:56:35 -0600 | [diff] [blame] | 43 | [Tags] Escale_Base_Test_Active_Monitoring |
| 44 | |
| 45 | Activate DCMI Power And Verify |
| 46 | Verify Power Limits |
| 47 | |
| 48 | |
Steven Sombar | c435102 | 2018-01-15 13:47:38 -0600 | [diff] [blame] | 49 | Escale 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 | |
| 65 | Escale 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 | |
| 81 | Escale 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 | |
| 90 | Escale 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 Sombar | fc4d575 | 2017-11-28 11:56:35 -0600 | [diff] [blame] | 98 | |
| 99 | *** Keywords *** |
| 100 | |
| 101 | |
| 102 | Verify 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 | |
| 111 | Test 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 | |
| 128 | Suite 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 | |
| 144 | Test Teardown Execution |
| 145 | [Documentation] Do the post test teardown. |
| 146 | |
| 147 | FFDC On Test Case Fail |
| 148 | |
Gunnar Mills | 948e2e2 | 2018-03-23 12:54:27 -0500 | [diff] [blame] | 149 | # Restore the system's initial power limit setting. |
Steven Sombar | fc4d575 | 2017-11-28 11:56:35 -0600 | [diff] [blame] | 150 | Run Keyword If '${initial_power_setting}' != '${0}' |
| 151 | ... Set DCMI Power Limit And Verify ${initial_power_setting} |
| 152 | |
Gunnar Mills | 948e2e2 | 2018-03-23 12:54:27 -0500 | [diff] [blame] | 153 | # Restore the system's initial deactivation/activation setting. |
Steven Sombar | fc4d575 | 2017-11-28 11:56:35 -0600 | [diff] [blame] | 154 | Run Keyword If '${initial_deactivation}' == '${1}' |
| 155 | ... Deactivate DCMI Power And Verify ELSE Activate DCMI Power And Verify |