blob: dba226713109423cc268176ec70ed47784096fe7 [file] [log] [blame]
Marissa Garzae98ac0c2019-04-05 08:31:29 -05001*** Settings ***
2
3Documentation 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
13Resource ../lib/state_manager.robot
14Resource ../lib/rest_client.robot
15Resource ../lib/fan_utils.robot
16Resource ../lib/utils.robot
17Resource ../lib/openbmc_ffdc.robot
18Resource ../syslib/utils_os.robot
19Library ../syslib/utils_keywords.py
20Library ../syslib/utils_os.py
21Library ../lib/gen_robot_valid.py
22
23Test Setup Open Connection And Log In
Marissa Garza43e26032019-05-14 11:29:05 -050024Suite Setup Suite Setup Execution
Marissa Garzae98ac0c2019-04-05 08:31:29 -050025Test Teardown FFDC On Test Case Fail
Marissa Garza43e26032019-05-14 11:29:05 -050026Suite Teardown Suite Teardown Execution
Marissa Garzae98ac0c2019-04-05 08:31:29 -050027
28
29*** Variables ***
30
31@{VALID_MODE_VALUES} DEFAULT CUSTOM
32
33
34*** Test Cases ***
35
Marissa Garza43e26032019-05-14 11:29:05 -050036Switch To Thermal Mode
37 [Documentation] Change thermal modes on the system.
38 [Tags] Switch_To_Thermal_Mode
Marissa Garzae98ac0c2019-04-05 08:31:29 -050039
Marissa Garza43e26032019-05-14 11:29:05 -050040 ${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 Garzae98ac0c2019-04-05 08:31:29 -050048
49 ${current}= Read Attribute ${CONTROL_URI}thermal/0 current
50 Rprint Vars current
Marissa Garza43e26032019-05-14 11:29:05 -050051 Should Be Equal As Strings ${current} CUSTOM
52 ... msg=Thermal mode setting was changed by reboot to the OS.
Marissa Garzae98ac0c2019-04-05 08:31:29 -050053
54
Marissa Garza43e26032019-05-14 11:29:05 -050055*** Keywords ***
56
57Suite Setup Execution
58 [Documentation] Do suite setup tasks.
59
60 REST Power On stack_mode=skip
Marissa Garzae98ac0c2019-04-05 08:31:29 -050061
62 ${supported}= Read Attribute ${CONTROL_URI}thermal/0 supported
Marissa Garza43e26032019-05-14 11:29:05 -050063 ${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
69Suite 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