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 |
| 7 | |
| 8 | Suite Setup Suite Setup Execution |
| 9 | Suite Teardown Suite Teardown Execution |
| 10 | Test Teardown Test Teardown Execution |
| 11 | |
| 12 | |
| 13 | *** Test Cases *** |
| 14 | |
| 15 | Get Ambient Temperature Records |
| 16 | [Documentation] Get the ambient temperature records. |
| 17 | [Tags] Get_Ambient_Temperature_Records |
| 18 | [Template] Get Thermal Records and Verify |
| 19 | |
| 20 | # record_type reading_type |
| 21 | Temperatures ReadingCelsius |
| 22 | |
| 23 | |
| 24 | *** Keywords *** |
| 25 | |
| 26 | Get Thermal Records and Verify |
| 27 | [Documentation] Get the thermal records for temperatures. |
| 28 | [Arguments] ${record_type} ${reading_type} |
| 29 | |
| 30 | # Description of Arguments(s): |
| 31 | # record_type The thermal record type (e.g. "Temperatures") |
| 32 | # reading_type The thermal temperature readings (e.g. "ReadingCelsius") |
| 33 | |
| 34 | # A valid record will have "State" key "Enabled" and "Health" key "OK" |
| 35 | |
| 36 | ${records}= Redfish.Get Attribute |
| 37 | ... ${REDFISH_CHASSIS_THERMAL_URI} ${record_type} |
| 38 | |
| 39 | ${num_records}= Get Length ${records} |
| 40 | |
| 41 | ${valid_records}= Filter Struct ${records} |
| 42 | ... [('Health', '^OK$'), ('State', '^Enabled$'), ('${reading_type}', '')] regex=1 |
| 43 | |
| 44 | ${num_valid_records}= Get Length ${valid_records} |
| 45 | |
| 46 | Rprint Vars num_records records valid_records |
| 47 | ... num_valid_records fmt=terse |
| 48 | |
| 49 | Should Be Equal As Integers ${num_records} ${num_valid_records} |
| 50 | |
| 51 | Suite Teardown Execution |
| 52 | [Documentation] Do the post suite teardown. |
| 53 | |
| 54 | Redfish.Logout |
| 55 | |
| 56 | Suite Setup Execution |
| 57 | [Documentation] Do test case setup tasks. |
| 58 | |
| 59 | Redfish.Login |
| 60 | |
| 61 | Test Teardown Execution |
| 62 | [Documentation] Do the post test teardown. |
| 63 | |
| 64 | FFDC On Test Case Fail |