test case to check save area file char limit

changes:
    - Test case "Test Redfish Upload Partition
      File Name With Character Limit To BMC"
      Keyword "Check Redfish Upload Partition
      File Name With Character Limit To BMC"

Change-Id: I6e80509ea4fff12b48a34cf8c4181f529a6eead3
Signed-off-by: Sushil Singh <susilsi7@in.ibm.com>
diff --git a/openpower/ext_interfaces/test_savearea_management.robot b/openpower/ext_interfaces/test_savearea_management.robot
index b796a5e..f5a884f 100644
--- a/openpower/ext_interfaces/test_savearea_management.robot
+++ b/openpower/ext_interfaces/test_savearea_management.robot
@@ -235,6 +235,17 @@
     # file_name
     500KB-file
 
+
+Test Redfish Upload Partition File Name With Character Limit To BMC
+    [Documentation]  Upload partition file to BMC with file name character allowed limit
+    ...  and above allowed limit using Redfish.
+    [Tags]  Test_Redfish_Upload_Partition_File_Name_With_Character_Limit_To_BMC
+    [Template]  Check Redfish Upload Partition File Name With Character Limit To BMC
+
+    # file_name              status_code            message
+    50KB-testfilesavfile     ${HTTP_OK}             ${FILE_UPLOAD_MESSAGE}
+    50KB-testsaveareafile    ${HTTP_BAD_REQUEST}    ${MAXIMUM_FILE_NAME_MESSAGE}
+
 *** Keywords ***
 
 Suite Setup Execution
@@ -739,3 +750,29 @@
     ${resp}=  Run Keyword And Return Status
     ...  Redfish.Put  /ibm/v1/Host/ConfigFiles/../../../../../etc/resolv.conf  body={"data": "test string"}
     Should Be Equal As Strings  ${resp}  False
+
+
+Check Redfish Upload Partition File Name With Character Limit To BMC
+    [Documentation]  Upload the partition file to BMC with file name character limit.
+    [Arguments]  ${file_name}  ${status_code}  ${message}
+
+    # Description of argument(s):
+    # file_name       Partition file name.
+    # status_code     HTTPS status code.
+    # message         Expected message of from upload partition file URI.
+
+    @{Partition_file_list} =  Split String  ${file_name}  ,
+    ${num_records}=  Get Length  ${Partition_file_list}
+    Create Partition File  ${Partition_file_list}
+
+    ${file_name_length}=  Get Length  ${Partition_file_list}[0]
+
+    Run Keyword If  ${file_name_length} == 20
+    ...  Run Keywords
+    ...    Upload Partition File To BMC  ${Partition_file_list}  ${status_code}  ${message}  AND
+    ...    Verify Partition File On BMC  ${Partition_file_list}  Partition_status=1  AND
+    ...    Delete BMC Partition File  ${Partition_file_list}  ${HTTP_OK}  ${FILE_DELETED_MESSAGE}
+    ...  ELSE
+    ...    Upload Partition File To BMC  ${Partition_file_list}  ${status_code}  ${message}
+
+    Delete Local Partition File  ${Partition_file_list}