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.