Add sensors property check VDN,VCS,VDD,VDDR
Resoloves openbmc/openbmc-test-automation#713
Change-Id: Ieedd627c668d615a42263148df7fe16fd70c5411
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/tests/test_fan.robot b/tests/test_fan.robot
index 8eebc3e..1fdbf9e 100644
--- a/tests/test_fan.robot
+++ b/tests/test_fan.robot
@@ -97,5 +97,119 @@
\ Should Be True ${volts} > 0
+Verify VDN Temperature Sensors Attributes
+ [Documentation] Check vdn temperature attributes.
+ [Tags] Verify_VDN_Temperature_Sensors_Attributes
+
+ # Example of one of the entries returned by 'Get Endpoint Paths':
+ # /xyz/openbmc_project/sensors/temperature/p0_vdn_temp
+ ${temp_vdn}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdn_temp
+
+ # Example:
+ # Access the properties of the rail voltage and it should contain
+ # the following entries:
+ # /xyz/openbmc_project/sensors/temperature/p0_vdn_temp
+ # {
+ # "Scale": -3,
+ # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
+ # "Value": 3000
+ # }
+
+ :FOR ${entry} IN @{temp_vdn}
+ \ ${resp}= OpenBMC Get Request ${entry}
+ \ ${json}= To JSON ${resp.content}
+ \ Should Be True ${json["data"]["Scale"]} == -3
+ \ Should Be Equal As Strings
+ ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
+ \ ${vdn_temp}= Evaluate ${json["data"]["Value"]} / 1000
+ \ Should Be True ${vdn_temp} > 0
+
+
+Verify VCS Temperature Sensors Attributes
+ [Documentation] Check vcs temperature attributes.
+ [Tags] Verify_VCS_Temperature_Sensors_Attributes
+
+ # Example of one of the entries returned by 'Get Endpoint Paths':
+ # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp
+ ${temp_vcs}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vcs_temp
+
+ # Example:
+ # Access the properties of the rail voltage and it should contain
+ # the following entries:
+ # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp
+ # {
+ # "Scale": -3,
+ # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
+ # "Value": 31000
+ # },
+
+
+ :FOR ${entry} IN @{temp_vcs}
+ \ ${resp}= OpenBMC Get Request ${entry}
+ \ ${json}= To JSON ${resp.content}
+ \ Should Be True ${json["data"]["Scale"]} == -3
+ \ Should Be Equal As Strings
+ ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
+ \ ${vcs_temp}= Evaluate ${json["data"]["Value"]} / 1000
+ \ Should Be True ${vcs_temp} > 0
+
+
+Verify VDD Temperature Sensors Attributes
+ [Documentation] Check vdd temperature attributes.
+ [Tags] Verify_VDD_Temperature_Sensors_Attributes
+
+ # Example of one of the entries returned by 'Get Endpoint Paths':
+ # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp
+ ${temp_vdd}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdd_temp
+
+ # Example:
+ # Access the properties of the rail voltage and it should contain
+ # the following entries:
+ # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp
+ # {
+ # "Scale": -3,
+ # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
+ # "Value": 4000
+ # }
+
+ :FOR ${entry} IN @{temp_vdd}
+ \ ${resp}= OpenBMC Get Request ${entry}
+ \ ${json}= To JSON ${resp.content}
+ \ Should Be True ${json["data"]["Scale"]} == -3
+ \ Should Be Equal As Strings
+ ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
+ \ ${vdd_temp}= Evaluate ${json["data"]["Value"]} / 1000
+ \ Should Be True ${vdd_temp} > 0
+
+
+Verify VDDR Temperature Sensors Attributes
+ [Documentation] Check vddr temperature attributes.
+ [Tags] Verify_VDDR_Temperature_Sensors_Attributes
+
+ # Example of one of the entries returned by 'Get Endpoint Paths':
+ # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp
+ ${temp_vddr}=
+ ... Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vddr_temp
+
+ # Example:
+ # Access the properties of the rail voltage and it should contain
+ # the following entries:
+ # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp
+ # {
+ # "Scale": -3,
+ # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
+ # "Value": 4000
+ # }
+
+ :FOR ${entry} IN @{temp_vddr}
+ \ ${resp}= OpenBMC Get Request ${entry}
+ \ ${json}= To JSON ${resp.content}
+ \ Should Be True ${json["data"]["Scale"]} == -3
+ \ Should Be Equal As Strings
+ ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
+ \ ${vddr_temp}= Evaluate ${json["data"]["Value"]} / 1000
+ \ Should Be True ${vddr_temp} > 0
+
+
*** Keywords ***