Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
George Keishing | 6b59f1d | 2016-10-12 04:14:53 -0500 | [diff] [blame] | 2 | Documentation This suite verifies the power restore policy supported by |
| 3 | ... REST Interfaces. |
| 4 | ... Refer here for documentation on the REST interfaces |
| 5 | ... https://github.com/openbmc/docs/blob/master/rest-api.md |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 6 | |
| 7 | Resource ../lib/rest_client.robot |
| 8 | Resource ../lib/pdu/pdu.robot |
| 9 | Resource ../lib/utils.robot |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 10 | Resource ../lib/openbmc_ffdc.robot |
George Keishing | 6b59f1d | 2016-10-12 04:14:53 -0500 | [diff] [blame] | 11 | Resource ../lib/boot/boot_resource_master.robot |
George Keishing | 129f38a | 2017-01-06 01:43:40 -0600 | [diff] [blame] | 12 | Resource ../lib/state_manager.robot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 13 | |
| 14 | |
| 15 | Library SSHLibrary |
| 16 | |
Gunnar Mills | eac1af2 | 2016-11-14 15:30:09 -0600 | [diff] [blame] | 17 | Test Teardown FFDC On Test Case Fail |
causten | 147f575 | 2016-08-11 16:24:45 -0500 | [diff] [blame] | 18 | Force Tags chassisboot bmcreboot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 19 | |
George Keishing | 6b59f1d | 2016-10-12 04:14:53 -0500 | [diff] [blame] | 20 | *** Variables *** |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 21 | |
George Keishing | 6b59f1d | 2016-10-12 04:14:53 -0500 | [diff] [blame] | 22 | *** Test Cases *** |
George Keishing | d277f83 | 2016-10-07 12:04:50 -0500 | [diff] [blame] | 23 | |
George Keishing | 6b59f1d | 2016-10-12 04:14:53 -0500 | [diff] [blame] | 24 | Set the power restore policy |
| 25 | #Policy Expected System State Next System State |
George Keishing | d277f83 | 2016-10-07 12:04:50 -0500 | [diff] [blame] | 26 | |
George Keishing | 129f38a | 2017-01-06 01:43:40 -0600 | [diff] [blame] | 27 | LEAVE_OFF Off Off |
| 28 | LEAVE_OFF Running Off |
| 29 | ALWAYS_POWER_ON Off Running |
| 30 | ALWAYS_POWER_ON Running Running |
| 31 | RESTORE_LAST_STATE Running Running |
| 32 | RESTORE_LAST_STATE Off Off |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 33 | |
George Keishing | 6b59f1d | 2016-10-12 04:14:53 -0500 | [diff] [blame] | 34 | [Documentation] Test to validate restore policy attribute functionality. |
| 35 | ... Policy: |
| 36 | ... System policy to restore on power cycle |
| 37 | ... Expected System State: |
| 38 | ... State where system should be before running the |
| 39 | ... test case |
| 40 | ... Next System State: |
| 41 | ... After power cycle, system should reach this |
| 42 | ... specific state |
| 43 | |
| 44 | [Template] Set Restore Policy |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 45 | |
Gunnar Mills | 7c8923f | 2016-12-12 21:19:52 -0600 | [diff] [blame] | 46 | *** Keywords *** |
George Keishing | 6b59f1d | 2016-10-12 04:14:53 -0500 | [diff] [blame] | 47 | |
| 48 | Set Restore Policy |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 49 | [Arguments] ${policy} ${expectedState} ${nextState} |
George Keishing | 6b59f1d | 2016-10-12 04:14:53 -0500 | [diff] [blame] | 50 | |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 51 | Set BMC Power Policy ${policy} |
George Keishing | 6b59f1d | 2016-10-12 04:14:53 -0500 | [diff] [blame] | 52 | |
George Keishing | 129f38a | 2017-01-06 01:43:40 -0600 | [diff] [blame] | 53 | ${currentState}= Get Host State |
George Keishing | 6b59f1d | 2016-10-12 04:14:53 -0500 | [diff] [blame] | 54 | |
| 55 | Log Current System State= ${currentState} |
| 56 | Log Expected System State= ${expectedState} |
| 57 | Log Next System State= ${nextState} |
| 58 | |
| 59 | Run Keyword If |
| 60 | ... '${currentState}' != '${expectedState}' |
| 61 | ... Set Initial Test State ${expectedState} |
| 62 | |
| 63 | Log "Doing power cycle" |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 64 | PDU Power Cycle |
George Keishing | 129f38a | 2017-01-06 01:43:40 -0600 | [diff] [blame] | 65 | Check If BMC is Up 5 min 10 sec |
George Keishing | 6b59f1d | 2016-10-12 04:14:53 -0500 | [diff] [blame] | 66 | Log "BMC is Online now" |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 67 | |
George Keishing | 6b59f1d | 2016-10-12 04:14:53 -0500 | [diff] [blame] | 68 | Wait Until Keyword Succeeds |
George Keishing | 129f38a | 2017-01-06 01:43:40 -0600 | [diff] [blame] | 69 | ... 5 min 10 sec Is BMC Ready |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 70 | |
| 71 | |
George Keishing | 6b59f1d | 2016-10-12 04:14:53 -0500 | [diff] [blame] | 72 | Set Initial Test State |
| 73 | [Documentation] Poweron if ON expected, Poweroff if OFF expected |
| 74 | ... to initial state of the test. |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 75 | [Arguments] ${expectedState} |
George Keishing | 6b59f1d | 2016-10-12 04:14:53 -0500 | [diff] [blame] | 76 | |
| 77 | Run Keyword If |
George Keishing | 129f38a | 2017-01-06 01:43:40 -0600 | [diff] [blame] | 78 | ... '${expectedState}' == 'Running' |
| 79 | ... Initiate Host Boot |
George Keishing | 6b59f1d | 2016-10-12 04:14:53 -0500 | [diff] [blame] | 80 | |
| 81 | Run Keyword If |
George Keishing | 129f38a | 2017-01-06 01:43:40 -0600 | [diff] [blame] | 82 | ... '${expectedState}' == 'Off' |
| 83 | ... Initiate Host PowerOff |