blob: cef699e3eb21541c63048dee0558b65f81c32a61 [file] [log] [blame]
Sridevi Ramesh6da9c992016-11-23 04:26:25 -06001*** Settings ***
2Documentation This suite tests IPMI chassis status in Open BMC.
3
4Resource ../../lib/rest_client.robot
5Resource ../../lib/ipmi_client.robot
6Resource ../../lib/openbmc_ffdc.robot
7Resource ../../lib/utils.robot
Manash Sarmaf8c40752018-03-13 16:38:16 +05308Resource ../../lib/boot_utils.robot
Sandhya Somashekar839a0c22019-01-31 05:05:43 -06009Resource ../../lib/resource.robot
George Keishing0da47e92017-10-23 02:22:29 -050010Resource ../../lib/state_manager.robot
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060011
Sweta Potthuri8b8f0092017-12-20 09:38:55 -060012Test Teardown Test Teardown Execution
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060013
14*** Test Cases ***
15
Sridevi Ramesh1699d372016-12-06 00:20:22 -060016IPMI Chassis Restore Power Policy
George Keishingcb3b9b62018-09-14 12:11:19 -050017 [Documentation] Verify IPMI chassis restore power policy.
Sridevi Ramesh1699d372016-12-06 00:20:22 -060018 [Tags] IPMI_Chassis_Restore_Power_Policy
19
Sweta Potthuri8b8f0092017-12-20 09:38:55 -060020 ${initial_power_policy}= Read Attribute
21 ... ${CONTROL_HOST_URI}/power_restore_policy PowerRestorePolicy
Sridevi Ramesh1699d372016-12-06 00:20:22 -060022
George Keishing220b9a92017-08-21 23:37:36 -050023 Set BMC Power Policy ${ALWAYS_POWER_ON}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060024 ${resp}= Run IPMI Standard Command chassis status
25 ${power_status}=
26 ... Get Lines Containing String ${resp} Power Restore Policy
27 Should Contain ${power_status} always-on
28
George Keishing0da47e92017-10-23 02:22:29 -050029 Set BMC Power Policy ${RESTORE_LAST_STATE}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060030 ${resp}= Run IPMI Standard Command chassis status
31 ${power_status}=
32 ... Get Lines Containing String ${resp} Power Restore Policy
33 Should Contain ${power_status} previous
34
George Keishing220b9a92017-08-21 23:37:36 -050035 Set BMC Power Policy ${ALWAYS_POWER_OFF}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060036 ${resp}= Run IPMI Standard Command chassis status
37 ${power_status}=
38 ... Get Lines Containing String ${resp} Power Restore Policy
39 Should Contain ${power_status} always-off
40
41 Set BMC Power Policy ${initial_power_policy}
Sweta Potthuri8b8f0092017-12-20 09:38:55 -060042 ${power_policy}= Read Attribute
43 ... ${CONTROL_HOST_URI}/power_restore_policy PowerRestorePolicy
Sridevi Ramesh1699d372016-12-06 00:20:22 -060044 Should Be Equal ${power_policy} ${initial_power_policy}
45
Manash Sarmaf8c40752018-03-13 16:38:16 +053046Verify Soft Shutdown via IPMI
47 [Documentation] Verify Host OS shutdown softly using IPMI command.
48 [Tags] Verify_Soft_Shutdown_via_IPMI
49
50 REST Power On stack_mode=skip
Rahul Maheshwarid8037d32018-12-17 00:59:57 -060051 Run IPMI Standard Command chassis power soft
Manash Sarmaf8c40752018-03-13 16:38:16 +053052 Wait Until Keyword Succeeds 3 min 10 sec Is Host Off
53
Sridevi Ramesh7fe3dc02017-05-10 04:01:56 -050054
Sridevi Ramesh1699d372016-12-06 00:20:22 -060055*** Keywords ***
56
Sweta Potthuri8b8f0092017-12-20 09:38:55 -060057Test Teardown Execution
Sridevi Ramesh1699d372016-12-06 00:20:22 -060058 [Documentation] Log FFDC if test failed.
59
George Keishingefc3ff22017-12-12 11:49:25 -060060 Set BMC Power Policy ${ALWAYS_POWER_OFF}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060061
62 FFDC On Test Case Fail