Sridevi Ramesh | 6da9c99 | 2016-11-23 04:26:25 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This suite tests IPMI chassis status in Open BMC. |
| 3 | |
| 4 | Resource ../../lib/rest_client.robot |
| 5 | Resource ../../lib/ipmi_client.robot |
| 6 | Resource ../../lib/openbmc_ffdc.robot |
| 7 | Resource ../../lib/utils.robot |
Manash Sarma | f8c4075 | 2018-03-13 16:38:16 +0530 | [diff] [blame] | 8 | Resource ../../lib/boot_utils.robot |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 9 | Resource ../../lib/resource.txt |
George Keishing | 0da47e9 | 2017-10-23 02:22:29 -0500 | [diff] [blame] | 10 | Resource ../../lib/state_manager.robot |
Sridevi Ramesh | 6da9c99 | 2016-11-23 04:26:25 -0600 | [diff] [blame] | 11 | |
Sweta Potthuri | 8b8f009 | 2017-12-20 09:38:55 -0600 | [diff] [blame] | 12 | Test Teardown Test Teardown Execution |
Sridevi Ramesh | 6da9c99 | 2016-11-23 04:26:25 -0600 | [diff] [blame] | 13 | |
| 14 | *** Test Cases *** |
| 15 | |
| 16 | IPMI Chassis Status On |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 17 | [Documentation] This test case verfies system power on status |
| 18 | ... using IPMI Get Chassis status command. |
Sridevi Ramesh | 6da9c99 | 2016-11-23 04:26:25 -0600 | [diff] [blame] | 19 | [Tags] IPMI_Chassis_Status_On |
| 20 | |
George Keishing | 0da47e9 | 2017-10-23 02:22:29 -0500 | [diff] [blame] | 21 | Initiate Host Boot |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 22 | ${resp}= Run IPMI Standard Command chassis status |
| 23 | ${power_status}= Get Lines Containing String ${resp} System Power |
| 24 | Should Contain ${power_status} on |
Sridevi Ramesh | 6da9c99 | 2016-11-23 04:26:25 -0600 | [diff] [blame] | 25 | |
| 26 | IPMI Chassis Status Off |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 27 | [Documentation] This test case verfies system power off status |
| 28 | ... using IPMI Get Chassis status command. |
Sridevi Ramesh | 6da9c99 | 2016-11-23 04:26:25 -0600 | [diff] [blame] | 29 | [Tags] IPMI_Chassis_Status_Off |
| 30 | |
George Keishing | 0da47e9 | 2017-10-23 02:22:29 -0500 | [diff] [blame] | 31 | Initiate Host PowerOff |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 32 | ${resp}= Run IPMI Standard Command chassis status |
| 33 | ${power_status}= Get Lines Containing String ${resp} System Power |
| 34 | Should Contain ${power_status} off |
Sridevi Ramesh | 6da9c99 | 2016-11-23 04:26:25 -0600 | [diff] [blame] | 35 | |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 36 | IPMI Chassis Restore Power Policy |
George Keishing | cb3b9b6 | 2018-09-14 12:11:19 -0500 | [diff] [blame] | 37 | [Documentation] Verify IPMI chassis restore power policy. |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 38 | [Tags] IPMI_Chassis_Restore_Power_Policy |
| 39 | |
Sweta Potthuri | 8b8f009 | 2017-12-20 09:38:55 -0600 | [diff] [blame] | 40 | ${initial_power_policy}= Read Attribute |
| 41 | ... ${CONTROL_HOST_URI}/power_restore_policy PowerRestorePolicy |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 42 | |
George Keishing | 220b9a9 | 2017-08-21 23:37:36 -0500 | [diff] [blame] | 43 | Set BMC Power Policy ${ALWAYS_POWER_ON} |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 44 | ${resp}= Run IPMI Standard Command chassis status |
| 45 | ${power_status}= |
| 46 | ... Get Lines Containing String ${resp} Power Restore Policy |
| 47 | Should Contain ${power_status} always-on |
| 48 | |
George Keishing | 0da47e9 | 2017-10-23 02:22:29 -0500 | [diff] [blame] | 49 | Set BMC Power Policy ${RESTORE_LAST_STATE} |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 50 | ${resp}= Run IPMI Standard Command chassis status |
| 51 | ${power_status}= |
| 52 | ... Get Lines Containing String ${resp} Power Restore Policy |
| 53 | Should Contain ${power_status} previous |
| 54 | |
George Keishing | 220b9a9 | 2017-08-21 23:37:36 -0500 | [diff] [blame] | 55 | Set BMC Power Policy ${ALWAYS_POWER_OFF} |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 56 | ${resp}= Run IPMI Standard Command chassis status |
| 57 | ${power_status}= |
| 58 | ... Get Lines Containing String ${resp} Power Restore Policy |
| 59 | Should Contain ${power_status} always-off |
| 60 | |
| 61 | Set BMC Power Policy ${initial_power_policy} |
Sweta Potthuri | 8b8f009 | 2017-12-20 09:38:55 -0600 | [diff] [blame] | 62 | ${power_policy}= Read Attribute |
| 63 | ... ${CONTROL_HOST_URI}/power_restore_policy PowerRestorePolicy |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 64 | Should Be Equal ${power_policy} ${initial_power_policy} |
| 65 | |
Sridevi Ramesh | 7fe3dc0 | 2017-05-10 04:01:56 -0500 | [diff] [blame] | 66 | Verify Host PowerOn Via IPMI |
| 67 | [Documentation] Verify host power on status using external IPMI command. |
| 68 | [Tags] Verify_Host_PowerOn_Via_IPMI |
| 69 | |
| 70 | Initiate Host Boot Via External IPMI |
| 71 | |
| 72 | Verify Host PowerOff Via IPMI |
| 73 | [Documentation] Verify host power off status using external IPMI command. |
| 74 | [Tags] Verify_Host_PowerOff_Via_IPMI |
| 75 | |
| 76 | Initiate Host PowerOff Via External IPMI |
| 77 | |
Manash Sarma | f8c4075 | 2018-03-13 16:38:16 +0530 | [diff] [blame] | 78 | Verify Soft Shutdown via IPMI |
| 79 | [Documentation] Verify Host OS shutdown softly using IPMI command. |
| 80 | [Tags] Verify_Soft_Shutdown_via_IPMI |
| 81 | |
| 82 | REST Power On stack_mode=skip |
Rahul Maheshwari | d8037d3 | 2018-12-17 00:59:57 -0600 | [diff] [blame] | 83 | Run IPMI Standard Command chassis power soft |
Manash Sarma | f8c4075 | 2018-03-13 16:38:16 +0530 | [diff] [blame] | 84 | Wait Until Keyword Succeeds 3 min 10 sec Is Host Off |
| 85 | |
Sridevi Ramesh | 7fe3dc0 | 2017-05-10 04:01:56 -0500 | [diff] [blame] | 86 | |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 87 | *** Keywords *** |
| 88 | |
Sweta Potthuri | 8b8f009 | 2017-12-20 09:38:55 -0600 | [diff] [blame] | 89 | Test Teardown Execution |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 90 | [Documentation] Log FFDC if test failed. |
| 91 | |
George Keishing | efc3ff2 | 2017-12-12 11:49:25 -0600 | [diff] [blame] | 92 | Set BMC Power Policy ${ALWAYS_POWER_OFF} |
Sridevi Ramesh | 1699d37 | 2016-12-06 00:20:22 -0600 | [diff] [blame] | 93 | |
| 94 | FFDC On Test Case Fail |