blob: 27c69554020b3c4fcdb4356a82c1e97c8b79d19c [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
12Suite Setup Open Connection And Log In
13Suite Teardown Close All Connections
Sweta Potthuri8b8f0092017-12-20 09:38:55 -060014Test Teardown Test Teardown Execution
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060015
16*** Test Cases ***
17
18IPMI Chassis Status On
Sridevi Ramesh1699d372016-12-06 00:20:22 -060019 [Documentation] This test case verfies system power on status
20 ... using IPMI Get Chassis status command.
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060021 [Tags] IPMI_Chassis_Status_On
22
George Keishing0da47e92017-10-23 02:22:29 -050023 Initiate Host Boot
Sridevi Ramesh1699d372016-12-06 00:20:22 -060024 ${resp}= Run IPMI Standard Command chassis status
25 ${power_status}= Get Lines Containing String ${resp} System Power
26 Should Contain ${power_status} on
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060027
28IPMI Chassis Status Off
Sridevi Ramesh1699d372016-12-06 00:20:22 -060029 [Documentation] This test case verfies system power off status
30 ... using IPMI Get Chassis status command.
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060031 [Tags] IPMI_Chassis_Status_Off
32
George Keishing0da47e92017-10-23 02:22:29 -050033 Initiate Host PowerOff
Sridevi Ramesh1699d372016-12-06 00:20:22 -060034 ${resp}= Run IPMI Standard Command chassis status
35 ${power_status}= Get Lines Containing String ${resp} System Power
36 Should Contain ${power_status} off
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060037
Sridevi Ramesh1699d372016-12-06 00:20:22 -060038IPMI Chassis Restore Power Policy
39 [Documentation] Verfy IPMI chassis restore power policy.
Sridevi Ramesh1699d372016-12-06 00:20:22 -060040 [Tags] IPMI_Chassis_Restore_Power_Policy
41
Sweta Potthuri8b8f0092017-12-20 09:38:55 -060042 ${initial_power_policy}= Read Attribute
43 ... ${CONTROL_HOST_URI}/power_restore_policy PowerRestorePolicy
Sridevi Ramesh1699d372016-12-06 00:20:22 -060044
George Keishing220b9a92017-08-21 23:37:36 -050045 Set BMC Power Policy ${ALWAYS_POWER_ON}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060046 ${resp}= Run IPMI Standard Command chassis status
47 ${power_status}=
48 ... Get Lines Containing String ${resp} Power Restore Policy
49 Should Contain ${power_status} always-on
50
George Keishing0da47e92017-10-23 02:22:29 -050051 Set BMC Power Policy ${RESTORE_LAST_STATE}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060052 ${resp}= Run IPMI Standard Command chassis status
53 ${power_status}=
54 ... Get Lines Containing String ${resp} Power Restore Policy
55 Should Contain ${power_status} previous
56
George Keishing220b9a92017-08-21 23:37:36 -050057 Set BMC Power Policy ${ALWAYS_POWER_OFF}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060058 ${resp}= Run IPMI Standard Command chassis status
59 ${power_status}=
60 ... Get Lines Containing String ${resp} Power Restore Policy
61 Should Contain ${power_status} always-off
62
63 Set BMC Power Policy ${initial_power_policy}
Sweta Potthuri8b8f0092017-12-20 09:38:55 -060064 ${power_policy}= Read Attribute
65 ... ${CONTROL_HOST_URI}/power_restore_policy PowerRestorePolicy
Sridevi Ramesh1699d372016-12-06 00:20:22 -060066 Should Be Equal ${power_policy} ${initial_power_policy}
67
Sridevi Ramesh7fe3dc02017-05-10 04:01:56 -050068Verify Host PowerOn Via IPMI
69 [Documentation] Verify host power on status using external IPMI command.
70 [Tags] Verify_Host_PowerOn_Via_IPMI
71
72 Initiate Host Boot Via External IPMI
73
74Verify Host PowerOff Via IPMI
75 [Documentation] Verify host power off status using external IPMI command.
76 [Tags] Verify_Host_PowerOff_Via_IPMI
77
78 Initiate Host PowerOff Via External IPMI
79
Manash Sarmaf8c40752018-03-13 16:38:16 +053080Verify Soft Shutdown via IPMI
81 [Documentation] Verify Host OS shutdown softly using IPMI command.
82 [Tags] Verify_Soft_Shutdown_via_IPMI
83
84 REST Power On stack_mode=skip
85 Run External IPMI Standard Command chassis power soft
86 Wait Until Keyword Succeeds 3 min 10 sec Is Host Off
87
Sridevi Ramesh7fe3dc02017-05-10 04:01:56 -050088
Sridevi Ramesh1699d372016-12-06 00:20:22 -060089*** Keywords ***
90
Sweta Potthuri8b8f0092017-12-20 09:38:55 -060091Test Teardown Execution
Sridevi Ramesh1699d372016-12-06 00:20:22 -060092 [Documentation] Log FFDC if test failed.
93
George Keishingefc3ff22017-12-12 11:49:25 -060094 Set BMC Power Policy ${ALWAYS_POWER_OFF}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060095
96 FFDC On Test Case Fail