Automated test case to check the firmware version

Test Cases:
       - Primary functional
       - Backup or alternate 
       - Switch to backup 
       - Add code logic to handle template
       
Change-Id: I578c6a5b4d69962f04772af02a260df25b2da2ef
Signed-off-by: Sushil Singh <susilsi7@in.ibm.com>
diff --git a/lib/redfish_code_update_utils.robot b/lib/redfish_code_update_utils.robot
index 8afff2e..0d7fc56 100644
--- a/lib/redfish_code_update_utils.robot
+++ b/lib/redfish_code_update_utils.robot
@@ -145,6 +145,24 @@
     [Return]  ${list_inv_dict}[0]
 
 
+Get Non Functional Firmware List
+    [Documentation]  Get BMC non functional firmware details.
+    [Arguments]  ${sw_inv}  ${functional_state}
+
+    # Description of argument(s):
+    # sw_inv            This dictionary contains all the BMC firmware details.
+    # functional_state  Functional state can be either True or False.
+
+    ${list_inv}=  Create List
+
+    FOR  ${key}  IN  @{sw_inv.keys()}
+      Run Keyword If  '${sw_inv['${key}']['functional']}' == '${functional_state}'
+      ...  Append To List  ${list_inv}  ${sw_inv['${key}']}
+    END
+
+    [Return]  ${list_inv}
+
+
 Redfish Upload Image And Check Progress State
     [Documentation]  Code update with ApplyTime.