blob: 188a8cc99c988534aa3ed193871e57e2eee2029c [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
11Verify Fan Sensors Atrributes
12 [Documentation] Check fan attributes.
13 [Tags] Verify_Fan_Sensor_Attributes
14
15 ${fans}= Get Fan Sensor List
16
17 # Access the properties of the fan and it should contain
18 # the following entries:
19 # /xyz/openbmc_project/sensors/fan_tach/fan0
20 # {
21 # "Scale": 0,
22 # "Target": 0,
23 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.RPMS",
24 # "Value": 0
25 # }
26
27 :FOR ${entry} IN @{fans}
28 \ ${resp}= OpenBMC Get Request ${entry}
29 \ ${json}= To Json ${resp.content}
30 \ Should Be True ${json["data"]["Scale"]} >= 0
31 \ Should Be True ${json["data"]["Target"]} >= 0
32 \ Should Be Equal As Strings
33 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.RPMS
34 \ Should Be True ${json["data"]["Value"]} >= 0
35
36
37*** Keywords ***
38
39Get Fan Sensor List
40 [Documentation] Get a list of fan sensor URLs.
41 # Example:
42 # /xyz/openbmc_project/sensors/fan_tach/fan0
43 # /xyz/openbmc_project/sensors/fan_tach/fan1
44 # /xyz/openbmc_project/sensors/fan_tach/fan2
45 # /xyz/openbmc_project/sensors/fan_tach/fan3
46
47 ${resp}= Openbmc Get Request
48 ... /xyz/openbmc_project/sensors/fan_tach/list
49 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
50 ${jsondata}= To JSON ${resp.content}
51 Should Not Be Empty ${jsondata["data"]}
52 [Return] ${jsondata["data"]}