blob: 8eebc3ee56adca3944b6d62131a5164928c90e91 [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
George Keishing47335a72017-05-09 04:02:18 -05002Documentation Test module for testing fan interface.
3
Chris Austenb29d2e82016-06-07 12:25:35 -05004Resource ../lib/rest_client.robot
George Keishingd55a4be2016-08-26 03:28:17 -05005Resource ../lib/openbmc_ffdc.robot
George Keishing47335a72017-05-09 04:02:18 -05006
Gunnar Millseac1af22016-11-14 15:30:09 -06007Test Teardown FFDC On Test Case Fail
Chris Austenb29d2e82016-06-07 12:25:35 -05008
9*** Test Cases ***
George Keishing47335a72017-05-09 04:02:18 -050010
George Keishingee5c9f52017-05-26 03:39:20 -050011Verify Fan Sensors Attributes
George Keishing47335a72017-05-09 04:02:18 -050012 [Documentation] Check fan attributes.
13 [Tags] Verify_Fan_Sensor_Attributes
14
George Keishing9994a502017-05-22 14:34:41 -050015 # Example:
16 # /xyz/openbmc_project/sensors/fan_tach/fan0
17 # /xyz/openbmc_project/sensors/fan_tach/fan1
18 # /xyz/openbmc_project/sensors/fan_tach/fan2
19 # /xyz/openbmc_project/sensors/fan_tach/fan3
20 ${fans}= Get Endpoint Paths /xyz/openbmc_project/sensors/ fan*
George Keishing47335a72017-05-09 04:02:18 -050021
22 # Access the properties of the fan and it should contain
23 # the following entries:
24 # /xyz/openbmc_project/sensors/fan_tach/fan0
25 # {
26 # "Scale": 0,
27 # "Target": 0,
28 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.RPMS",
29 # "Value": 0
30 # }
31
32 :FOR ${entry} IN @{fans}
33 \ ${resp}= OpenBMC Get Request ${entry}
George Keishingee5c9f52017-05-26 03:39:20 -050034 \ ${json}= To JSON ${resp.content}
George Keishing47335a72017-05-09 04:02:18 -050035 \ Should Be True ${json["data"]["Scale"]} >= 0
George Keishing16294f62017-05-12 14:48:50 -050036 \ Run Keyword And Ignore Error
37 ... Should Be True ${json["data"]["Target"]} >= 0
George Keishing47335a72017-05-09 04:02:18 -050038 \ Should Be Equal As Strings
39 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.RPMS
40 \ Should Be True ${json["data"]["Value"]} >= 0
41
42
George Keishingee5c9f52017-05-26 03:39:20 -050043Verify PCIE Sensors Attributes
George Keishing9994a502017-05-22 14:34:41 -050044 [Documentation] Probe PCIE attributes.
45 [Tags] Verify_PCIE_Sensor_Attributes
46
47 # Example:
48 # /xyz/openbmc_project/sensors/temperature/pcie
49 ${temp_pcie}= Get Endpoint Paths /xyz/openbmc_project/sensors/ pcie
50
51 # Access the properties of the PCIE and it should contain
52 # the following entries:
53 # /xyz/openbmc_project/sensors/temperature/pcie
54 # {
55 # "Scale": -3,
56 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
57 # "Value": 29625
58 # }
59
60
61 :FOR ${entry} IN @{temp_pcie}
62 \ ${resp}= OpenBMC Get Request ${entry}
George Keishingee5c9f52017-05-26 03:39:20 -050063 \ ${json}= To JSON ${resp.content}
George Keishing9994a502017-05-22 14:34:41 -050064 \ Should Be True ${json["data"]["Scale"]} == -3
65 \ Should Be Equal As Strings
66 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
67 \ ${temp_in_DegreeC}= Evaluate ${json["data"]["Value"]} / 1000
68 \ Should Be True ${temp_in_DegreeC} > 0
69
70
George Keishingee5c9f52017-05-26 03:39:20 -050071Verify Rail Voltage Sensors Attributes
72 [Documentation] Check rail voltage attributes.
73 [Tags] Verify_Rail_Voltage_Sensor_Attributes
74
75 # Example of one of the entries returned by 'Get Endpoint Paths':
76 # /xyz/openbmc_project/sensors/voltage/rail_1_voltage
77 # /xyz/openbmc_project/sensors/voltage/rail_2_voltage
78 ${temp_rail}= Get Endpoint Paths /xyz/openbmc_project/sensors/ rail*
79
80 # Example:
81 # Access the properties of the rail voltage and it should contain
82 # the following entries:
83 # "/xyz/openbmc_project/sensors/voltage/rail_1_voltage":
84 # {
85 # "Scale": -3,
86 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Volts",
87 # "Value": 5097
88 # },
89
90 :FOR ${entry} IN @{temp_rail}
91 \ ${resp}= OpenBMC Get Request ${entry}
92 \ ${json}= To JSON ${resp.content}
93 \ Should Be True ${json["data"]["Scale"]} == -3
94 \ Should Be Equal As Strings
95 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Volts
96 \ ${volts}= Evaluate ${json["data"]["Value"]} / 1000
97 \ Should Be True ${volts} > 0
98
99
George Keishing47335a72017-05-09 04:02:18 -0500100*** Keywords ***
101