blob: 2e950c1a2b9ed3c245290e5e407ac492e49482f7 [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
George Keishing16294f62017-05-12 14:48:50 -050031 \ Run Keyword And Ignore Error
32 ... Should Be True ${json["data"]["Target"]} >= 0
George Keishing47335a72017-05-09 04:02:18 -050033 \ Should Be Equal As Strings
34 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.RPMS
35 \ Should Be True ${json["data"]["Value"]} >= 0
36
37
38*** Keywords ***
39
40Get Fan Sensor List
41 [Documentation] Get a list of fan sensor URLs.
42 # Example:
43 # /xyz/openbmc_project/sensors/fan_tach/fan0
44 # /xyz/openbmc_project/sensors/fan_tach/fan1
45 # /xyz/openbmc_project/sensors/fan_tach/fan2
46 # /xyz/openbmc_project/sensors/fan_tach/fan3
47
48 ${resp}= Openbmc Get Request
49 ... /xyz/openbmc_project/sensors/fan_tach/list
50 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
51 ${jsondata}= To JSON ${resp.content}
52 Should Not Be Empty ${jsondata["data"]}
53 [Return] ${jsondata["data"]}