PLDM BIOS redfish changes

Changes:
     - Add logic to count failed BIOS attribute. Current code fails
       if one of the BIOS attribute write fails. The new code will
       handle the failure and add in the failed list and check once
       all the BIOS set operation is compelted.
     - Clean up new lines in the suite

Tested:
     Ran successfully
     robot -v OPENBMC_HOST:xx.xx.xx.xx
          --include Redfish_Verify_Set_BIOS_String_Attribute_Type
          --include Redfish_Verify_Set_BIOS_Integer_Attribute_Type
          pldm/test_redfish_bios_attributes.robot

Change-Id: If67684dd951973d579f595ea837eeb2114d88973
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/pldm/test_redfish_bios_attributes.robot b/pldm/test_redfish_bios_attributes.robot
index e865c4b..9e7f849 100755
--- a/pldm/test_redfish_bios_attributes.robot
+++ b/pldm/test_redfish_bios_attributes.robot
@@ -23,7 +23,6 @@
 *** Test Cases ***
 
 Redfish Verify Set BIOS Attribute With Invalid Attribute Name
-
     [Documentation]  Verify set BIOS attribute with invalid attribute name using
     ...              Redfish.
     [Tags]  Redfish_Verify_Set_BIOS_Attribute_With_Invalid_Attribute_Name
@@ -34,7 +33,6 @@
 
 
 Redfish Verify Set Invalid Optional Value For BIOS Enumeration Attribute Type
-
     [Documentation]  Verify set invalid optional value for BIOS enumeration attribute type
     ...              using Redfish.
     [Tags]  Redfish_Verify_Set_Invalid_Optional_Value_For_BIOS_Enumeration_Attribute_Type
@@ -48,7 +46,6 @@
 
 
 Redfish Verify Set Out Of Range Integer Value For BIOS Integer Attribute Type
-
     [Documentation]  Verify set out of range integer value for BIOS integer attribute type
     ...              using Redfish.
     [Tags]  Redfish_Verify_Set_Out_Of_Range_Integer_Value_For_BIOS_Integer_Attribute_Type
@@ -79,35 +76,49 @@
 
 
 Redfish Verify Set BIOS String Attribute Type
-
     [Documentation]  Verify set BIOS string attribute type for various BIOS
     ...              attribute handle with random values with in the range using Redfish.
     [Tags]  Redfish_Verify_Set_BIOS_String_Attribute_Type
 
+    @{failed_attr_list}=  Create List
+
     ${attr_val_data}=  GetBIOSStrAndIntAttributeHandles  BIOSString  ${attr_table_data}
     @{attr_handles}=  Get Dictionary Keys  ${attr_val_data}
     FOR  ${i}  IN  @{attr_handles}
         ${random_value}=  GetRandomBIOSIntAndStrValues  ${i}  ${attr_val_data['${i}']["MaximumStringLength"]}
-        Set BIOS Attribute Value And Verify  ${i}  ${random_value}
+        ${status}=  Run Keyword And Return Status
+        ...  Set BIOS Attribute Value And Verify  ${i}  ${random_value}
+        Run Keyword If  ${status} == ${False}  Append To List  ${failed_attr_list}  ${i}
     END
 
+    ${fail_count}=  Get Length  ${failed_attr_list}
+    Should Be Equal  ${fail_count}  ${0}
+    ...  msg= BIOS write Failed ${fail_count} list: ${failed_attr_list}
+
+
 
 Redfish Verify Set BIOS Integer Attribute Type
-
     [Documentation]  Verify set BIOS integer attribute type for various BIOS
     ...              attribute handle with random values with in the range using Redfish.
     [Tags]  Redfish_Verify_Set_BIOS_Integer_Attribute_Type
 
+    @{failed_attr_list}=  Create List
+
     ${attr_val_data}=  GetBIOSStrAndIntAttributeHandles  BIOSInteger  ${attr_table_data}
     @{attr_handles}=  Get Dictionary Keys  ${attr_val_data}
     FOR  ${i}  IN  @{attr_handles}
         ${random_value}=  GetRandomBIOSIntAndStrValues  ${i}  ${attr_val_data['${i}']["UpperBound"]}
-        Set BIOS Attribute Value And Verify  ${i}  ${random_value}
+        ${status}=  Run Keyword And Return Status
+        ...  Set BIOS Attribute Value And Verify  ${i}  ${random_value}
+        Run Keyword If  ${status} == ${False}  Append To List  ${failed_attr_list}  ${i}
     END
 
+    ${fail_count}=  Get Length  ${failed_attr_list}
+    Should Be Equal  ${fail_count}  ${0}
+    ...  msg= BIOS write Failed ${fail_count} list: ${failed_attr_list}
+
 
 Redfish Verify Set BIOS Enumeration Attribute Type
-
     [Documentation]  Validate get and update BIOS attribute optional values
     ...              and set back to original BIOS attribute values using Redfish.
     [Tags]  Redfish_Verify_Set_BIOS_Enumeration_Attribute_Type
@@ -128,7 +139,6 @@
 
 
 Redfish Verify Restore BIOS Attribute Values
-
     [Documentation]  Restore all BIOS attribute values with its default values and verify
     ...              using Redfish.
     [Tags]  Redfish_Verify_Restore_BIOS_Attribute_Values
@@ -144,7 +154,6 @@
 *** Keywords ***
 
 Redfish BIOS Suite Setup
-
     [Documentation]  Perform Redfish BIOS suite setup.
 
     Redfish.Login
@@ -156,7 +165,6 @@
 
 
 Redfish BIOS Suite Cleanup
-
     [Documentation]  Perform Redfish BIOS suite cleanup.
 
     @{attr_handles}=  Get Dictionary Keys  ${bios_original_data}