Added below IPMI sensor test cases
-Verify CPU Present
-Verify CPU Not Present
-Verify GPU Present
-Verify GPU Not Present
Change-Id: I4efd36cf35e730d24efc23e40136d9745b450e31
Signed-off-by: Sushma M M <sushmm99@in.ibm.com>
diff --git a/ipmi/test_ipmi_sensor.robot b/ipmi/test_ipmi_sensor.robot
index c87873e..3ba9e2c 100644
--- a/ipmi/test_ipmi_sensor.robot
+++ b/ipmi/test_ipmi_sensor.robot
@@ -185,6 +185,42 @@
Wait Until Keyword Succeeds 2 min 30 sec Verify Power Reading Via Raw Command
+Verify CPU Present
+ [Documentation] Verify the IPMI sensor for CPU present using Redfish.
+ [Tags] Verify_CPU_Present
+ [Template] Enable Present Bit Via IPMI and Verify Using Redfish
+
+ # sensor_id component
+ 0x5a cpu0
+
+
+Verify CPU Not Present
+ [Documentation] Verify the IPMI sensor for CPU not present using Redfish.
+ [Tags] Verify_CPU_Not_Present
+ [Template] Disable Present Bit Via IPMI and Verify Using Redfish
+
+ # sensor_id component
+ 0x5a cpu0
+
+
+Verify GPU Present
+ [Documentation] Verify the IPMI sensor for GPU present using Redfish.
+ [Tags] Verify_GPU_Present
+ [Template] Enable Present Bit Via IPMI and Verify Using Redfish
+
+ # sensor_id component
+ 0xC5 gv100card0
+
+
+Verify GPU Not Present
+ [Documentation] Verify the IPMI sensor for GPU not present using Redfish.
+ [Tags] Verify_GPU_Not_Present
+ [Template] Disable Present Bit Via IPMI and Verify Using Redfish
+
+ # sensor_id component
+ 0xC5 gv100card0
+
+
*** Keywords ***
Get Temperature Reading And Verify In Redfish
@@ -301,4 +337,67 @@
... Evaluate abs(${redfish_reading} - ${power_reading_ipmi})
Should Be True ${ipmi_redfish_power_diff} <= ${allowed_power_diff}
- ... msg=Power reading above allowed threshold ${allowed_power_diff}.
\ No newline at end of file
+ ... msg=Power reading above allowed threshold ${allowed_power_diff}.
+
+
+Enable Present Bit Via IPMI and Verify Using Redfish
+ [Documentation] Enable present bit of sensor via IPMI and verify using Redfish.
+ [Arguments] ${sensor_id} ${component}
+
+ # Description of argument(s):
+ # sensor_id The sensor id of IPMI sensor.
+ # component The Redfish component of IPMI sensor.
+
+ Run IPMI Command
+ ... 0x04 0x30 ${sensor_id} 0xa9 0x00 0x80 0x00 0x00 0x00 0x00 0x20 0x00
+
+ # Example of CPU state via Redfish
+ #"@odata.id": "/redfish/v1/Systems/system/Processors/cpu0",
+ #"@odata.type": "#Processor.v1_7_0.Processor",
+ #"Id": "cpu0",
+ #"InstructionSet": "PowerISA",
+ #"Manufacturer": "IBM",
+ #"Model": "",
+ #"Name": "Processor",
+ #"PartNumber": "02CY211",
+ #"ProcessorArchitecture": "Power",
+ #"ProcessorType": "CPU",
+ #"SerialNumber": "YA1934302447",
+ #"Status": {
+ # "Health": "OK",
+ # "State": "Enabled"
+ #}
+
+ ${redfish_value}= Redfish.Get Properties /redfish/v1/Systems/system/Processors/${component}
+ Should Be True '${redfish_value['Status']['State']}' == 'Enabled'
+
+
+Disable Present Bit Via IPMI and Verify Using Redfish
+ [Documentation] Disable present bit of sensor via IPMI and verify using Redfish.
+ [Arguments] ${sensor_id} ${component}
+
+ # Description of argument(s):
+ # sensor_id The sensor id of IPMI sensor.
+ # component The Redfish component of IPMI sensor.
+
+ Run IPMI Command
+ ... 0x04 0x30 ${sensor_id} 0xa9 0x00 0x00 0x00 0x80 0x00 0x00 0x20 0x00
+
+ # Example of CPU state via Redfish
+ #"@odata.context": "/redfish/v1/$metadata#Processor.Processor",
+ #"@odata.id": "/redfish/v1/Systems/system/Processors/cpu0",
+ #"@odata.type": "#Processor.v1_3_1.Processor",
+ #"Id": "cpu0",
+ #"InstructionSet": "PowerISA",
+ #"Manufacturer": "IBM",
+ #"Model": "",
+ #"Name": "Processor",
+ #"ProcessorArchitecture": "Power",
+ #"ProcessorType": "CPU",
+ #"Status": {
+ # "Health": "OK",
+ # "State": "Absent"
+ #}
+
+ ${redfish_value}= Redfish.Get Properties /redfish/v1/Systems/system/Processors/${component}
+ Should Be True '${redfish_value['Status']['State']}' == 'Absent'
\ No newline at end of file
diff --git a/tests/ipmi/test_sensors_ipmi.robot b/tests/ipmi/test_sensors_ipmi.robot
index 9736b10..7880922 100644
--- a/tests/ipmi/test_sensors_ipmi.robot
+++ b/tests/ipmi/test_sensors_ipmi.robot
@@ -48,24 +48,6 @@
... Functional ${1}
-CPU Present
- [Documentation] Verify the IPMI sensor for CPU present.
- [Tags] CPU_Present
- [Template] Check Present Bit
-
- # sensor_id component
- 0x5a cpu0
-
-
-CPU Not Present
- [Documentation] Verify the IPMI sensor for CPU not present.
- [Tags] CPU_Not_Present
- [Template] Check Not Present Bit
-
- # sensor_id component
- 0x5a cpu0
-
-
CPU Functional
[Documentation] Verify the IPMI sensor for CPU functional.
[Tags] CPU_Functional
@@ -84,24 +66,6 @@
0x5a cpu0
-GPU Present
- [Documentation] Verify the IPMI sensor for GPU present.
- [Tags] GPU_Present
- [Template] Check Present Bit
-
- # sensor_id component
- 0xC5 gv100card0
-
-
-GPU Not Present
- [Documentation] Verify the IPMI sensor for GPU not present.
- [Tags] GPU_Not_Present
- [Template] Check Not Present Bit
-
- # sensor_id component
- 0xC5 gv100card0
-
-
GPU Functional
[Documentation] Verify the IPMI sensor GPU for functional.
[Tags] GPU_Functional