blob: d78164c5adc4aca41156740e7278e818058bd0c8 [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
9Test Teardown FFDC On Test Case Fail
10
11*** Test Cases ***
12
13IPMI Chassis Status On
14 [Documentation] This test case verfies system power on status
15 ... using IPMI Get Chassis status command.
16 [Tags] IPMI_Chassis_Status_On
17
18 Redfish Power On stack_mode=skip quiet=1
19 ${resp}= Run IPMI Standard Command chassis status
20 ${power_status}= Get Lines Containing String ${resp} System Power
21 Should Contain ${power_status} on
22
23IPMI Chassis Status Off
24 [Documentation] This test case verfies system power off status
25 ... using IPMI Get Chassis status command.
26 [Tags] IPMI_Chassis_Status_Off
27
28 Redfish Power Off stack_mode=skip quiet=1
29 ${resp}= Run IPMI Standard Command chassis status
30 ${power_status}= Get Lines Containing String ${resp} System Power
31 Should Contain ${power_status} off
Sushma M M1cc21272020-01-05 23:47:46 -060032
33Verify Host PowerOff Via IPMI
34 [Documentation] Verify host power off operation using external IPMI command.
35 [Tags] Verify_Host_PowerOff_Via_IPMI
36
37 IPMI Power Off
38 ${ipmi_state}= Get Host State Via External IPMI
39 Valid Value ipmi_state ['off']
40
41Verify Host PowerOn Via IPMI
42 [Documentation] Verify host power on operation using external IPMI command.
43 [Tags] Verify_Host_PowerOn_Via_IPMI
44
45 IPMI Power On
46 ${ipmi_state}= Get Host State Via External IPMI
Rahul Maheshwari460778d2020-02-23 22:37:22 -060047 Valid Value ipmi_state ['on']
48
49
50Verify Soft Shutdown
51 [Documentation] Verify host OS shutdown softly via IPMI command.
52 [Tags] Verify_Soft_Stutdown
53
54 Redfish Power On stack_mode=skip
55 Run IPMI Standard Command chassis power soft
56 Wait Until Keyword Succeeds 3 min 10 sec Is Host Off Via IPMI
57
Rahul Maheshwarif724a002020-02-21 05:17:02 -060058
59Verify Chassis Power Policy
60 [Documentation] Verify setting chassis power policy via IPMI command.
61 [Tags] Verify_Chassis_Power_Policy
62 [Setup] Test Setup Execution
63 [Teardown] Run Keywords FFDC On Test Case Fail AND
64 ... Run IPMI Standard Command chassis policy ${initial_power_policy}
65 [Template] Set Chassis Power Policy Via IPMI And Verify
66
67 # power_policy
68 always-off
69 always-on
70 previous
71
72
73*** Keywords ***
74
75Set Chassis Power Policy Via IPMI And Verify
76 [Documentation] Set chasiss power policy via IPMI and verify.
77 [Arguments] ${power_policy}
78
79 # Description of argument(s):
80 # power_policy Chassis power policy to be set(e.g. "always-off", "always-on").
81
82 Run IPMI Standard Command chassis policy ${power_policy}
83 ${resp}= Get Chassis Status
84 Valid Value resp['power_restore_policy'] ['${power_policy}']
85
86
87Test Setup Execution
88 [Documentation] Do test setup tasks.
89
90 ${chassis_status}= Get Chassis Status
91 Set Test Variable ${initial_power_policy} ${chassis_status['power_restore_policy']}
92