Marissa Garza | 3047c62 | 2019-06-13 16:24:06 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Getting the systems thermal records for temperature. |
| 3 | |
| 4 | Resource ../../lib/bmc_redfish_resource.robot |
| 5 | Resource ../../lib/bmc_redfish_utils.robot |
| 6 | Resource ../../lib/openbmc_ffdc.robot |
Marissa Garza | 3a7c053 | 2019-06-27 17:24:31 -0500 | [diff] [blame] | 7 | Library ../../lib/gen_robot_valid.py |
Marissa Garza | 3047c62 | 2019-06-13 16:24:06 -0500 | [diff] [blame] | 8 | |
| 9 | Suite Setup Suite Setup Execution |
| 10 | Suite Teardown Suite Teardown Execution |
Marissa Garza | 3a7c053 | 2019-06-27 17:24:31 -0500 | [diff] [blame] | 11 | Test Setup Printn |
Marissa Garza | 3047c62 | 2019-06-13 16:24:06 -0500 | [diff] [blame] | 12 | Test Teardown Test Teardown Execution |
| 13 | |
| 14 | |
| 15 | *** Test Cases *** |
| 16 | |
| 17 | Get 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 | |
| 28 | Get 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 Garza | 3047c62 | 2019-06-13 16:24:06 -0500 | [diff] [blame] | 37 | ${records}= Redfish.Get Attribute |
| 38 | ... ${REDFISH_CHASSIS_THERMAL_URI} ${record_type} |
| 39 | |
| 40 | ${num_records}= Get Length ${records} |
Michael Walsh | 39c0051 | 2019-07-17 10:54:06 -0500 | [diff] [blame] | 41 | Rprint Vars num_records records |
Marissa Garza | 3047c62 | 2019-06-13 16:24:06 -0500 | [diff] [blame] | 42 | |
Marissa Garza | 3a7c053 | 2019-06-27 17:24:31 -0500 | [diff] [blame] | 43 | ${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 Garza | 3047c62 | 2019-06-13 16:24:06 -0500 | [diff] [blame] | 46 | |
Marissa Garza | 3a7c053 | 2019-06-27 17:24:31 -0500 | [diff] [blame] | 47 | Run Keyword If ${num_invalid_records} > ${0} |
Michael Walsh | 39c0051 | 2019-07-17 10:54:06 -0500 | [diff] [blame] | 48 | ... Rprint Vars num_invalid_records invalid_records |
Marissa Garza | 3a7c053 | 2019-06-27 17:24:31 -0500 | [diff] [blame] | 49 | Rvalid Value num_invalid_records valid_values=[0] |
Marissa Garza | 3047c62 | 2019-06-13 16:24:06 -0500 | [diff] [blame] | 50 | |
Marissa Garza | 3a7c053 | 2019-06-27 17:24:31 -0500 | [diff] [blame] | 51 | ${invalid_records}= Evaluate |
| 52 | ... [x for x in ${records} if not x['LowerThresholdNonCritical'] <= x['ReadingCelsius'] <= x['UpperThresholdNonCritical']] |
Marissa Garza | 3047c62 | 2019-06-13 16:24:06 -0500 | [diff] [blame] | 53 | |
Marissa Garza | 3a7c053 | 2019-06-27 17:24:31 -0500 | [diff] [blame] | 54 | ${num_invalid_records}= Get Length ${invalid_records} |
| 55 | Run Keyword If ${num_invalid_records} > ${0} |
Michael Walsh | 39c0051 | 2019-07-17 10:54:06 -0500 | [diff] [blame] | 56 | ... Rprint Vars num_invalid_records invalid_records |
Marissa Garza | 3a7c053 | 2019-06-27 17:24:31 -0500 | [diff] [blame] | 57 | Rvalid Value num_invalid_records valid_values=[0] |
Marissa Garza | 3047c62 | 2019-06-13 16:24:06 -0500 | [diff] [blame] | 58 | |
| 59 | Suite Teardown Execution |
| 60 | [Documentation] Do the post suite teardown. |
| 61 | |
| 62 | Redfish.Logout |
| 63 | |
| 64 | Suite Setup Execution |
| 65 | [Documentation] Do test case setup tasks. |
| 66 | |
Marissa Garza | 3a7c053 | 2019-06-27 17:24:31 -0500 | [diff] [blame] | 67 | Printn |
Marissa Garza | 3047c62 | 2019-06-13 16:24:06 -0500 | [diff] [blame] | 68 | Redfish.Login |
| 69 | |
| 70 | Test Teardown Execution |
| 71 | [Documentation] Do the post test teardown. |
| 72 | |
| 73 | FFDC On Test Case Fail |