blob: a64453bd1d6645581945c6f750d4bd5eeff47aab [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
Sridevi Ramesh1699d372016-12-06 00:20:22 -06008Resource ../../lib/resource.txt
George Keishing0da47e92017-10-23 02:22:29 -05009Resource ../../lib/state_manager.robot
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060010
11Suite Setup Open Connection And Log In
12Suite Teardown Close All Connections
Sweta Potthuri8b8f0092017-12-20 09:38:55 -060013Test Teardown Test Teardown Execution
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060014
15*** Test Cases ***
16
17IPMI Chassis Status On
Sridevi Ramesh1699d372016-12-06 00:20:22 -060018 [Documentation] This test case verfies system power on status
19 ... using IPMI Get Chassis status command.
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060020 [Tags] IPMI_Chassis_Status_On
21
George Keishing0da47e92017-10-23 02:22:29 -050022 Initiate Host Boot
Sridevi Ramesh1699d372016-12-06 00:20:22 -060023 ${resp}= Run IPMI Standard Command chassis status
24 ${power_status}= Get Lines Containing String ${resp} System Power
25 Should Contain ${power_status} on
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060026
27IPMI Chassis Status Off
Sridevi Ramesh1699d372016-12-06 00:20:22 -060028 [Documentation] This test case verfies system power off status
29 ... using IPMI Get Chassis status command.
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060030 [Tags] IPMI_Chassis_Status_Off
31
George Keishing0da47e92017-10-23 02:22:29 -050032 Initiate Host PowerOff
Sridevi Ramesh1699d372016-12-06 00:20:22 -060033 ${resp}= Run IPMI Standard Command chassis status
34 ${power_status}= Get Lines Containing String ${resp} System Power
35 Should Contain ${power_status} off
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060036
Sridevi Ramesh1699d372016-12-06 00:20:22 -060037IPMI Chassis Restore Power Policy
38 [Documentation] Verfy IPMI chassis restore power policy.
Sridevi Ramesh1699d372016-12-06 00:20:22 -060039 [Tags] IPMI_Chassis_Restore_Power_Policy
40
Sweta Potthuri8b8f0092017-12-20 09:38:55 -060041 ${initial_power_policy}= Read Attribute
42 ... ${CONTROL_HOST_URI}/power_restore_policy PowerRestorePolicy
Sridevi Ramesh1699d372016-12-06 00:20:22 -060043
George Keishing220b9a92017-08-21 23:37:36 -050044 Set BMC Power Policy ${ALWAYS_POWER_ON}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060045 ${resp}= Run IPMI Standard Command chassis status
46 ${power_status}=
47 ... Get Lines Containing String ${resp} Power Restore Policy
48 Should Contain ${power_status} always-on
49
George Keishing0da47e92017-10-23 02:22:29 -050050 Set BMC Power Policy ${RESTORE_LAST_STATE}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060051 ${resp}= Run IPMI Standard Command chassis status
52 ${power_status}=
53 ... Get Lines Containing String ${resp} Power Restore Policy
54 Should Contain ${power_status} previous
55
George Keishing220b9a92017-08-21 23:37:36 -050056 Set BMC Power Policy ${ALWAYS_POWER_OFF}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060057 ${resp}= Run IPMI Standard Command chassis status
58 ${power_status}=
59 ... Get Lines Containing String ${resp} Power Restore Policy
60 Should Contain ${power_status} always-off
61
62 Set BMC Power Policy ${initial_power_policy}
Sweta Potthuri8b8f0092017-12-20 09:38:55 -060063 ${power_policy}= Read Attribute
64 ... ${CONTROL_HOST_URI}/power_restore_policy PowerRestorePolicy
Sridevi Ramesh1699d372016-12-06 00:20:22 -060065 Should Be Equal ${power_policy} ${initial_power_policy}
66
Sridevi Ramesh7fe3dc02017-05-10 04:01:56 -050067Verify Host PowerOn Via IPMI
68 [Documentation] Verify host power on status using external IPMI command.
69 [Tags] Verify_Host_PowerOn_Via_IPMI
70
71 Initiate Host Boot Via External IPMI
72
73Verify Host PowerOff Via IPMI
74 [Documentation] Verify host power off status using external IPMI command.
75 [Tags] Verify_Host_PowerOff_Via_IPMI
76
77 Initiate Host PowerOff Via External IPMI
78
79
Sridevi Ramesh1699d372016-12-06 00:20:22 -060080*** Keywords ***
81
Sweta Potthuri8b8f0092017-12-20 09:38:55 -060082Test Teardown Execution
Sridevi Ramesh1699d372016-12-06 00:20:22 -060083 [Documentation] Log FFDC if test failed.
84
George Keishingefc3ff22017-12-12 11:49:25 -060085 Set BMC Power Policy ${ALWAYS_POWER_OFF}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060086
87 FFDC On Test Case Fail