Add re-try for redfish GET request for targets
Changes:
- This retries is added to improve the success rate
for the GET request in case returns JSON errors
for the following URI during operation
/redfish/v1/Systems/ and /redfish/v1/Managers/
- Added other places in code to handle exceptions.
- Fix IPMI import paths in test suite
Tested:
- Ran from sandbox.
Change-Id: Ie37dbdd9c7572e0003a56e65a7b5f0a4c3b26a1a
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index 925b148..084d400 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -389,7 +389,8 @@
Redfish Get Auto Reboot
[Documentation] Returns auto reboot setting.
- ${resp}= Redfish.Get Attribute /redfish/v1/Systems/${SYSTEM_ID} Boot
+ ${resp}= Wait Until Keyword Succeeds 1 min 20 sec
+ ... Redfish.Get Attribute /redfish/v1/Systems/${SYSTEM_ID} Boot
RETURN ${resp["AutomaticRetryConfig"]}
@@ -906,7 +907,8 @@
# "State": "Enabled"
# },
- ${status}= Redfish.Get Attribute /redfish/v1/Managers/${MANAGER_ID} Status
+ ${status}= Wait Until Keyword Succeeds 1 min 20 sec
+ ... Redfish.Get Attribute /redfish/v1/Managers/${MANAGER_ID} Status
RETURN ${status["State"]}
@@ -917,7 +919,8 @@
# Description of argument(s):
# match_state Expected match state (e.g. Enabled, Starting, Error)
- ${Status}= Redfish.Get Attribute /redfish/v1/Managers/${MANAGER_ID} Status
+ ${Status}= Wait Until Keyword Succeeds 1 min 20 sec
+ ... Redfish.Get Attribute /redfish/v1/Managers/${MANAGER_ID} Status
Should Be Equal As Strings ${match_state} ${Status['State']}
@@ -935,7 +938,8 @@
# "State": "StandbyOffline"
# },
- ${chassis}= Redfish.Get Properties /redfish/v1/Chassis/${CHASSIS_ID}
+ ${chassis}= Wait Until Keyword Succeeds 1 min 20 sec
+ ... Redfish.Get Properties /redfish/v1/Chassis/${CHASSIS_ID}
RETURN ${chassis["PowerState"]} ${chassis["Status"]["State"]}
@@ -947,7 +951,8 @@
# "LastState": "OSRunning"
# },
- ${boot_progress}= Redfish.Get Properties /redfish/v1/Systems/${SYSTEM_ID}/
+ ${boot_progress}= Wait Until Keyword Succeeds 1 min 20 sec
+ ... Redfish.Get Properties /redfish/v1/Systems/${SYSTEM_ID}/
Return From Keyword If "${PLATFORM_ARCH_TYPE}" == "x86"
... NA ${boot_progress["Status"]["State"]}