blob: cbd60a1192c6cd9b5c96208899dcb15f177bf4ba [file] [log] [blame]
Marissa Garza64609112019-07-03 11:48:58 -05001*** Settings ***
2Documentation Getting the systems power sensor readings for voltages.
3
4Resource ../../lib/bmc_redfish_resource.robot
5Resource ../../lib/bmc_redfish_utils.robot
6Resource ../../lib/openbmc_ffdc.robot
7Library ../../lib/gen_robot_valid.py
8
9Suite Setup Suite Setup Execution
10Suite Teardown Suite Teardown Execution
11Test Setup Printn
12Test Teardown Test Teardown Execution
13
14
15*** Test Cases ***
16
17Get Power Sensor Voltage Records
18 [Documentation] Get the power voltage records.
19 [Tags] Get_Power_Sensor_Voltage_Records
20 [Template] Get Voltage Records and Verify
21
22 # record_type reading_type
23 Voltages ReadingVolts
24
25
26*** Keywords ***
27
28Get Voltage Records and Verify
29 [Documentation] Get the power records for voltages.
30 [Arguments] ${record_type} ${reading_type}
31
32 # Description of Arguments(s):
33 # record_type The sensor record type (e.g. "Voltages")
34 # reading_type The power voltage readings (e.g. "ReadingVolts")
35
36 # A valid record will have "State" key "Enabled" and "Health" key "OK"
37 ${records}= Redfish.Get Attribute
38 ... ${REDFISH_CHASSIS_POWER_URI} ${record_type}
39
40 ${num_records}= Get Length ${records}
41 Rprint Vars num_records records fmt=terse
42
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}
46
47 Run Keyword If ${num_invalid_records} > ${0}
48 ... Rprint Vars num_invalid_records invalid_records fmt=terse
49 Rvalid Value num_invalid_records valid_values=[0]
50
51 ${invalid_records}= Evaluate
52 ... [x for x in ${records} if not x['LowerThresholdNonCritical'] <= x['ReadingVolts'] <= x['UpperThresholdNonCritical']]
53
54 ${num_invalid_records}= Get Length ${invalid_records}
55 Run Keyword If ${num_invalid_records} > ${0}
56 ... Rprint Vars num_invalid_records invalid_records fmt=terse
57 Rvalid Value num_invalid_records valid_values=[0]
58
59
60Suite Teardown Execution
61 [Documentation] Do the post suite teardown.
62
63 Redfish.Logout
64
65
66Suite Setup Execution
67 [Documentation] Do test case setup tasks.
68
69 Printn
Marissa Garza0517c5d2019-08-15 13:46:09 -050070 Redfish Power On stack_mode=skip
Marissa Garza64609112019-07-03 11:48:58 -050071 Redfish.Login
72
73
74Test Teardown Execution
75 [Documentation] Do the post test teardown.
76
77 FFDC On Test Case Fail