Add CPU processor check using Redfish for OCC check
Changes:
- Move the REST based to Redfish CPU state check for OCC.
Change-Id: Ic975315f1d12702a30f569250c346da4c1e72e16
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/open_power_utils.robot b/lib/open_power_utils.robot
index 77b50e0..6629e2f 100644
--- a/lib/open_power_utils.robot
+++ b/lib/open_power_utils.robot
@@ -74,14 +74,16 @@
# expected_occ_active The expected occ_active value (i.e. 1/0).
# Example cpu_list data output:
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
- # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1
- ${cpu_list}= Get Endpoint Paths
- ... ${HOST_INVENTORY_URI}system/chassis/motherboard/ cpu*
+ # /redfish/v1/Systems/system/Processors/cpu0
+ # /redfish/v1/Systems/system/Processors/cpu1
+
+ ${cpu_list}= Redfish.Get Members List /redfish/v1/Systems/system/Processors/ cpu*
FOR ${endpoint_path} IN @{cpu_list}
- ${is_functional}= Read Object Attribute ${endpoint_path} Functional
- Continue For Loop If ${is_functional} == ${0}
+ # {'Health': 'OK', 'State': 'Enabled'} get only matching status good.
+ ${cpu_status}= Redfish.Get Attribute ${endpoint_path} Status
+ Continue For Loop If '${cpu_status['Health']}' != 'OK' or '${cpu_status['State']}' != 'Enabled'
+ Log To Console ${cpu_status}
${num}= Set Variable ${endpoint_path[-1]}
${occ_active}= Get OCC Active State ${OPENPOWER_CONTROL}occ${num}
Should Be Equal ${occ_active} ${expected_occ_active}