Run code update in loop
changes:
- Default loop count value is set to 20, but can be passed as argument.
- Added test case "Redfish Firmware Update Loop"
- Added keyword "Redfish Firmware Update In Loop"
- Added keyword "Get BMC Functional Firmware"
- Added keyword "Get Functional Firmware"
- Added keyword "Get Non Fucntional Firmware"
- Added keyword "Delete BMC Image"
Change-Id: I1ba7fff156ba2e8c85baa01f0f4b3267e2b5c4cd
Signed-off-by: Sushil Singh <susilsi7@in.ibm.com>
diff --git a/lib/code_update_utils.py b/lib/code_update_utils.py
index ac1efc9..35f9e85 100644
--- a/lib/code_update_utils.py
+++ b/lib/code_update_utils.py
@@ -9,6 +9,7 @@
import sys
import tarfile
import time
+import collections
from robot.libraries.BuiltIn import BuiltIn
robot_pgm_dir_path = os.path.dirname(__file__) + os.sep
@@ -22,6 +23,24 @@
from robot.libraries.BuiltIn import BuiltIn
+def get_bmc_firmware(image_type, sw_dict):
+ r"""
+ Get the dictionary of image based on image type like either BMC or Host.
+
+ Description of argument(s):
+ image_type This value is either BMC update or Host update type.
+ sw_dict This contain dictionay of firmware inventory properties.
+ """
+
+ temp_dict = collections.OrderedDict()
+ for key, value in sw_dict.items():
+ if value['image_type'] == image_type:
+ temp_dict[key] = value
+ else:
+ pass
+ return temp_dict
+
+
def verify_no_duplicate_image_priorities(image_purpose):
r"""
Check that there are no active images with the same purpose and priority.
diff --git a/lib/redfish_code_update_utils.robot b/lib/redfish_code_update_utils.robot
index a97b06e..ba5fb60 100644
--- a/lib/redfish_code_update_utils.robot
+++ b/lib/redfish_code_update_utils.robot
@@ -18,7 +18,8 @@
${image_info}= Redfish.Get Properties /redfish/v1/UpdateService/FirmwareInventory/${image_id}
- ${sw_functional}= Run Keyword If '${image_info["Description"]}' == 'BMC image'
+ ${sw_functional}= Run Keyword If
+ ... '${image_info["Description"]}' == 'BMC image' or '${image_info["Description"]}' == 'BMC update'
... Redfish.Get Attribute /redfish/v1/Managers/bmc FirmwareVersion
... ELSE
... Redfish.Get Attribute /redfish/v1/Systems/system BiosVersion
@@ -114,10 +115,12 @@
${manifest} ${stderr} ${rc}= BMC Execute Command cat /tmp/images/${image_id}/MANIFEST
Rprint Vars manifest
- Check Image Update Progress State
- ... match_state='Disabled', 'Updating' image_id=${image_id}
+ Wait Until Keyword Succeeds 1 min 05 sec
+ ... Check Image Update Progress State match_state='Disabled', 'Updating' image_id=${image_id}
+
# Wait a few seconds to check if the update progress started.
Sleep 5s
+
Check Image Update Progress State
... match_state='Updating' image_id=${image_id}