Steven Sombar | 43fae66 | 2017-09-22 09:05:58 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Energy scale power capping tests. |
| 3 | |
Steven Sombar | 433b526 | 2017-09-28 11:44:34 -0500 | [diff] [blame] | 4 | |
| 5 | # Acronyms |
| 6 | # PL Power Limit |
| 7 | # OCC On Chip Controller |
| 8 | |
| 9 | |
| 10 | Resource ../lib/energy_scale_utils.robot |
| 11 | Resource ../lib/rest_client.robot |
| 12 | Resource ../lib/openbmc_ffdc.robot |
| 13 | Resource ../lib/boot_utils.robot |
| 14 | Resource ../lib/ipmi_client.robot |
Steven Sombar | 43fae66 | 2017-09-22 09:05:58 -0500 | [diff] [blame] | 15 | |
| 16 | Suite Setup Suite Setup Execution |
| 17 | Test Teardown Test Teardown Execution |
| 18 | |
| 19 | |
| 20 | *** Test Cases *** |
| 21 | |
| 22 | |
| 23 | Escale System On And PL Enabled |
Steven Sombar | 433b526 | 2017-09-28 11:44:34 -0500 | [diff] [blame] | 24 | [Documentation] Change active power limit with system power on and |
| 25 | ... Power limit active. |
Steven Sombar | 43fae66 | 2017-09-22 09:05:58 -0500 | [diff] [blame] | 26 | [Tags] Escale_System_On_And_PL_Enabled |
| 27 | |
Steven Sombar | 43fae66 | 2017-09-22 09:05:58 -0500 | [diff] [blame] | 28 | 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 | |
| 51 | Escale System On And PL Disabled |
George Keishing | 56f3350 | 2017-10-16 02:12:46 -0500 | [diff] [blame] | 52 | [Documentation] Change active power limit with system power on and |
Steven Sombar | 433b526 | 2017-09-28 11:44:34 -0500 | [diff] [blame] | 53 | ... deactivate power limit prior to change. |
Steven Sombar | 43fae66 | 2017-09-22 09:05:58 -0500 | [diff] [blame] | 54 | [Tags] Escale_System_On_And_PL_Disabled |
| 55 | |
Steven Sombar | 43fae66 | 2017-09-22 09:05:58 -0500 | [diff] [blame] | 56 | ${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 Sombar | 6f72d88 | 2017-10-16 07:55:58 -0500 | [diff] [blame] | 71 | Should Be True ${power} == ${500} |
| 72 | ... msg=Could not set power limit when power limiting deactivated. |
Steven Sombar | 43fae66 | 2017-09-22 09:05:58 -0500 | [diff] [blame] | 73 | |
| 74 | |
| 75 | Escale Check Settings System On Then Off |
Steven Sombar | 433b526 | 2017-09-28 11:44:34 -0500 | [diff] [blame] | 76 | [Documentation] Set power limit and activate power limit before |
| 77 | ... BMC state is power on. |
Steven Sombar | 43fae66 | 2017-09-22 09:05:58 -0500 | [diff] [blame] | 78 | [Tags] Escale_Check_Settings_System_On_Then_Off |
| 79 | |
Steven Sombar | 43fae66 | 2017-09-22 09:05:58 -0500 | [diff] [blame] | 80 | ${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 | |
| 105 | Escale Check Settings System Off Then On |
Steven Sombar | 433b526 | 2017-09-28 11:44:34 -0500 | [diff] [blame] | 106 | [Documentation] Set and activate power limit with system power off. |
Steven Sombar | 43fae66 | 2017-09-22 09:05:58 -0500 | [diff] [blame] | 107 | [Tags] Escale_Check_Settings_System_Off_Then_On |
| 108 | |
Steven Sombar | 43fae66 | 2017-09-22 09:05:58 -0500 | [diff] [blame] | 109 | ${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 | |
| 132 | Escale Change Limit At Runtime |
Steven Sombar | 433b526 | 2017-09-28 11:44:34 -0500 | [diff] [blame] | 133 | [Documentation] Change power limit at runtime. |
Steven Sombar | 43fae66 | 2017-09-22 09:05:58 -0500 | [diff] [blame] | 134 | [Tags] Escale_Change_Limit_At_Runtime |
| 135 | |
Steven Sombar | 43fae66 | 2017-09-22 09:05:58 -0500 | [diff] [blame] | 136 | ${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 | |
| 153 | Escale Disable And Enable At Runtime |
Steven Sombar | 433b526 | 2017-09-28 11:44:34 -0500 | [diff] [blame] | 154 | [Documentation] Disable/enable power limit at runtime. |
Steven Sombar | 43fae66 | 2017-09-22 09:05:58 -0500 | [diff] [blame] | 155 | [Tags] Escale_Disable_And_Enable_At_Runtime |
| 156 | |
Steven Sombar | 43fae66 | 2017-09-22 09:05:58 -0500 | [diff] [blame] | 157 | ${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 | |
| 184 | Suite 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 | |
| 193 | Test 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 |