blob: de70a8208c87ec96c76fea0b4a786f12c53e3853 [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
Sridevi Ramesh6da9c992016-11-23 04:26:25 -06009
10Suite Setup Open Connection And Log In
11Suite Teardown Close All Connections
Sridevi Ramesh1699d372016-12-06 00:20:22 -060012Test Teardown Test Exit Logs
13
14*** Variables ***
15${HOST_SETTING} ${SETTINGS_URI}host0
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060016
17*** Test Cases ***
18
19IPMI Chassis Status On
Sridevi Ramesh1699d372016-12-06 00:20:22 -060020 [Documentation] This test case verfies system power on status
21 ... using IPMI Get Chassis status command.
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060022 [Tags] IPMI_Chassis_Status_On
23
24 Initiate Power On
Sridevi Ramesh1699d372016-12-06 00:20:22 -060025 ${resp}= Run IPMI Standard Command chassis status
26 ${power_status}= Get Lines Containing String ${resp} System Power
27 Should Contain ${power_status} on
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060028
29IPMI Chassis Status Off
Sridevi Ramesh1699d372016-12-06 00:20:22 -060030 [Documentation] This test case verfies system power off status
31 ... using IPMI Get Chassis status command.
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060032 [Tags] IPMI_Chassis_Status_Off
33
34 Initiate Power Off
Sridevi Ramesh1699d372016-12-06 00:20:22 -060035 ${resp}= Run IPMI Standard Command chassis status
36 ${power_status}= Get Lines Containing String ${resp} System Power
37 Should Contain ${power_status} off
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060038
Sridevi Ramesh1699d372016-12-06 00:20:22 -060039IPMI Chassis Restore Power Policy
40 [Documentation] Verfy IPMI chassis restore power policy.
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060041
Sridevi Ramesh1699d372016-12-06 00:20:22 -060042 [Tags] IPMI_Chassis_Restore_Power_Policy
43
44 ${initial_power_policy}= Read Attribute ${HOST_SETTING} power_policy
45
46 Set BMC Power Policy ALWAYS_POWER_ON
47 ${resp}= Run IPMI Standard Command chassis status
48 ${power_status}=
49 ... Get Lines Containing String ${resp} Power Restore Policy
50 Should Contain ${power_status} always-on
51
52 Set BMC Power Policy RESTORE_LAST_STATE
53 ${resp}= Run IPMI Standard Command chassis status
54 ${power_status}=
55 ... Get Lines Containing String ${resp} Power Restore Policy
56 Should Contain ${power_status} previous
57
58 Set BMC Power Policy LEAVE_OFF
59 ${resp}= Run IPMI Standard Command chassis status
60 ${power_status}=
61 ... Get Lines Containing String ${resp} Power Restore Policy
62 Should Contain ${power_status} always-off
63
64 Set BMC Power Policy ${initial_power_policy}
65 ${power_policy}= Read Attribute ${HOST_SETTING} power_policy
66 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
80
Sridevi Ramesh1699d372016-12-06 00:20:22 -060081*** Keywords ***
82
83Test Exit Logs
84 [Documentation] Log FFDC if test failed.
85
86 Set BMC Power Policy RESTORE_LAST_STATE
87 ${power_policy}= Read Attribute ${HOST_SETTING} power_policy
88 Should Be Equal ${power_policy} RESTORE_LAST_STATE
89
90 FFDC On Test Case Fail