Marissa Garza | 9f3d3aa | 2019-11-06 15:02:44 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
George Keishing | 2691262 | 2019-11-13 12:35:06 -0600 | [diff] [blame] | 3 | Documentation Test Suite for Supported Fan Modules. |
Marissa Garza | 9f3d3aa | 2019-11-06 15:02:44 -0600 | [diff] [blame] | 4 | |
| 5 | Resource ../../lib/rest_client.robot |
| 6 | Resource ../../lib/bmc_redfish_resource.robot |
| 7 | Resource ../../lib/bmc_redfish_utils.robot |
| 8 | Resource ../../lib/openbmc_ffdc.robot |
| 9 | Resource ../../lib/resource.robot |
| 10 | Resource ../../lib/boot_utils.robot |
| 11 | Library ../../lib/gen_robot_valid.py |
| 12 | Library ../../lib/gen_robot_keyword.py |
| 13 | |
| 14 | Suite Setup Suite Setup Execution |
| 15 | Suite Teardown Suite Teardown Execution |
| 16 | Test Setup Printn |
| 17 | Test Teardown Test Teardown Execution |
| 18 | |
| 19 | |
| 20 | *** Variables *** |
| 21 | |
| 22 | @{VALID_MODE_VALUES} DEFAULT CUSTOM HEAVY_IO MAX_BASE_FAN_FLOOR |
| 23 | |
| 24 | |
| 25 | *** Test Cases *** |
| 26 | |
| 27 | Verify Current Fan Thermal Mode |
| 28 | [Documentation] Check current thermal fan mode is a valid mode value. |
| 29 | [Tags] Verify_Current_Fan_Thermal_Mode |
| 30 | |
| 31 | # Example: |
| 32 | # /xyz/openbmc_project/control/thermal/0 |
| 33 | # |
| 34 | # Response code:200, Content: { |
| 35 | # "data": { |
| 36 | # "Current": "DEFAULT", |
| 37 | # "Supported": [ |
| 38 | # "DEFAULT", |
| 39 | # "CUSTOM", |
| 40 | # "HEAVY_IO", |
| 41 | # "MAX_BASE_FAN_FLOOR" |
| 42 | # }, |
| 43 | # }, |
| 44 | # "message": "200 OK", |
| 45 | # "status": "ok" |
| 46 | # } |
| 47 | |
| 48 | ${current}= Read Attribute ${THERMAL_CONTROL_URI} Current |
| 49 | Rprint Vars current |
| 50 | |
| 51 | Valid Value current valid_values=${VALID_MODE_VALUES} |
| 52 | |
| 53 | |
| 54 | Verify Supported Fan Thermal Modes Available |
| 55 | [Documentation] Check supported fan thermal modes are valid mode values. |
| 56 | [Tags] Verify_Supported_Fan_Thermal_Modes_Available |
| 57 | |
| 58 | ${supported}= Read Attribute ${THERMAL_CONTROL_URI} Supported |
| 59 | Rprint Vars supported |
| 60 | |
| 61 | Valid List supported valid_values=${VALID_MODE_VALUES} |
| 62 | |
| 63 | |
| 64 | Verify Supported Fan Thermal Modes Switch At Standby |
| 65 | [Documentation] Check that supported modes are set successfully at standby. |
| 66 | [Tags] Verify_Supported_Fan_Thermal_Modes_Switch_At_Standby |
| 67 | [Template] Set and Verify Thermal Mode Switches |
| 68 | |
| 69 | # pre_req_state thermal_mode_type |
| 70 | Off DEFAULT |
| 71 | Off CUSTOM |
| 72 | Off HEAVY_IO |
| 73 | Off MAX_BASE_FAN_FLOOR |
| 74 | |
| 75 | |
| 76 | Verify Supported Fan Thermal Modes Switch At Runtime |
| 77 | [Documentation] Check that supported modes are set successfully at runtime. |
| 78 | [Tags] Verify_Supported_Fan_Thermal_Modes_Switch_At_Runtime |
| 79 | [Template] Set and Verify Thermal Mode Switches |
| 80 | |
| 81 | # pre_req_state thermal_mode |
| 82 | On DEFAULT |
| 83 | On CUSTOM |
| 84 | On HEAVY_IO |
| 85 | On MAX_BASE_FAN_FLOOR |
| 86 | |
| 87 | |
George Keishing | f188e4a | 2020-02-17 12:40:58 -0600 | [diff] [blame] | 88 | Verify Supported Fan Thermal Mode Remains Set After Boot |
Marissa Garza | 9f3d3aa | 2019-11-06 15:02:44 -0600 | [diff] [blame] | 89 | [Documentation] Check that supported modes remain set at runtime. |
George Keishing | f188e4a | 2020-02-17 12:40:58 -0600 | [diff] [blame] | 90 | [Tags] Verify_Supported_Fan_Thermal_Mode_Remains_Set_After_Boot |
| 91 | [Template] Set and Verify Thermal Mode After Boot |
Marissa Garza | 9f3d3aa | 2019-11-06 15:02:44 -0600 | [diff] [blame] | 92 | |
| 93 | # pre_req_state thermal_mode_type |
| 94 | Off DEFAULT |
| 95 | Off CUSTOM |
| 96 | Off HEAVY_IO |
| 97 | Off MAX_BASE_FAN_FLOOR |
| 98 | |
| 99 | |
| 100 | *** Keywords *** |
| 101 | |
| 102 | Set and Verify Thermal Mode Switches |
| 103 | [Documentation] Verify the thermal mode switches successfully at standby or runtime. |
| 104 | [Arguments] ${pre_req_state} ${thermal_mode} |
| 105 | |
| 106 | # Description of Arguments(s): |
| 107 | # thermal_mode Read the supported thermal mode (e.g. "CUSTOM") |
| 108 | # pre_req_state Set the state of the host to Standby or Runtime (e.g. "Running") |
| 109 | |
| 110 | Run Key U Redfish Power ${pre_req_state} \ stack_mode=skip \ quiet=1 |
| 111 | Redfish.Login |
| 112 | |
| 113 | ${mode}= Redfish.Put ${THERMAL_CONTROL_URI}/attr/Current body={"data": "${thermal_mode}"} |
| 114 | |
| 115 | ${current}= Read Attribute ${THERMAL_CONTROL_URI} Current |
| 116 | Should Be Equal As Strings ${thermal_mode} ${current} |
| 117 | ... msg=The thermal mode does not match the current fan mode. |
| 118 | Rprint Vars current |
| 119 | |
| 120 | |
George Keishing | f188e4a | 2020-02-17 12:40:58 -0600 | [diff] [blame] | 121 | Set and Verify Thermal Mode After Boot |
Marissa Garza | 9f3d3aa | 2019-11-06 15:02:44 -0600 | [diff] [blame] | 122 | [Documentation] Verify the thermal mode remains set at runtime. |
| 123 | [Arguments] ${pre_req_state} ${thermal_mode} |
| 124 | |
| 125 | Set and Verify Thermal Mode Switches ${pre_req_state} ${thermal_mode} |
| 126 | |
| 127 | Run Key U Redfish Power On \ stack_mode=normal \ quiet=1 |
| 128 | Redfish.Login |
| 129 | |
| 130 | ${current}= Read Attribute ${THERMAL_CONTROL_URI} Current |
| 131 | Should Be Equal As Strings ${thermal_mode} ${current} |
| 132 | ... msg=The current thermal fan mode switched successfully. |
| 133 | Rprint Vars current |
| 134 | |
| 135 | |
| 136 | Suite Teardown Execution |
| 137 | [Documentation] Do the post suite teardown. |
| 138 | |
| 139 | Redfish.Logout |
| 140 | |
| 141 | |
| 142 | Suite Setup Execution |
| 143 | [Documentation] Do test case setup tasks. |
| 144 | |
| 145 | Printn |
| 146 | Redfish.Login |
| 147 | |
| 148 | |
| 149 | Test Teardown Execution |
| 150 | [Documentation] Do the post test teardown. |
| 151 | |
| 152 | FFDC On Test Case Fail |