Marissa Garza | e98ac0c | 2019-04-05 08:31:29 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation Test Suite for Suppported Fan Modules. |
| 4 | |
| 5 | # Test Parameters: |
| 6 | # OPENBMC_HOST The BMC host name or IP address. |
| 7 | # OPENBMC_USERNAME The username to login to the BMC. |
| 8 | # OPENBMC_PASSWORD The password for OPENBMC_USERNAME. |
| 9 | # OS_HOST The OS host name or IP Address. |
| 10 | # OS_USERNAME The OS login userid (usually root). |
| 11 | # OS_PASSWORD The password for the OS login. |
| 12 | |
| 13 | Resource ../lib/state_manager.robot |
| 14 | Resource ../lib/rest_client.robot |
| 15 | Resource ../lib/fan_utils.robot |
| 16 | Resource ../lib/utils.robot |
| 17 | Resource ../lib/openbmc_ffdc.robot |
| 18 | Resource ../syslib/utils_os.robot |
| 19 | Library ../syslib/utils_keywords.py |
| 20 | Library ../syslib/utils_os.py |
| 21 | Library ../lib/gen_robot_valid.py |
| 22 | |
| 23 | Test Setup Open Connection And Log In |
Marissa Garza | 43e2603 | 2019-05-14 11:29:05 -0500 | [diff] [blame] | 24 | Suite Setup Suite Setup Execution |
Marissa Garza | e98ac0c | 2019-04-05 08:31:29 -0500 | [diff] [blame] | 25 | Test Teardown FFDC On Test Case Fail |
Marissa Garza | 43e2603 | 2019-05-14 11:29:05 -0500 | [diff] [blame] | 26 | Suite Teardown Suite Teardown Execution |
Marissa Garza | e98ac0c | 2019-04-05 08:31:29 -0500 | [diff] [blame] | 27 | |
| 28 | |
| 29 | *** Variables *** |
| 30 | |
| 31 | @{VALID_MODE_VALUES} DEFAULT CUSTOM |
| 32 | |
| 33 | |
| 34 | *** Test Cases *** |
| 35 | |
Marissa Garza | 43e2603 | 2019-05-14 11:29:05 -0500 | [diff] [blame] | 36 | Switch To Thermal Mode |
| 37 | [Documentation] Change thermal modes on the system. |
| 38 | [Tags] Switch_To_Thermal_Mode |
Marissa Garza | e98ac0c | 2019-04-05 08:31:29 -0500 | [diff] [blame] | 39 | |
Marissa Garza | 43e2603 | 2019-05-14 11:29:05 -0500 | [diff] [blame] | 40 | ${value_dict}= Create Dictionary data=CUSTOM |
| 41 | ${expected_value}= Set Variable If 'CUSTOM' in ${supported} CUSTOM DEFAULT |
| 42 | Write Attribute ${CONTROL_URI}thermal/0 current verify=${True} |
| 43 | ... expected_value=${expected_value} data=${value_dict} |
| 44 | |
| 45 | Pass Execution If 'CUSTOM' not in ${supported} Custom mode not supported |
| 46 | |
| 47 | REST Power On stack_mode=normal |
Marissa Garza | e98ac0c | 2019-04-05 08:31:29 -0500 | [diff] [blame] | 48 | |
| 49 | ${current}= Read Attribute ${CONTROL_URI}thermal/0 current |
| 50 | Rprint Vars current |
Marissa Garza | 43e2603 | 2019-05-14 11:29:05 -0500 | [diff] [blame] | 51 | Should Be Equal As Strings ${current} CUSTOM |
| 52 | ... msg=Thermal mode setting was changed by reboot to the OS. |
Marissa Garza | e98ac0c | 2019-04-05 08:31:29 -0500 | [diff] [blame] | 53 | |
| 54 | |
Marissa Garza | 43e2603 | 2019-05-14 11:29:05 -0500 | [diff] [blame] | 55 | *** Keywords *** |
| 56 | |
| 57 | Suite Setup Execution |
| 58 | [Documentation] Do suite setup tasks. |
| 59 | |
| 60 | REST Power On stack_mode=skip |
Marissa Garza | e98ac0c | 2019-04-05 08:31:29 -0500 | [diff] [blame] | 61 | |
| 62 | ${supported}= Read Attribute ${CONTROL_URI}thermal/0 supported |
Marissa Garza | 43e2603 | 2019-05-14 11:29:05 -0500 | [diff] [blame] | 63 | ${current}= Read Attribute ${CONTROL_URI}thermal/0 current |
| 64 | Rprint Vars supported current |
| 65 | |
| 66 | Set Suite Variable ${supported} |
| 67 | Set Suite Variable ${current} |
| 68 | |
| 69 | Suite Teardown Execution |
| 70 | [Documentation] Do the post suite teardown. |
| 71 | |
| 72 | ${supported}= Read Attribute ${CONTROL_URI}thermal/0 supported |
| 73 | ${current}= Read Attribute ${CONTROL_URI}thermal/0 current |
| 74 | Rprint Vars supported current |
| 75 | |
| 76 | # If CUSTOM mode is not supported, no cleanup needed. |
| 77 | Return From Keyword If 'CUSTOM' not in ${supported} |
| 78 | |
| 79 | # If DEFAULT mode currently set, no cleanup needed. |
| 80 | Return From Keyword If '${current}' == 'DEFAULT' |
| 81 | |
| 82 | # Restore the DEFAULT setting. |
| 83 | ${value_dict}= Create Dictionary data=DEFAULT |
| 84 | Write Attribute ${CONTROL_URI}thermal/0 current verify=${True} |
| 85 | ... data=${value_dict} |
| 86 | |
| 87 | # Reboot system required for change take effect. |
| 88 | REST Power On stack_mode=normal |