blob: 57d877e7ce8dc8399ce89418faf238aa5d64cb58 [file] [log] [blame]
Marissa Garza3047c622019-06-13 16:24:06 -05001*** Settings ***
2Documentation Getting the systems thermal records for temperature.
3
4Resource ../../lib/bmc_redfish_resource.robot
5Resource ../../lib/bmc_redfish_utils.robot
6Resource ../../lib/openbmc_ffdc.robot
Marissa Garza3a7c0532019-06-27 17:24:31 -05007Library ../../lib/gen_robot_valid.py
Marissa Garza3047c622019-06-13 16:24:06 -05008
9Suite Setup Suite Setup Execution
10Suite Teardown Suite Teardown Execution
Marissa Garza3a7c0532019-06-27 17:24:31 -050011Test Setup Printn
Marissa Garza3047c622019-06-13 16:24:06 -050012Test Teardown Test Teardown Execution
13
14
15*** Test Cases ***
16
17Get Ambient Temperature Records
18 [Documentation] Get the ambient temperature records.
19 [Tags] Get_Ambient_Temperature_Records
20 [Template] Get Thermal Records and Verify
21
22 # record_type reading_type
23 Temperatures ReadingCelsius
24
25
26*** Keywords ***
27
28Get Thermal Records and Verify
29 [Documentation] Get the thermal records for temperatures.
30 [Arguments] ${record_type} ${reading_type}
31
32 # Description of Arguments(s):
33 # record_type The thermal record type (e.g. "Temperatures")
34 # reading_type The thermal temperature readings (e.g. "ReadingCelsius")
35
36 # A valid record will have "State" key "Enabled" and "Health" key "OK"
Marissa Garza3047c622019-06-13 16:24:06 -050037 ${records}= Redfish.Get Attribute
38 ... ${REDFISH_CHASSIS_THERMAL_URI} ${record_type}
39
40 ${num_records}= Get Length ${records}
Michael Walsh39c00512019-07-17 10:54:06 -050041 Rprint Vars num_records records
Marissa Garza3047c622019-06-13 16:24:06 -050042
Marissa Garza3a7c0532019-06-27 17:24:31 -050043 ${invalid_records}= Filter Struct ${records}
44 ... [('Health', '^OK$'), ('State', '^Enabled$'), ('${reading_type}', '')] regex=1 invert=1
45 ${num_invalid_records}= Get Length ${invalid_records}
Marissa Garza3047c622019-06-13 16:24:06 -050046
Marissa Garza3a7c0532019-06-27 17:24:31 -050047 Run Keyword If ${num_invalid_records} > ${0}
Michael Walsh39c00512019-07-17 10:54:06 -050048 ... Rprint Vars num_invalid_records invalid_records
Michael Walshe7edb222019-08-19 17:39:38 -050049 Valid Value num_invalid_records valid_values=[0]
Marissa Garza3047c622019-06-13 16:24:06 -050050
Marissa Garza3a7c0532019-06-27 17:24:31 -050051 ${invalid_records}= Evaluate
52 ... [x for x in ${records} if not x['LowerThresholdNonCritical'] <= x['ReadingCelsius'] <= x['UpperThresholdNonCritical']]
Marissa Garza3047c622019-06-13 16:24:06 -050053
Marissa Garza3a7c0532019-06-27 17:24:31 -050054 ${num_invalid_records}= Get Length ${invalid_records}
55 Run Keyword If ${num_invalid_records} > ${0}
Michael Walsh39c00512019-07-17 10:54:06 -050056 ... Rprint Vars num_invalid_records invalid_records
Michael Walshe7edb222019-08-19 17:39:38 -050057 Valid Value num_invalid_records valid_values=[0]
Marissa Garza3047c622019-06-13 16:24:06 -050058
59Suite Teardown Execution
60 [Documentation] Do the post suite teardown.
61
62 Redfish.Logout
63
64Suite Setup Execution
65 [Documentation] Do test case setup tasks.
66
Marissa Garza3a7c0532019-06-27 17:24:31 -050067 Printn
Marissa Garza3047c622019-06-13 16:24:06 -050068 Redfish.Login
69
70Test Teardown Execution
71 [Documentation] Do the post test teardown.
72
73 FFDC On Test Case Fail