blob: 5cccc6c21e992ee5976466a5f3600f99ebf2aca1 [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
68*** Keywords ***
69
70Test Exit Logs
71 [Documentation] Log FFDC if test failed.
72
73 Set BMC Power Policy RESTORE_LAST_STATE
74 ${power_policy}= Read Attribute ${HOST_SETTING} power_policy
75 Should Be Equal ${power_policy} RESTORE_LAST_STATE
76
77 FFDC On Test Case Fail