xref: /openbmc/openbmc-test-automation/redfish/systems/test_thermal_ambient_temperatures.robot (revision b2a2d948d555cb6e5169b9f21d489a3b089b4387)
1*** Settings ***
2Documentation       Getting the systems thermal records for temperature.
3
4Resource            ../../lib/bmc_redfish_resource.robot
5Resource            ../../lib/bmc_redfish_utils.robot
6Resource            ../../lib/logging_utils.robot
7Resource            ../../lib/boot_utils.robot
8Resource            ../../lib/openbmc_ffdc.robot
9Library             ../../lib/gen_robot_valid.py
10Library             ../../lib/logging_utils.py
11
12Suite Setup         Suite Setup Execution
13Suite Teardown      Suite Teardown Execution
14Test Setup          Redfish Purge Event Log
15Test Teardown       Test Teardown Execution
16
17Test Tags           Thermal_Ambient_Temperatures
18
19*** Test Cases ***
20
21Get Ambient Temperature Records
22    [Documentation]  Get the ambient temperature records.
23    [Tags]  Get_Ambient_Temperature_Records
24    [Template]  Get Thermal Records and Verify
25
26    # record_type   reading_type
27    Temperatures    ReadingCelsius
28
29
30Reboot And Check Ambient Temperature Records Are Valid
31    [Documentation]  Check the ambient temperature records are valid after a reboot.
32    [Tags]  Reboot_And_Check_Ambient_Temperature_Records_Are_Valid
33
34    Redfish OBMC Reboot (run)
35
36    # Clear errors if there are any.
37    Redfish.Login
38    Redfish Purge Event Log
39
40    Get Thermal Records and Verify  Temperatures  ReadingCelsius
41
42
43*** Keywords ***
44
45Get Thermal Records and Verify
46    [Documentation]  Get the thermal records for temperatures.
47    [Arguments]  ${record_type}  ${reading_type}
48
49    # Description of Arguments(s):
50    # record_type    The thermal record type (e.g. "Temperatures")
51    # reading_type   The thermal temperature readings (e.g. "ReadingCelsius")
52
53    ${records}=  Verify Valid Records  ${record_type}
54    ...  ${REDFISH_CHASSIS_URI}/${CHASSIS_ID}/Thermal  ${reading_type}
55
56    ${num_records}=  Get Length  ${records}
57    Rprint Vars  num_records  records
58
59    ${cmd}  Catenate  [x for x in ${records}
60    ...  if not x['LowerThresholdNonCritical'] <= x['${reading_type}'] <= x['UpperThresholdNonCritical']]
61    ${invalid_records}=  Evaluate  ${cmd}
62
63    ${num_invalid_records}=  Get Length  ${invalid_records}
64    IF  ${num_invalid_records} > ${0}
65        Rprint Vars  num_invalid_records  invalid_records
66    END
67
68    Valid Value   num_invalid_records  valid_values=[0]
69
70    Event Log Should Not Exist
71
72
73Suite Teardown Execution
74    [Documentation]  Do the post suite teardown.
75
76    Redfish.Logout
77
78
79Suite Setup Execution
80    [Documentation]  Do test case setup tasks.
81
82    Printn
83    Redfish.Login
84    Redfish Purge Event Log
85
86
87Test Teardown Execution
88    [Documentation]  Do the post test teardown.
89
90    FFDC On Test Case Fail
91