Optionally validate the updated value in BIOS utility

- Set BIOS Attribute Value And Verify

Signed-off-by: Anusha Dathatri <adathatr@in.ibm.com>
Change-Id: I911a2cc07915d7a77262892f12fa621c513bcf73
diff --git a/lib/bios_attr_utils.robot b/lib/bios_attr_utils.robot
index 0d67983..319f17f 100644
--- a/lib/bios_attr_utils.robot
+++ b/lib/bios_attr_utils.robot
@@ -11,7 +11,13 @@
 Set BIOS Attribute Value And Verify
 
     [Documentation]  Set BIOS attribute handle with attribute value and verify.
-    [Arguments]      ${attr_handle}  ${attr_val}
+    [Arguments]      ${attr_handle}  ${attr_val}  ${verify}=${True}
+
+    # Description of argument(s):
+    # ${attr_handle}    BIOS Attribute handle (e.g. 'vmi_if0_ipv4_method').
+    # @{attr_val}       Attribute value for the given attribute handle.
+    # ${verify}         Verify the new value.
+
 
     ${type_int}=    Evaluate  isinstance($attr_val, int)
     ${value}=  Set Variable If  '${type_int}' == '${True}'  ${attr_val}  '${attr_val}'
@@ -19,8 +25,7 @@
     Redfish.Patch  ${BIOS_ATTR_SETTINGS_URI}  body={"Attributes":{"${attr_handle}": ${value}}}
     ...  valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
 
-    ${output}=  Redfish.Get Attribute  ${BIOS_ATTR_URI}  Attributes
-    Should Be Equal  ${output['${attr_handle}']}  ${attr_val}
+    Run Keyword If  '${verify}' == '${True}'  Verify BIOS Attribute  ${attr_handle}  ${attr_val}
 
 
 Set Optional BIOS Attribute Values And Verify
@@ -38,3 +43,16 @@
         ${new_attr}=  Evaluate  $attr.replace('"', '')
         Set BIOS Attribute Value And Verify  ${attr_handle}  ${new_attr}
     END
+
+
+Verify BIOS Attribute
+
+    [Documentation]  Verify BIOS attribute value.
+    [Arguments]  ${attr_handle}  ${attr_val}
+
+    # Description of argument(s):
+    # ${attr_handle}    BIOS Attribute handle (e.g. 'vmi_if0_ipv4_method').
+    # ${attr_val}       The expected value for the given attribute handle.
+
+    ${output}=  Redfish.Get Attribute  ${BIOS_ATTR_URI}  Attributes
+    Should Be Equal  ${output['${attr_handle}']}  ${attr_val}