blob: 1430c12c5cbd34564c8aa50bd7005aaa53bb2bd3 [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
Sridevi Ramesh1699d372016-12-06 00:20:22 -06009Resource ../../lib/resource.txt
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
16IPMI Chassis Status On
Sridevi Ramesh1699d372016-12-06 00:20:22 -060017 [Documentation] This test case verfies system power on status
18 ... using IPMI Get Chassis status command.
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060019 [Tags] IPMI_Chassis_Status_On
20
George Keishing0da47e92017-10-23 02:22:29 -050021 Initiate Host Boot
Sridevi Ramesh1699d372016-12-06 00:20:22 -060022 ${resp}= Run IPMI Standard Command chassis status
23 ${power_status}= Get Lines Containing String ${resp} System Power
24 Should Contain ${power_status} on
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060025
26IPMI Chassis Status Off
Sridevi Ramesh1699d372016-12-06 00:20:22 -060027 [Documentation] This test case verfies system power off status
28 ... using IPMI Get Chassis status command.
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060029 [Tags] IPMI_Chassis_Status_Off
30
George Keishing0da47e92017-10-23 02:22:29 -050031 Initiate Host PowerOff
Sridevi Ramesh1699d372016-12-06 00:20:22 -060032 ${resp}= Run IPMI Standard Command chassis status
33 ${power_status}= Get Lines Containing String ${resp} System Power
34 Should Contain ${power_status} off
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060035
Sridevi Ramesh1699d372016-12-06 00:20:22 -060036IPMI Chassis Restore Power Policy
George Keishingcb3b9b62018-09-14 12:11:19 -050037 [Documentation] Verify IPMI chassis restore power policy.
Sridevi Ramesh1699d372016-12-06 00:20:22 -060038 [Tags] IPMI_Chassis_Restore_Power_Policy
39
Sweta Potthuri8b8f0092017-12-20 09:38:55 -060040 ${initial_power_policy}= Read Attribute
41 ... ${CONTROL_HOST_URI}/power_restore_policy PowerRestorePolicy
Sridevi Ramesh1699d372016-12-06 00:20:22 -060042
George Keishing220b9a92017-08-21 23:37:36 -050043 Set BMC Power Policy ${ALWAYS_POWER_ON}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060044 ${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 Keishing0da47e92017-10-23 02:22:29 -050049 Set BMC Power Policy ${RESTORE_LAST_STATE}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060050 ${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 Keishing220b9a92017-08-21 23:37:36 -050055 Set BMC Power Policy ${ALWAYS_POWER_OFF}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060056 ${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 Potthuri8b8f0092017-12-20 09:38:55 -060062 ${power_policy}= Read Attribute
63 ... ${CONTROL_HOST_URI}/power_restore_policy PowerRestorePolicy
Sridevi Ramesh1699d372016-12-06 00:20:22 -060064 Should Be Equal ${power_policy} ${initial_power_policy}
65
Sridevi Ramesh7fe3dc02017-05-10 04:01:56 -050066Verify 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
72Verify 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 Sarmaf8c40752018-03-13 16:38:16 +053078Verify 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 Maheshwarid8037d32018-12-17 00:59:57 -060083 Run IPMI Standard Command chassis power soft
Manash Sarmaf8c40752018-03-13 16:38:16 +053084 Wait Until Keyword Succeeds 3 min 10 sec Is Host Off
85
Sridevi Ramesh7fe3dc02017-05-10 04:01:56 -050086
Sridevi Ramesh1699d372016-12-06 00:20:22 -060087*** Keywords ***
88
Sweta Potthuri8b8f0092017-12-20 09:38:55 -060089Test Teardown Execution
Sridevi Ramesh1699d372016-12-06 00:20:22 -060090 [Documentation] Log FFDC if test failed.
91
George Keishingefc3ff22017-12-12 11:49:25 -060092 Set BMC Power Policy ${ALWAYS_POWER_OFF}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060093
94 FFDC On Test Case Fail