blob: a3736ed6f8c912bdb214ed7eb346dc15a07b6464 [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
Sridevi Ramesh1699d372016-12-06 00:20:22 -060013Test Teardown Test Exit Logs
14
15*** Variables ***
16${HOST_SETTING} ${SETTINGS_URI}host0
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060017
18*** Test Cases ***
19
20IPMI Chassis Status On
Sridevi Ramesh1699d372016-12-06 00:20:22 -060021 [Documentation] This test case verfies system power on status
22 ... using IPMI Get Chassis status command.
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060023 [Tags] IPMI_Chassis_Status_On
24
George Keishing0da47e92017-10-23 02:22:29 -050025 Initiate Host Boot
Sridevi Ramesh1699d372016-12-06 00:20:22 -060026 ${resp}= Run IPMI Standard Command chassis status
27 ${power_status}= Get Lines Containing String ${resp} System Power
28 Should Contain ${power_status} on
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060029
30IPMI Chassis Status Off
Sridevi Ramesh1699d372016-12-06 00:20:22 -060031 [Documentation] This test case verfies system power off status
32 ... using IPMI Get Chassis status command.
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060033 [Tags] IPMI_Chassis_Status_Off
34
George Keishing0da47e92017-10-23 02:22:29 -050035 Initiate Host PowerOff
Sridevi Ramesh1699d372016-12-06 00:20:22 -060036 ${resp}= Run IPMI Standard Command chassis status
37 ${power_status}= Get Lines Containing String ${resp} System Power
38 Should Contain ${power_status} off
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060039
Sridevi Ramesh1699d372016-12-06 00:20:22 -060040IPMI Chassis Restore Power Policy
41 [Documentation] Verfy IPMI chassis restore power policy.
Sridevi Ramesh6da9c992016-11-23 04:26:25 -060042
Sridevi Ramesh1699d372016-12-06 00:20:22 -060043 [Tags] IPMI_Chassis_Restore_Power_Policy
44
45 ${initial_power_policy}= Read Attribute ${HOST_SETTING} power_policy
46
George Keishing220b9a92017-08-21 23:37:36 -050047 Set BMC Power Policy ${ALWAYS_POWER_ON}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060048 ${resp}= Run IPMI Standard Command chassis status
49 ${power_status}=
50 ... Get Lines Containing String ${resp} Power Restore Policy
51 Should Contain ${power_status} always-on
52
George Keishing0da47e92017-10-23 02:22:29 -050053 Set BMC Power Policy ${RESTORE_LAST_STATE}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060054 ${resp}= Run IPMI Standard Command chassis status
55 ${power_status}=
56 ... Get Lines Containing String ${resp} Power Restore Policy
57 Should Contain ${power_status} previous
58
George Keishing220b9a92017-08-21 23:37:36 -050059 Set BMC Power Policy ${ALWAYS_POWER_OFF}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060060 ${resp}= Run IPMI Standard Command chassis status
61 ${power_status}=
62 ... Get Lines Containing String ${resp} Power Restore Policy
63 Should Contain ${power_status} always-off
64
65 Set BMC Power Policy ${initial_power_policy}
66 ${power_policy}= Read Attribute ${HOST_SETTING} power_policy
67 Should Be Equal ${power_policy} ${initial_power_policy}
68
Sridevi Ramesh7fe3dc02017-05-10 04:01:56 -050069Verify Host PowerOn Via IPMI
70 [Documentation] Verify host power on status using external IPMI command.
71 [Tags] Verify_Host_PowerOn_Via_IPMI
72
73 Initiate Host Boot Via External IPMI
74
75Verify Host PowerOff Via IPMI
76 [Documentation] Verify host power off status using external IPMI command.
77 [Tags] Verify_Host_PowerOff_Via_IPMI
78
79 Initiate Host PowerOff Via External IPMI
80
81
Sridevi Ramesh1699d372016-12-06 00:20:22 -060082*** Keywords ***
83
84Test Exit Logs
85 [Documentation] Log FFDC if test failed.
86
George Keishing0da47e92017-10-23 02:22:29 -050087 Set BMC Power Policy ${RESTORE_LAST_STATE}
Sridevi Ramesh1699d372016-12-06 00:20:22 -060088
89 FFDC On Test Case Fail