blob: 94fa8a8cfc7e0c8fa92da848b88e65cd27f5d631 [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
Sridevi Ramesh7fe3dc02017-05-10 04:01:56 -050046Verify Host PowerOn Via IPMI
47 [Documentation] Verify host power on status using external IPMI command.
48 [Tags] Verify_Host_PowerOn_Via_IPMI
49
50 Initiate Host Boot Via External IPMI
51
52Verify Host PowerOff Via IPMI
53 [Documentation] Verify host power off status using external IPMI command.
54 [Tags] Verify_Host_PowerOff_Via_IPMI
55
56 Initiate Host PowerOff Via External IPMI
57
Manash Sarmaf8c40752018-03-13 16:38:16 +053058Verify Soft Shutdown via IPMI
59 [Documentation] Verify Host OS shutdown softly using IPMI command.
60 [Tags] Verify_Soft_Shutdown_via_IPMI
61
62 REST Power On stack_mode=skip
Rahul Maheshwarid8037d32018-12-17 00:59:57 -060063 Run IPMI Standard Command chassis power soft
Manash Sarmaf8c40752018-03-13 16:38:16 +053064 Wait Until Keyword Succeeds 3 min 10 sec Is Host Off
65
Sridevi Ramesh7fe3dc02017-05-10 04:01:56 -050066
Sridevi Ramesh1699d372016-12-06 00:20:22 -060067*** Keywords ***
68
Sweta Potthuri8b8f0092017-12-20 09:38:55 -060069Test Teardown Execution
Sridevi Ramesh1699d372016-12-06 00:20:22 -060070 [Documentation] Log FFDC if test failed.
71
George Keishingefc3ff22017-12-12 11:49:25 -060072 Set BMC Power Policy ${ALWAYS_POWER_OFF}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060073
74 FFDC On Test Case Fail