blob: 91f6afeb199cfc66d01ccad6a1bfdfabd205c667 [file] [log] [blame]
Rahul Maheshwari07d91d22019-07-31 01:12:05 -05001*** Settings ***
2
3Documentation Module to test IPMI chassis functionality.
4Resource ../lib/ipmi_client.robot
5Resource ../lib/openbmc_ffdc.robot
George Keishing6f395fd2021-08-18 02:18:53 -05006Resource ../lib/boot_utils.robot
Rahul Maheshwarif724a002020-02-21 05:17:02 -06007Library ../lib/ipmi_utils.py
Rahul Maheshwari07d91d22019-07-31 01:12:05 -05008
George Keishing2d0edad2021-08-18 11:44:10 -05009Suite Setup Redfish.Login
10Suite Teardown Redfish.Logout
Rahul Maheshwari07d91d22019-07-31 01:12:05 -050011Test Teardown FFDC On Test Case Fail
12
13*** Test Cases ***
14
15IPMI Chassis Status On
16 [Documentation] This test case verfies system power on status
17 ... using IPMI Get Chassis status command.
18 [Tags] IPMI_Chassis_Status_On
19
20 Redfish Power On stack_mode=skip quiet=1
21 ${resp}= Run IPMI Standard Command chassis status
22 ${power_status}= Get Lines Containing String ${resp} System Power
23 Should Contain ${power_status} on
24
25IPMI Chassis Status Off
26 [Documentation] This test case verfies system power off status
27 ... using IPMI Get Chassis status command.
28 [Tags] IPMI_Chassis_Status_Off
29
30 Redfish Power Off stack_mode=skip quiet=1
31 ${resp}= Run IPMI Standard Command chassis status
32 ${power_status}= Get Lines Containing String ${resp} System Power
33 Should Contain ${power_status} off
Sushma M M1cc21272020-01-05 23:47:46 -060034
35Verify Host PowerOff Via IPMI
36 [Documentation] Verify host power off operation using external IPMI command.
37 [Tags] Verify_Host_PowerOff_Via_IPMI
38
39 IPMI Power Off
40 ${ipmi_state}= Get Host State Via External IPMI
41 Valid Value ipmi_state ['off']
42
43Verify Host PowerOn Via IPMI
44 [Documentation] Verify host power on operation using external IPMI command.
45 [Tags] Verify_Host_PowerOn_Via_IPMI
46
47 IPMI Power On
48 ${ipmi_state}= Get Host State Via External IPMI
Rahul Maheshwari460778d2020-02-23 22:37:22 -060049 Valid Value ipmi_state ['on']
50
51
52Verify Soft Shutdown
53 [Documentation] Verify host OS shutdown softly via IPMI command.
George Keishingfba5ad92021-11-08 02:52:35 -060054 [Tags] Verify_Soft_Shutdown
Rahul Maheshwari460778d2020-02-23 22:37:22 -060055
56 Redfish Power On stack_mode=skip
57 Run IPMI Standard Command chassis power soft
58 Wait Until Keyword Succeeds 3 min 10 sec Is Host Off Via IPMI
59
Rahul Maheshwarif724a002020-02-21 05:17:02 -060060
61Verify Chassis Power Policy
62 [Documentation] Verify setting chassis power policy via IPMI command.
63 [Tags] Verify_Chassis_Power_Policy
64 [Setup] Test Setup Execution
65 [Teardown] Run Keywords FFDC On Test Case Fail AND
66 ... Run IPMI Standard Command chassis policy ${initial_power_policy}
67 [Template] Set Chassis Power Policy Via IPMI And Verify
68
69 # power_policy
70 always-off
71 always-on
72 previous
73
74
75*** Keywords ***
76
77Set Chassis Power Policy Via IPMI And Verify
78 [Documentation] Set chasiss power policy via IPMI and verify.
79 [Arguments] ${power_policy}
80
81 # Description of argument(s):
82 # power_policy Chassis power policy to be set(e.g. "always-off", "always-on").
83
84 Run IPMI Standard Command chassis policy ${power_policy}
85 ${resp}= Get Chassis Status
86 Valid Value resp['power_restore_policy'] ['${power_policy}']
87
88
89Test Setup Execution
90 [Documentation] Do test setup tasks.
91
92 ${chassis_status}= Get Chassis Status
93 Set Test Variable ${initial_power_policy} ${chassis_status['power_restore_policy']}
94