xref: /openbmc/openbmc-test-automation/redfish/extended/test_fan_operation.robot (revision 7916eb3fd577eedd3ef934e45bf8b557197c9907)
1*** Settings ***
2
3Documentation  Operational check of fans with OS booted.
4
5# Test Parameters:
6# OPENBMC_HOST       The BMC host name or IP address.
7# OPENBMC_USERNAME   The userID to login to the BMC as.
8# OPENBMC_PASSWORD   The password for OPENBMC_USERNAME.
9#
10# Approximate run time:   18 minutes.
11
12Resource        ../../lib/utils.robot
13Resource        ../../lib/fan_utils.robot
14Resource        ../../lib/dump_utils.robot
15
16
17Suite Setup     Suite Setup Execution
18Test Teardown   Test Teardown Execution
19
20Test Tags       Fan_Operations
21
22*** Test Cases ***
23
24
25Check Number Of Fans With Power On
26    [Documentation]  Verify system has the minimum number of fans.
27    [Tags]  Check_Number_Of_Fans_With_Power_On
28
29    # Determine if system is water cooled.
30    ${water_cooled}=  Is Water Cooled
31    Rprint Vars  water_cooled
32
33    Verify Minimum Number Of Fans With Cooling Type  ${number_of_fans}
34    ...  ${water_cooled}
35
36
37Check Number Of Fan Monitors With Power On
38    [Documentation]  Verify monitors are present when power on.
39    [Tags]  Check_Number_Of_Fan_Monitors_With_Power_On
40
41    Verify Fan Monitors With State  On
42
43
44Check Fans Running At Target Speed
45    [Documentation]  Verify fans are running at or near target speed.
46    [Tags]  Check_Fans_Running_At_Target_Speed
47
48    # Set the speed tolerance criteria.
49    # A tolerance value of .30 means that the fan's speed should be
50    # within 30% of its set target speed.   Fans may be accelerating
51    # or decelerating to meet a new target, so allow .20 extra.
52    ${tolerance}=  Set Variable  .50
53    Rprint Vars  tolerance
54
55    Verify Fan Speed  ${tolerance}  ${fan_names}
56
57
58Check Fan Manual Control
59    [Documentation]  Check direct control of fans.
60    [Tags]  Check_Fan_Manual_Control
61
62    # The maximum target speed.
63    ${max_speed}=  Set Variable  ${10500}
64
65    # Speed criteria for passing, which is 85% of max_speed.
66    ${min_speed}=  Set Variable  ${8925}
67
68    # Time allowed for the fan daemon to take control and then return
69    # the fans to normal speed.
70    ${minutes_to_stabilize}=  Set Variable  4
71
72    Verify Direct Fan Control
73    ...  ${max_speed}  ${min_speed}  ${minutes_to_stabilize}
74    ...  ${number_of_fans}  ${fan_names}
75
76
77Check Fan Speed Increase When One Disabled
78    [Documentation]  Verify that the speed of working fans increase when
79    ...  one fan is disabled.
80    [Tags]  Check_Fan_Speed_Increase_When_One_Disabled
81    #  A non-functional fan should cause an error log and
82    #  an enclosure LED will light.  The other fans should speed up.
83
84    Verify Fan Speed Increase  ${fan_names}
85
86
87Check System Shutdown Due To Fans
88    [Documentation]  Shut down when not enough fans.
89    [Tags]  Check_System_Shutdown_Due_To_Fans
90
91    # Previous test may have shut down the OS.
92    Redfish Power On  stack_mode=skip
93
94    Verify System Shutdown Due To Fans  ${fan_names}
95
96
97*** Keywords ***
98
99Reset Fans And Error Logs
100    [Documentation]  Reset Fans, Error Logs, and LEDs
101
102    Reset Fans  ${fan_names}
103    Run Key U  Sleep \ 15s
104    Delete All Error Logs
105    Redfish Delete All BMC Dumps
106    Set System LED State  front_fault  Off
107    Set System LED State  rear_fault  Off
108
109
110Suite Setup Execution
111    [Documentation]  Do the pre-suite setup.
112
113    Redfish Power On  stack_mode=skip
114
115    ${number_of_fans}  ${fan_names}=  Get Fan Count And Names
116    Printn
117    Rprint Vars  number_of_fans  fan_names
118    Set Suite Variable  ${fan_names}  children=true
119    Set Suite Variable  ${number_of_fans}  children=true
120
121    Reset Fans And Error Logs
122
123
124Test Teardown Execution
125    [Documentation]  Do the post-test teardown.
126
127    FFDC On Test Case Fail
128    Reset Fans And Error Logs
129