blob: 7e8e929b7c999303efa99cc37875fd76e104ed81 [file] [log] [blame]
Joy Onyerikwu26975f02018-05-08 12:55:12 -05001*** Settings ***
2
3Documentation Verify that both the air and water cooled systems are
4... operating in the allowable ranges for fans, power and temperature
5... during idle and stress up at the OS.
6
7
8# TEST PARAMETERS:
9# OPENBMC_HOST The BMC host name or IP address.
10# OPENBMC_USERNAME The BMC user name.
11# OPENBMC_PASSWORD The BMC password.
12# OS_HOST The OS host name or IP address.
13# OS_USERNAME The OS user name.
14# OS_PASSWORD The OS Host password.
15# HTX_DURATION Duration of the HTX run (e.g 1h, 20m).
16# HTX_INTERVAL The time delay between consecutive
17# checks for temperature, fan and power
18# ranges.
19# HTX_MDT_PROFILE The MDT Profile to run.
20#
21# The parameters below should be comma-separated lists,
22# (e.g "500,800"). See default ranges below.
23# These ranges can vary based on the type of system under test.
24#
25# FAN_SPEED_RANGE_IDLE The allowable range of fan speeds,
26# expressed as RPMs, when the machine is
27# at an idle state.
28# FAN_SPEED_RANGE_STRESS The allowable range of fan speeds,
29# expressed as RPMs, when the machine is
30# at a stressed state.
31# TEMPERATURE_RANGE_IDLE The allowed range for temperature,
32# expressed as Celsius degrees, when
33# the machine is at an idle state.
34# TEMPERATURE_RANGE_STRESS The allowable range for temperature,
35# expressed as Celsius degrees, when
36# the machine is at a stressed state.
37# POWER_RANGE_IDLE The allowable range for power, expressed
38# in Watts, while the machine is at an
39# idle state.
40# POWER_RANGE_STRESS The allowable range for power, expressed
41# in Watts, while the machine is at a
42# stressed state.
43
44
45Resource ../syslib/utils_os.robot
46Resource ../lib/fan_utils.robot
47Library ../lib/gen_robot_valid.py
48Suite Setup Suite Setup Execution
49Test Teardown FFDC On Test Case Fail
50Suite Teardown Shutdown HTX Exerciser
51
52*** Variables ***
53# Default Ranges.
54@{FAN_SPEED_RANGE_IDLE}= 0 6000
55@{FAN_SPEED_RANGE_STRESS}= 3000 8000
56@{TEMPERATURE_RANGE_IDLE}= 30 45
57@{TEMPERATURE_RANGE_STRESS}= 35 100
58@{POWER_RANGE_IDLE}= 15 60
59@{POWER_RANGE_STRESS}= 30 350
60
61
62*** Test Cases ***
63
64Verify Fan Speeds During Idle State
65 [Documentation] Verify the fan speeds are within acceptable range
66 ... while the system is idle.
67 [Tags] Verify_Fan_Speeds_During_Idle_State
68
69 Verify Fan Speeds ${FAN_SPEED_RANGE_IDLE}
70
71
72Verify Temperature During Idle State
73 [Documentation] Verify the temperature values are within acceptable
74 ... range while the system is idle.
75 [Tags] Verify_Temperature_During_Idle_State
76
77 Verify Temperatures ${TEMPERATURE_RANGE_IDLE}
78
79
80Verify Power During Idle State
81 [Documentation] Verify the power values are within acceptable range
82 ... while the system is idle.
83 [Tags] Verify_Power_During_Idle_State
84
85 Verify Power Values ${POWER_RANGE_IDLE}
86
87
88Test Hardware Limits During Stress
89 [Documentation] Verify the hardware under stress is within
90 ... acceptable range.
91 [Tags] Test_Hardware_Limits_During_Stress
92
93 # Run HTX and verify, within intervals, that the hardware ranges
94 # are within the allowable ranges.
95 Run MDT Profile
96 Repeat Keyword ${HTX_DURATION} Run Keywords
97 ... Verify Fan Speeds ${FAN_SPEED_RANGE_STRESS}
98 ... AND Verify Temperatures ${TEMPERATURE_RANGE_STRESS}
99 ... AND Verify Power Values ${POWER_RANGE_STRESS}
100 ... AND Run Key Sleep \ ${HTX_INTERVAL}
101
102
103*** Keywords ***
104
105Verify Fan Speeds
106 [Documentation] Verify that the fan speeds are within the required
107 ... range.
108 [Arguments] ${range}
109
110 # Description of argument(s):
111 # range A 2-element list comprised of the lower
112 # and upper values which constitute the
113 # valid range for the fan speeds.
114 # (e.g [500,800]).
115
116 # Get the fans with the lowest and highest fan speeds. Verify that
117 # the speeds are within the proper range.
118 ${fan_objects}= Read Properties ${SENSORS_URI}fan_tach/enumerate
119 ${fan_speeds}= Evaluate
120 ... [ x['Value'] for x in $fan_objects.values() ]
121 ${max_fan_speed} Evaluate max(map(int, $fan_speeds))
122 ${min_fan_speed} Evaluate min(map(int, $fan_speeds))
123 Rvalid Range max_fan_speed ${range}
124 Rvalid Range min_fan_speed ${range}
125
126
127Verify Temperatures
128 [Documentation] Verify that the temperature values are within the
129 ... required range.
130 [Arguments] ${range}
131
132 # Description of argument(s):
133 # range The allowable range for the temperature,
134 # values (e.g [20,60]).
135
136 # Get the lowest and highest temperatures for GPUs, verify
137 # that it is within the proper range.
138 ${gpu_max_temperature}= Get GPU Max Temperature
139 ${gpu_min_temperature}= Get GPU Min Temperature
140 Rvalid Range gpu_max_temperature ${range}
141 Rvalid Range gpu_min_temperature ${range}
142 # Verify for CPUs.
143 ${cpu_highest_temp}= Get CPU Max Temperature
144 ${cpu_lowest_temp}= Get CPU Min Temperature
145 Rvalid Range cpu_highest_temp ${range}
146 Rvalid Range cpu_lowest_temp ${range}
147
148
149Verify Power Values
150 [Documentation] Verify that the power values for GPUs and CPUs
151 ... are within the required range.
152 [Arguments] ${range}
153
154 # Description of argument(s):
155 # range The allowable range for power values,
156 # (e.g [15,30]).
157
158 ${gpu_max}= Get GPU Max Power
159 ${gpu_min}= Get GPU Min Power
160 ${gpu_max_power}= Evaluate int(round(${gpu_max}))
161 ${gpu_min_power}= Evaluate int(round(${gpu_min}))
162 Rvalid Range gpu_max_power ${range}
163 Rvalid Range gpu_min_power ${range}
164
165 ${p0}= Read Properties ${SENSORS_URI}power/p0_power
166 ${p1}= Read Properties ${SENSORS_URI}power/p1_power
167 # The scaling factor for fans is -6 for CPU power values.
168 ${p0_value}= Evaluate ${p0}['Value']/1000000
169 ${p1_value}= Evaluate ${p1}['Value']/1000000
170 Rvalid Range p0_value ${range}
171 Rvalid Range p1_value ${range}
172
173
174Suite Setup Execution
175 [Documentation] Do suite setup tasks.
176
177 REST Power On stack_mode=skip
178 ${htx_running}= Is HTX Running
179 Should Not Be True ${htx_running} msg=HTX needs to be shutdown.