| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 1 | *** Settings *** | 
 | 2 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 3 | Documentation     Test Save Area feature of Management Console on BMC. | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 4 |  | 
 | 5 | Resource          ../../lib/rest_client.robot | 
 | 6 | Resource          ../../lib/openbmc_ffdc.robot | 
 | 7 | Resource          ../../lib/resource.robot | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 8 | Resource          ../../lib/bmc_redfish_utils.robot | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 9 | Resource          ../../lib/utils.robot | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 10 | Resource          ../../lib/bmc_redfish_resource.robot | 
| Sushil Singh | 177b459 | 2022-09-20 08:25:25 -0500 | [diff] [blame] | 11 | Resource          ../../lib/external_intf/management_console_utils.robot | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 12 |  | 
| Vijay | 3937315 | 2020-02-14 08:08:20 -0600 | [diff] [blame] | 13 | Suite Setup       Suite Setup Execution | 
 | 14 | Test Teardown     Test Teardown Execution | 
 | 15 | Suite Teardown    Suite Teardown Execution | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 16 |  | 
| Matt Fischer | 6fb70d9 | 2023-10-24 19:06:33 -0600 | [diff] [blame] | 17 | Test Tags        Savearea_Management | 
| George Keishing | 7c32f30 | 2023-10-10 16:11:46 +0530 | [diff] [blame] | 18 |  | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 19 | *** Variables *** | 
 | 20 |  | 
| Sushil Singh | de1347d | 2022-07-13 02:54:26 -0500 | [diff] [blame] | 21 | ${MAXIMUM_FILE_SIZE_MESSAGE}        File size exceeds maximum allowed size[25MB] | 
| Sushil Singh | 1544c5e | 2021-11-03 07:56:37 -0500 | [diff] [blame] | 22 | ${MAXIMUM_DIR_SIZE_MESSAGE} | 
| Sushil Singh | de1347d | 2022-07-13 02:54:26 -0500 | [diff] [blame] | 23 | ...   File size does not fit in the savearea directory maximum allowed size[25MB] | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 24 | ${FILE_UPLOAD_MESSAGE}              File Created | 
 | 25 | ${FILE_DELETED_MESSAGE}             File Deleted | 
 | 26 | ${FILE_UPDATED_MESSAGE}             File Updated | 
 | 27 | ${FORBIDDEN_MESSAGE}                Forbidden | 
 | 28 | ${ERROR_MESSAGE}                    Error while creating the file | 
 | 29 | ${RESOURCE_NOT_FOUND_MESSAGE}       Resource Not Found | 
 | 30 | ${MINIMUM_FILE_SIZE_MESSAGE}        File size is less than minimum allowed size[100B] | 
 | 31 | ${MAXIMUM_FILE_NAME_MESSAGE}        Filename must be maximum 20 characters | 
 | 32 | ${UNSUPPORTED_FILE_NAME_MESSAGE}    Unsupported character in filename | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 33 |  | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 34 | ${content-1}                        Sample Content to test partition file upload | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 35 | ...  Sample Content to test partition file upload | 
 | 36 | ...  Sample Content to test partition file upload | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 37 | ${content-2}                        Sample Content to test partition file upload after reboot | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 38 | ...  Sample Content to test partition file upload after reboot | 
 | 39 | ...  Sample Content to test partition file upload after reboot | 
 | 40 |  | 
| Sushil Singh | 44b8cf3 | 2021-11-17 06:57:09 -0600 | [diff] [blame] | 41 | ${LOOP_COUNT}                       10 | 
 | 42 |  | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 43 | *** Test Cases *** | 
 | 44 |  | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 45 | Redfish Upload Lower Limit Partition File To BMC | 
 | 46 |     [Documentation]  Upload lower limit of allowed partition file to BMC using Redfish. | 
 | 47 |     [Tags]  Redfish_Upload_Lower_Limit_Partition_File_To_BMC | 
 | 48 |     [Template]  Redfish Upload Partition File | 
 | 49 |  | 
| Sushil Singh | 255ec63 | 2021-08-26 08:08:21 -0500 | [diff] [blame] | 50 |     # file_name | 
 | 51 |     100-file | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 52 |  | 
 | 53 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 54 | Redfish Upload Partition File To BMC | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 55 |     [Documentation]  Upload partition file to BMC using Redfish. | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 56 |     [Tags]  Redfish_Upload_Partition_File_To_BMC | 
 | 57 |     [Template]  Redfish Upload Partition File | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 58 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 59 |     # file_name | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 60 |     500KB-file | 
| Sushil Singh | de1347d | 2022-07-13 02:54:26 -0500 | [diff] [blame] | 61 |     2000KB-file | 
| Sushil Singh | 1544c5e | 2021-11-03 07:56:37 -0500 | [diff] [blame] | 62 |     10000KB-file | 
| Sushil Singh | de1347d | 2022-07-13 02:54:26 -0500 | [diff] [blame] | 63 |     25000KB-file | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 64 |  | 
 | 65 |  | 
| Sushil Singh | 255ec63 | 2021-08-26 08:08:21 -0500 | [diff] [blame] | 66 | Test Upload Lower Limit Partition File To BMC And Expect Failure | 
 | 67 |     [Documentation]  Fail to upload partition file to BMC with file size | 
 | 68 |     ...  below the lower limit of allowed partition file size using Redfish. | 
 | 69 |     [Tags]  Test_Upload_Lower_Limit_Partition_File_To_BMC_And_Expect_Failure | 
 | 70 |     [Template]  Redfish Fail To Upload Partition File | 
 | 71 |  | 
| Sushil Singh | 1544c5e | 2021-11-03 07:56:37 -0500 | [diff] [blame] | 72 |     # file_name    status_code            partition_status    response_message | 
 | 73 |     99-file        ${HTTP_BAD_REQUEST}    0                   ${MINIMUM_FILE_SIZE_MESSAGE} | 
| Sushil Singh | 255ec63 | 2021-08-26 08:08:21 -0500 | [diff] [blame] | 74 |  | 
 | 75 |  | 
| Sushil Singh | 298d15d | 2021-12-14 07:21:09 -0600 | [diff] [blame] | 76 | Test Upload Upper Limit Partition File To BMC And Expect Failure | 
 | 77 |     [Documentation]  Fail to upload partition file to BMC with file size | 
 | 78 |     ...  more than upper limit of allowed partition file size using Redfish. | 
 | 79 |     [Tags]  Test_Upload_Upper_Limit_Partition_File_To_BMC_And_Expect_Failure | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 80 |     [Template]  Redfish Fail To Upload Partition File | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 81 |  | 
| Sushil Singh | 1544c5e | 2021-11-03 07:56:37 -0500 | [diff] [blame] | 82 |     # file_name     status_code            partition_status    response_message | 
| Sushil Singh | de1347d | 2022-07-13 02:54:26 -0500 | [diff] [blame] | 83 |     25001KB-file    ${HTTP_BAD_REQUEST}    0                   ${MAXIMUM_FILE_SIZE_MESSAGE} | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 84 |  | 
 | 85 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 86 | Redfish Upload Multiple Partition File To BMC | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 87 |     [Documentation]  Upload multiple partition file to BMC using Redfish. | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 88 |     [Tags]  Redfish_Upload_Multiple_Partition_File_To_BMC | 
 | 89 |     [Template]  Redfish Upload Partition File | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 90 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 91 |     # file_name | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 92 |     250KB-file,500KB-file | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 93 |  | 
 | 94 |  | 
| Sushil Singh | f9eeec7 | 2021-12-14 08:31:59 -0600 | [diff] [blame] | 95 | Test Upload Partition File When BMC Space Reach Max And Expect Failure | 
 | 96 |     [Documentation]  Fail to upload multiple partition file to BMC | 
 | 97 |     ...  as BMC directory reach to upper limit using Redfish. | 
 | 98 |     [Tags]  Test_Upload_Partition_File_When_BMC_Space_Reach_Max_And_Expect_Failure | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 99 |     [Template]  Redfish Fail To Upload Partition File | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 100 |  | 
| Sushil Singh | 1544c5e | 2021-11-03 07:56:37 -0500 | [diff] [blame] | 101 |     # file_name     status_code            partition_status    response_message | 
| Sushil Singh | de1347d | 2022-07-13 02:54:26 -0500 | [diff] [blame] | 102 |     15000KB-file    ${HTTP_OK}             1                   ${FILE_UPLOAD_MESSAGE} | 
 | 103 |     16000KB-file    ${HTTP_BAD_REQUEST}    0                   ${MAXIMUM_DIR_SIZE_MESSAGE} | 
 | 104 |     25000KB-file    ${HTTP_OK}             1                   ${FILE_UPLOAD_MESSAGE} | 
| Sushil Singh | 1544c5e | 2021-11-03 07:56:37 -0500 | [diff] [blame] | 105 |     100-file        ${HTTP_BAD_REQUEST}    0                   ${MAXIMUM_DIR_SIZE_MESSAGE} | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 106 |  | 
 | 107 |  | 
| Sushil Singh | df6ba52 | 2020-11-24 04:17:00 -0600 | [diff] [blame] | 108 | Redfish Upload Same Partition File To BMC In Loop | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 109 |     [Documentation]  Upload same partition file to BMC using Redfish in loop. | 
| Sushil Singh | df6ba52 | 2020-11-24 04:17:00 -0600 | [diff] [blame] | 110 |     [Tags]  Redfish_Upload_Same_Partition_File_To_BMC_In_Loop | 
 | 111 |     [Template]  Redfish Upload Partition File In Loop | 
 | 112 |  | 
 | 113 |     # file_name | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 114 |     500KB-file | 
| Sushil Singh | df6ba52 | 2020-11-24 04:17:00 -0600 | [diff] [blame] | 115 |  | 
 | 116 |  | 
| Sushil Singh | f39629c | 2020-12-11 07:30:21 -0600 | [diff] [blame] | 117 | Redfish Upload And Delete Same Partition File To BMC In Loop | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 118 |     [Documentation]  Upload same partition file to BMC using Redfish in loop. | 
| Sushil Singh | f39629c | 2020-12-11 07:30:21 -0600 | [diff] [blame] | 119 |     [Tags]  Redfish_Upload_And_Delete_Same_Partition_File_To_BMC_In_Loop | 
 | 120 |     [Template]  Redfish Upload And Delete Partition File In Loop | 
 | 121 |  | 
 | 122 |     # file_name | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 123 |     500KB-file | 
| Sushil Singh | f39629c | 2020-12-11 07:30:21 -0600 | [diff] [blame] | 124 |  | 
 | 125 |  | 
| Sushil Singh | 5d0782f | 2020-11-23 06:35:35 -0600 | [diff] [blame] | 126 | Redfish Partition File Upload Post BMC Reboot | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 127 |     [Documentation]  Upload partition file to BMC using Redfish, after the BMC reboot. | 
| Sushil Singh | 5d0782f | 2020-11-23 06:35:35 -0600 | [diff] [blame] | 128 |     [Tags]  Redfish_Partition_File_Upload_Post_BMC_Reboot | 
 | 129 |     [Template]  Verify Partition File Upload Post BMC Reboot | 
 | 130 |  | 
 | 131 |     # file_name | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 132 |     500KB-file | 
| Sushil Singh | 5d0782f | 2020-11-23 06:35:35 -0600 | [diff] [blame] | 133 |  | 
 | 134 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 135 | Redfish Partition File Persistency On BMC Reboot | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 136 |     [Documentation]  Upload partition file to BMC using Redfish and is same after reboot. | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 137 |     [Tags]  Redfish_Partition_File_Persistency_On_BMC_Reboot | 
 | 138 |     [Template]  Redfish Partition File Persistency | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 139 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 140 |     # file_name | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 141 |     500KB-file | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 142 |  | 
 | 143 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 144 | Redfish Multiple Partition File Persistency On BMC Reboot | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 145 |     [Documentation]  Upload multiple partition file to BMC using Redfish and is same after reboot. | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 146 |     [Tags]  Redfish_Multiple_Partition_File_Persistency_On_BMC_Reboot | 
 | 147 |     [Template]  Redfish Partition File Persistency | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 148 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 149 |     # file_name | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 150 |     250KB-file,500KB-file | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 151 |  | 
 | 152 |  | 
| Sushil Singh | b22e4b6 | 2021-12-15 00:54:53 -0600 | [diff] [blame] | 153 | Redfish Read Partition File From BMC | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 154 |     [Documentation]  Upload partition file to BMC using Redfish and verify the content. | 
| Sushil Singh | b22e4b6 | 2021-12-15 00:54:53 -0600 | [diff] [blame] | 155 |     [Tags]  Redfish_Read_Partition_File_From_BMC | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 156 |     [Template]  Redfish Read Partition File | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 157 |  | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 158 |     # file_name                      reboot_flag | 
 | 159 |     testfile01-file                  False | 
 | 160 |     testfile01-file,testfile02-file  False | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 161 |  | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 162 |  | 
| Sushil Singh | b22e4b6 | 2021-12-15 00:54:53 -0600 | [diff] [blame] | 163 | Redfish Read Partition File Post BMC Reboot | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 164 |     [Documentation]  Upload partition file to BMC using Redfish and verify the content after reboot. | 
| Sushil Singh | b22e4b6 | 2021-12-15 00:54:53 -0600 | [diff] [blame] | 165 |     [Tags]  Redfish_Read_Partition_File_Post_BMC_Reboot | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 166 |     [Template]  Redfish Read Partition File | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 167 |  | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 168 |     # file_name                      reboot_flag | 
 | 169 |     testfile01-file                  True | 
 | 170 |     testfile01-file,testfile02-file  True | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 171 |  | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 172 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 173 | Redfish Update Partition File On BMC | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 174 |     [Documentation]  Upload partition file to BMC using Redfish and verify the content. | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 175 |     [Tags]  Redfish_Update_Partition_File_On_BMC | 
 | 176 |     [Template]  Redfish Update Partition File With Different Content | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 177 |  | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 178 |     # file_name                 reboot_flag | 
 | 179 |     testfile01-file             False | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 180 |  | 
 | 181 |  | 
 | 182 | Redfish Update Partition File On BMC Reboot | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 183 |     [Documentation]  Upload partition file to BMC using Redfish and verify the content after the reboot. | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 184 |     [Tags]  Redfish_Update_Partition_File_On_BMC_Reboot | 
 | 185 |     [Template]  Redfish Update Partition File With Different Content | 
 | 186 |  | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 187 |     # file_name                 reboot_flag | 
 | 188 |     testfile01-file             True | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 189 |  | 
 | 190 |  | 
 | 191 | Redfish Persistency Update Partition File On BMC | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 192 |     [Documentation]  Upload partition file to BMC using Redfish and verify the content. | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 193 |     [Tags]  Redfish_Persistency_Update_Partition_File_On_BMC | 
 | 194 |     [Template]  Redfish Update Partition File With Same Content | 
 | 195 |  | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 196 |     # file_name                 reboot_flag | 
 | 197 |     testfile01-file             False | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 198 |  | 
 | 199 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 200 | Redfish Delete Non Existence Of Partition File | 
 | 201 |     [Documentation]  Delete the partition file if do not exists. | 
 | 202 |     [Tags]  Redfish_Delete_Non_Existence_Of_Partition_File | 
 | 203 |     [Template]  Redfish Delete Non Existence Partition File | 
 | 204 |  | 
 | 205 |     # file_name | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 206 |     testfile01-file | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 207 |  | 
 | 208 |  | 
 | 209 | Verify One Thousand Partitions File Upload | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 210 |     [Documentation]  Upload 1000 partition file to BMC. | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 211 |     [Tags]  Verify_One_Thousand_Partitions_File_Upload | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 212 |     [Template]  Redfish Upload Partition File With Range | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 213 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 214 |     # range | 
 | 215 |     1000 | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 216 |  | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 217 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 218 | Non Admin Users Fail To Upload Partition File | 
 | 219 |     [Documentation]  Non admin user will fail to upload the partition file. | 
 | 220 |     [Tags]  Non_Admin_Users_Fail_To_Upload_Partition_File | 
 | 221 |     [Template]  Non Admin User To Upload Partition File | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 222 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 223 |     # file_name    username         password       role_id | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 224 |     500KB-file     operator_user    TestPwd123     Operator | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 225 |  | 
 | 226 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 227 | Non Admin User Delete Non Existence Of Partition File | 
| George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 228 |     [Documentation]  Delete the partition file if does not exists. | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 229 |     [Tags]  Non_Admin_User_Delete_Non_Existence_Of_Partition_File | 
 | 230 |     [Template]  Non Admin Delete Non Existence Partition File | 
 | 231 |  | 
 | 232 |     # file_name    username         password       role_id | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 233 |     500KB-file     operator_user    TestPwd123     Operator | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 234 |  | 
 | 235 |  | 
 | 236 | Redfish Update Wrong Partition File To BMC | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 237 |     [Documentation]  Upload partition file to BMC by wrong URI using Redfish. | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 238 |     [Tags]  Redfish_Update_Wrong_Partition_File_To_BMC | 
 | 239 |     [Template]  Verify Update Wrong Partition File To BMC | 
 | 240 |  | 
 | 241 |     # file_name | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 242 |     500KB-file | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 243 |  | 
| Sushil Singh | 9942df5 | 2021-09-03 02:28:11 -0500 | [diff] [blame] | 244 |  | 
 | 245 | Test Redfish Upload Partition File Name With Character Limit To BMC | 
 | 246 |     [Documentation]  Upload partition file to BMC with file name character allowed limit | 
 | 247 |     ...  and above allowed limit using Redfish. | 
 | 248 |     [Tags]  Test_Redfish_Upload_Partition_File_Name_With_Character_Limit_To_BMC | 
 | 249 |     [Template]  Check Redfish Upload Partition File Name With Character Limit To BMC | 
 | 250 |  | 
 | 251 |     # file_name              status_code            message | 
 | 252 |     50KB-testfilesavfile     ${HTTP_OK}             ${FILE_UPLOAD_MESSAGE} | 
 | 253 |     50KB-testsaveareafile    ${HTTP_BAD_REQUEST}    ${MAXIMUM_FILE_NAME_MESSAGE} | 
 | 254 |  | 
| Sushil Singh | 2dbcbde | 2021-09-09 08:50:48 -0500 | [diff] [blame] | 255 |  | 
 | 256 | Test Redfish Fail To Upload Partition File Name With Special Character To BMC | 
 | 257 |     [Documentation]  Upload partition file to BMC with special character file name and | 
 | 258 |     ...  Redfish through an error. | 
 | 259 |     [Tags]  Test_Redfish_Fail_To_Upload_Partition_File_Name_With_Special_Character_To_BMC | 
 | 260 |     [Template]  Check Redfish Fail To Upload Partition File Name With Special Character To BMC | 
 | 261 |  | 
 | 262 |     # file_name      status_code            message | 
 | 263 |     1KB-*filename    ${HTTP_BAD_REQUEST}    ${UNSUPPORTED_FILE_NAME_MESSAGE} | 
 | 264 |     1KB-!filename    ${HTTP_BAD_REQUEST}    ${UNSUPPORTED_FILE_NAME_MESSAGE} | 
 | 265 |     1KB-@filename    ${HTTP_BAD_REQUEST}    ${UNSUPPORTED_FILE_NAME_MESSAGE} | 
 | 266 |  | 
| Sushil Singh | 44b8cf3 | 2021-11-17 06:57:09 -0600 | [diff] [blame] | 267 |  | 
| Sushil Singh | 404416d | 2022-12-23 08:14:43 -0600 | [diff] [blame] | 268 | Redfish Persistency Update Partition File Post BMC Reboot | 
 | 269 |     [Documentation]  Upload partition file to BMC using Redfish and verify the content after the reboot. | 
 | 270 |     [Tags]  Redfish_Persistency_Update_Partition_File_Post_BMC_Reboot | 
 | 271 |     [Template]  Redfish Update Partition File With Same Content | 
 | 272 |  | 
 | 273 |     # file_name                 reboot_flag | 
 | 274 |     testfile01-file             True | 
 | 275 |  | 
 | 276 |  | 
| Sushil Singh | 44b8cf3 | 2021-11-17 06:57:09 -0600 | [diff] [blame] | 277 | Redfish Upload Validated Partition File From Path To BMC | 
 | 278 |    [Documentation]  Upload valid partition file to BMC from file path define by user in loop. | 
 | 279 |    ...  By default loop count values is 10 times. | 
 | 280 |    [Tags]  Redfish_Upload_Validated_Partition_File_From_Path_To_BMC | 
 | 281 |  | 
 | 282 |    Log To Console  ${EMPTY} | 
 | 283 |    FOR  ${count}  IN RANGE  1  ${LOOP_COUNT} + 1 | 
 | 284 |      Log To Console  ************************************** | 
 | 285 |      Log To Console  * The Current Loop Count is ${count} of ${LOOP_COUNT} * | 
 | 286 |      Log To Console  ************************************** | 
 | 287 |  | 
 | 288 |      Redfish Upload Partition File From Path  ${PARTITION_FILE_PATH} | 
 | 289 |    END | 
 | 290 |  | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 291 | *** Keywords *** | 
 | 292 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 293 | Suite Setup Execution | 
 | 294 |     [Documentation]  Suite setup execution. | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 295 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 296 |     Redfish.Login | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 297 |  | 
 | 298 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 299 | Test Teardown Execution | 
 | 300 |     [Documentation]  Test teardown execution. | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 301 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 302 |     Delete All BMC Partition File  ${HTTP_OK} | 
 | 303 |     FFDC On Test Case Fail | 
 | 304 |  | 
 | 305 |  | 
 | 306 | Suite Teardown Execution | 
 | 307 |     [Documentation]  Suite teardown execution. | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 308 |  | 
 | 309 |     Delete All Sessions | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 310 |  | 
 | 311 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 312 | Delete Local Partition File | 
 | 313 |     [Documentation]  Delete local partition file. | 
 | 314 |     [Arguments]  ${file_name} | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 315 |  | 
 | 316 |     # Description of argument(s): | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 317 |     # file_name    Partition file name. | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 318 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 319 |     FOR  ${conf_file}  IN  @{file_name} | 
 | 320 |       ${file_exist}=  Run Keyword And Return Status  OperatingSystem.File Should Exist  ${conf_file} | 
| Sridevi Ramesh | 162c52a | 2025-05-13 23:47:09 -0500 | [diff] [blame] | 321 |       IF  'True' == '${file_exist}'  Remove File  ${conf_file} | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 322 |     END | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 323 |  | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 324 |  | 
| Sushil Singh | 1544c5e | 2021-11-03 07:56:37 -0500 | [diff] [blame] | 325 | Delete Local Server Partition File | 
 | 326 |     [Documentation]  Local partition files which is getting uploaded to BMC, | 
 | 327 |     ...  will get deleted after the uploads. If partition file name consist | 
 | 328 |     ...  of “-file” then partition file gets deleted. | 
 | 329 |  | 
 | 330 |     @{conf_file_list} =  OperatingSystem.List Files In Directory  ${EXECDIR} | 
 | 331 |     ${match_conf_file_list}=  Get Matches  ${conf_file_list}  regexp=.*-file  case_insensitive=${True} | 
 | 332 |  | 
 | 333 |     ${num_records}=  Get Length  ${match_conf_file_list} | 
 | 334 |     Return From Keyword If  ${num_records} == ${0}  ${EMPTY} | 
 | 335 |  | 
 | 336 |     FOR  ${conf_file}  IN  @{match_conf_file_list} | 
 | 337 |       ${file_exist}=  Run Keyword And Return Status  OperatingSystem.File Should Exist  ${conf_file} | 
| Sridevi Ramesh | 162c52a | 2025-05-13 23:47:09 -0500 | [diff] [blame] | 338 |       IF  'True' == '${file_exist}'  Remove File  ${conf_file} | 
| Sushil Singh | 1544c5e | 2021-11-03 07:56:37 -0500 | [diff] [blame] | 339 |     END | 
 | 340 |  | 
 | 341 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 342 | Create Partition File | 
 | 343 |     [Documentation]  Create Partition file. | 
 | 344 |     [Arguments]  ${file_name} | 
 | 345 |  | 
 | 346 |     # Description of argument(s): | 
 | 347 |     # file_name    Partition file name. | 
 | 348 |  | 
 | 349 |     Delete Local Partition File  ${file_name} | 
 | 350 |  | 
 | 351 |     FOR  ${conf_file}  IN  @{file_name} | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 352 |       @{words}=  Split String  ${conf_file}  - | 
| Sushil Singh | 255ec63 | 2021-08-26 08:08:21 -0500 | [diff] [blame] | 353 |       Run  dd if=/dev/zero of=${conf_file} bs=${words}[-0] count=1 | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 354 |       OperatingSystem.File Should Exist  ${conf_file} | 
 | 355 |     END | 
 | 356 |  | 
 | 357 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 358 | Delete BMC Partition File | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 359 |     [Documentation]  Delete single partition file on BMC via Redfish. | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 360 |     [Arguments]  ${file_name}  ${status_code}  ${expected_message} | 
 | 361 |  | 
 | 362 |     # Description of argument(s): | 
 | 363 |     # file_name           Partition file name. | 
 | 364 |     # status_code         HTTPS status code. | 
 | 365 |     # expected_message    Expected message of URI. | 
 | 366 |  | 
 | 367 |     FOR  ${conf_file}  IN  @{file_name} | 
 | 368 |       ${data}=  Create Dictionary | 
 | 369 |       ${headers}=  Create Dictionary  X-Auth-Token=${XAUTH_TOKEN} | 
 | 370 |       Set To Dictionary  ${data}  headers  ${headers} | 
 | 371 |  | 
| George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 372 |       ${resp}=  DELETE On Session  openbmc  /ibm/v1/Host/ConfigFiles/${conf_file}  &{data} | 
 | 373 |       ...  expected_status=any | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 374 |       Should Be Equal As Strings  ${resp.status_code}  ${status_code} | 
 | 375 |  | 
| Sushil Singh | 7aa3cc4 | 2021-08-19 07:42:29 -0500 | [diff] [blame] | 376 |       ${description}=  Return Description Of Response  ${resp.text} | 
 | 377 |       Should Be Equal As Strings  ${description}  ${expected_message} | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 378 |     END | 
 | 379 |  | 
 | 380 |  | 
 | 381 | Delete All BMC Partition File | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 382 |     [Documentation]  Delete multiple partition file on BMC via Redfish. | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 383 |     [Arguments]  ${status_code} | 
 | 384 |  | 
 | 385 |     # Description of argument(s): | 
 | 386 |     # status_code       HTTPS status code. | 
 | 387 |  | 
 | 388 |     Initialize OpenBMC | 
 | 389 |     ${data}=  Create Dictionary | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 390 |     ${headers}=  Create Dictionary  X-Auth-Token=${XAUTH_TOKEN} | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 391 |     Set To Dictionary  ${data}  headers  ${headers} | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 392 |  | 
| George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 393 |     ${resp}=  POST On Session  openbmc  /ibm/v1/Host/ConfigFiles/Actions/IBMConfigFiles.DeleteAll  &{data} | 
 | 394 |     ...  expected_status=any | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 395 |     Should Be Equal As Strings  ${resp.status_code}  ${status_code} | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 396 |  | 
 | 397 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 398 | Return Description Of Response | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 399 |     [Documentation]  Return description of REST response. | 
 | 400 |     [Arguments]  ${resp_text} | 
 | 401 |  | 
 | 402 |     # Description of argument(s): | 
 | 403 |     # resp_text    REST response body. | 
 | 404 |  | 
 | 405 |     # resp_text after successful partition file upload looks like: | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 406 |     # { | 
 | 407 |     #    "Description": "File Created" | 
 | 408 |     # } | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 409 |  | 
| Sushil Singh | 7aa3cc4 | 2021-08-19 07:42:29 -0500 | [diff] [blame] | 410 |     ${status}=  Run Keyword And Return Status  Evaluate  isinstance(${resp_text}, dict) | 
 | 411 |     Return From Keyword If  '${status}' == 'False'  ${resp_text} | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 412 |     ${message}=  Evaluate  json.loads('''${resp_text}''')  json | 
 | 413 |  | 
| George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 414 |     RETURN  ${message["Description"]} | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 415 |  | 
 | 416 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 417 | Upload Partition File To BMC | 
 | 418 |     [Documentation]  Upload partition file to BMC. | 
| Sushil Singh | 44b8cf3 | 2021-11-17 06:57:09 -0600 | [diff] [blame] | 419 |     [Arguments]  ${file_name}  ${status_code}  ${expected_message}  ${flag}=${True}  ${path}=${EMPTY} | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 420 |  | 
 | 421 |     # Description of argument(s): | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 422 |     # file_name           Partition file name. | 
 | 423 |     # status_code         HTTPS status code. | 
 | 424 |     # expected_message    Expected message of URI. | 
 | 425 |     # flag                If True run part of program, else skip. | 
| Sushil Singh | 44b8cf3 | 2021-11-17 06:57:09 -0600 | [diff] [blame] | 426 |     # path                Partition file path. | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 427 |  | 
| Sridevi Ramesh | 162c52a | 2025-05-13 23:47:09 -0500 | [diff] [blame] | 428 |     IF  '${flag}' == '${True}'  Initialize OpenBMC | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 429 |     FOR  ${conf_file}  IN  @{file_name} | 
 | 430 |       # Get the content of the file and upload to BMC. | 
| Sushil Singh | 44b8cf3 | 2021-11-17 06:57:09 -0600 | [diff] [blame] | 431 |       ${image_data}=  OperatingSystem.Get Binary File  ${path}${conf_file} | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 432 |       ${headers}=  Create Dictionary  X-Auth-Token=${XAUTH_TOKEN}  Content-Type=application/octet-stream | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 433 |  | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 434 |       ${kwargs}=  Create Dictionary  data=${image_data} | 
 | 435 |       Set To Dictionary  ${kwargs}  headers  ${headers} | 
| George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 436 |       ${resp}=  PUT On Session  openbmc  /ibm/v1/Host/ConfigFiles/${conf_file}  &{kwargs}  timeout=10 | 
 | 437 |       ...  expected_status=any | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 438 |       Should Be Equal As Strings  ${resp.status_code}  ${status_code} | 
 | 439 |  | 
| Sushil Singh | 7aa3cc4 | 2021-08-19 07:42:29 -0500 | [diff] [blame] | 440 |       ${description}=  Return Description Of Response  ${resp.text} | 
 | 441 |       Should Be Equal As Strings  ${description}  ${expected_message} | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 442 |     END | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 443 |  | 
 | 444 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 445 | Verify Partition File On BMC | 
 | 446 |     [Documentation]  Verify partition file on BMC. | 
 | 447 |     [Arguments]  ${file_name}  ${Partition_status} | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 448 |  | 
 | 449 |     # Description of argument(s): | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 450 |     # file_name           Partition file name. | 
 | 451 |     # Partition_status    Partition file status on BMC. | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 452 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 453 |     FOR  ${conf_file}  IN  @{file_name} | 
 | 454 |       ${status}  ${stderr}  ${rc}=  BMC Execute Command | 
| Sushil Singh | e5f39ee | 2021-01-06 00:39:12 -0600 | [diff] [blame] | 455 |       ...  ls -l /var/lib/bmcweb/ibm-management-console/configfiles/${conf_file} | wc -l | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 456 |       Valid Value  ${status}  [${Partition_status}] | 
 | 457 |     END | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 458 |  | 
 | 459 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 460 | Redfish Upload Partition File | 
 | 461 |     [Documentation]  Upload the partition file. | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 462 |     [Arguments]  ${file_name}  ${file_size}=${EMPTY} | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 463 |  | 
 | 464 |     # Description of argument(s): | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 465 |     # file_name    Partition file name. | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 466 |     # file_size    By Default is set to EMPTY, | 
 | 467 |     #              if user pass small_file_size the create file with small | 
 | 468 |     #              size keyword gets executed. | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 469 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 470 |     @{Partition_file_list} =  Split String  ${file_name}  , | 
 | 471 |     ${num_records}=  Get Length  ${Partition_file_list} | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 472 |  | 
| Sushil Singh | 255ec63 | 2021-08-26 08:08:21 -0500 | [diff] [blame] | 473 |     Create Partition File  ${Partition_file_list} | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 474 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 475 |     Upload Partition File To BMC  ${Partition_file_list}  ${HTTP_OK}  ${FILE_UPLOAD_MESSAGE} | 
 | 476 |     Verify Partition File On BMC  ${Partition_file_list}  Partition_status=1 | 
| Sridevi Ramesh | 162c52a | 2025-05-13 23:47:09 -0500 | [diff] [blame] | 477 |     IF  ${num_records} == ${1} | 
 | 478 |         Delete BMC Partition File  ${Partition_file_list}  ${HTTP_OK}  ${FILE_DELETED_MESSAGE} | 
 | 479 |     ELSE | 
 | 480 |         Delete All BMC Partition File  ${HTTP_OK} | 
 | 481 |     END | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 482 |     Delete Local Partition File  ${Partition_file_list} | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 483 |  | 
 | 484 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 485 | Redfish Fail To Upload Partition File | 
| George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 486 |     [Documentation]  Fail to upload the partition file. | 
| Sushil Singh | 1544c5e | 2021-11-03 07:56:37 -0500 | [diff] [blame] | 487 |     [Arguments]  ${file_name}  ${status_code}  ${partition_status}  ${response_message}=${EMPTY} | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 488 |  | 
 | 489 |     # Description of argument(s): | 
| Sushil Singh | 255ec63 | 2021-08-26 08:08:21 -0500 | [diff] [blame] | 490 |     # file_name           Partition file name. | 
| Sushil Singh | 1544c5e | 2021-11-03 07:56:37 -0500 | [diff] [blame] | 491 |     # status_code         HTTPS status code. | 
 | 492 |     # partition_status    Partition status. | 
| Sushil Singh | 255ec63 | 2021-08-26 08:08:21 -0500 | [diff] [blame] | 493 |     # response_message    By default is set to EMPTY, | 
| Sushil Singh | 1544c5e | 2021-11-03 07:56:37 -0500 | [diff] [blame] | 494 |     #                     else user provide the information when user upload the partition with file size | 
| Sushil Singh | 255ec63 | 2021-08-26 08:08:21 -0500 | [diff] [blame] | 495 |     #                     below lower linit of allowed partition or more than of large allowed partition. | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 496 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 497 |     @{Partition_file_list} =  Split String  ${file_name}  , | 
| Sushil Singh | 255ec63 | 2021-08-26 08:08:21 -0500 | [diff] [blame] | 498 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 499 |     Create Partition File  ${Partition_file_list} | 
| Sushil Singh | 1544c5e | 2021-11-03 07:56:37 -0500 | [diff] [blame] | 500 |     Upload Partition File To BMC  ${Partition_file_list}  ${status_code}  ${response_message} | 
 | 501 |     Verify Partition File On BMC  ${Partition_file_list}  Partition_status=${partition_status} | 
| Sushil Singh | 255ec63 | 2021-08-26 08:08:21 -0500 | [diff] [blame] | 502 |  | 
| Sridevi Ramesh | 162c52a | 2025-05-13 23:47:09 -0500 | [diff] [blame] | 503 |     IF  ${partition_status} == 0 | 
 | 504 |         Delete BMC Partition File | 
 | 505 |         ...  ${Partition_file_list}  ${HTTP_NOT_FOUND}  ${RESOURCE_NOT_FOUND_MESSAGE} | 
 | 506 |         Delete All BMC Partition File  ${HTTP_OK} | 
 | 507 |         Delete Local Server Partition File | 
 | 508 |     END | 
| Sushil Singh | 1544c5e | 2021-11-03 07:56:37 -0500 | [diff] [blame] | 509 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 510 |     Delete Local Partition File  ${Partition_file_list} | 
| Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 511 |  | 
 | 512 |  | 
| Sushil Singh | df6ba52 | 2020-11-24 04:17:00 -0600 | [diff] [blame] | 513 | Redfish Upload Partition File In Loop | 
 | 514 |     [Documentation]  Upload the same partition file multiple times in loop to BMC. | 
 | 515 |     [Arguments]  ${file_name} | 
 | 516 |  | 
 | 517 |     # Description of argument(s): | 
 | 518 |     # file_name    Partition file name. | 
 | 519 |  | 
 | 520 |     @{Partition_file_list} =  Split String  ${file_name}  , | 
 | 521 |     Create Partition File  ${Partition_file_list} | 
 | 522 |  | 
 | 523 |     Upload Partition File To BMC  ${Partition_file_list}  ${HTTP_OK}  ${FILE_UPLOAD_MESSAGE} | 
 | 524 |     Verify Partition File On BMC  ${Partition_file_list}  Partition_status=1 | 
 | 525 |  | 
 | 526 |     FOR  ${count}  IN RANGE  1  11 | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 527 |       Upload Partition File To BMC  ${Partition_file_list}  ${HTTP_OK}  ${FILE_UPDATED_MESSAGE} | 
| Sushil Singh | df6ba52 | 2020-11-24 04:17:00 -0600 | [diff] [blame] | 528 |       Verify Partition File On BMC  ${Partition_file_list}  Partition_status=1 | 
 | 529 |     END | 
 | 530 |  | 
 | 531 |     Initialize OpenBMC | 
 | 532 |     Delete BMC Partition File  ${Partition_file_list}  ${HTTP_OK}  ${FILE_DELETED_MESSAGE} | 
 | 533 |     Delete Local Partition File  ${Partition_file_list} | 
 | 534 |  | 
 | 535 |  | 
| Sushil Singh | f39629c | 2020-12-11 07:30:21 -0600 | [diff] [blame] | 536 | Redfish Upload And Delete Partition File In Loop | 
 | 537 |     [Documentation]  Upload the same partition file multiple times in loop to BMC. | 
 | 538 |     [Arguments]  ${file_name} | 
 | 539 |  | 
 | 540 |     # Description of argument(s): | 
 | 541 |     # file_name    Partition file name. | 
 | 542 |  | 
 | 543 |     FOR  ${count}  IN RANGE  1  11 | 
 | 544 |       Redfish Upload Partition File  ${file_name} | 
 | 545 |     END | 
 | 546 |  | 
 | 547 |  | 
| Sushil Singh | 5d0782f | 2020-11-23 06:35:35 -0600 | [diff] [blame] | 548 | Verify Partition File Upload Post BMC Reboot | 
 | 549 |     [Documentation]  Upload the partition file, after BMC reboot. | 
 | 550 |     [Arguments]  ${file_name} | 
 | 551 |  | 
 | 552 |     # Description of argument(s): | 
 | 553 |     # file_name    Partition file name. | 
 | 554 |  | 
| Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 555 |     ${before_reboot_xauth_token}=  Set Variable  ${XAUTH_TOKEN} | 
 | 556 |     Redfish BMC Reset Operation | 
 | 557 |     Set Global Variable  ${XAUTH_TOKEN}  ${before_reboot_xauth_token} | 
 | 558 |  | 
| Sushil Singh | 177b459 | 2022-09-20 08:25:25 -0500 | [diff] [blame] | 559 |     Wait Until Keyword Succeeds  3 min  10 sec  Redfish BMC Match States  match_state=Enabled | 
| Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 560 |     Is BMC Standby | 
| Sushil Singh | 5d0782f | 2020-11-23 06:35:35 -0600 | [diff] [blame] | 561 |  | 
 | 562 |     Redfish Upload Partition File  ${file_name} | 
 | 563 |  | 
 | 564 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 565 | Redfish Partition File Persistency | 
 | 566 |     [Documentation]  Upload the partition file and check for persistency after reboot. | 
 | 567 |     [Arguments]  ${file_name} | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 568 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 569 |     # Description of argument(s): | 
 | 570 |     # file_name    Partition file name. | 
 | 571 |  | 
 | 572 |     @{Partition_file_list} =  Split String  ${file_name}  , | 
 | 573 |     ${num_records}=  Get Length  ${Partition_file_list} | 
 | 574 |     Create Partition File  ${Partition_file_list} | 
 | 575 |     Upload Partition File To BMC  ${Partition_file_list}  ${HTTP_OK}  ${FILE_UPLOAD_MESSAGE} | 
 | 576 |     Verify Partition File On BMC  ${Partition_file_list}  Partition_status=1 | 
| Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 577 |  | 
 | 578 |     ${before_reboot_xauth_token}=  Set Variable  ${XAUTH_TOKEN} | 
 | 579 |     Redfish BMC Reset Operation | 
 | 580 |     Set Global Variable  ${XAUTH_TOKEN}  ${before_reboot_xauth_token} | 
 | 581 |  | 
| Sushil Singh | 177b459 | 2022-09-20 08:25:25 -0500 | [diff] [blame] | 582 |     Wait Until Keyword Succeeds  3 min  10 sec  Redfish BMC Match States  match_state=Enabled | 
| Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 583 |     Is BMC Standby | 
 | 584 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 585 |     Verify Partition File On BMC  ${Partition_file_list}  Partition_status=1 | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 586 |     Initialize OpenBMC | 
| Sridevi Ramesh | 162c52a | 2025-05-13 23:47:09 -0500 | [diff] [blame] | 587 |     IF  ${num_records} == ${1} | 
 | 588 |         Delete BMC Partition File  ${Partition_file_list}  ${HTTP_OK}  ${FILE_DELETED_MESSAGE} | 
 | 589 |     ELSE | 
 | 590 |         Delete All BMC Partition File  ${HTTP_OK} | 
 | 591 |     END | 
 | 592 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 593 |     Delete Local Partition File  ${Partition_file_list} | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 594 |  | 
 | 595 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 596 | Verify Redfish Partition File Content | 
 | 597 |     [Documentation]  Verify partition file content. | 
 | 598 |     [Arguments]  ${file_name}  ${content_dict}  ${status_code} | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 599 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 600 |     # Description of argument(s): | 
 | 601 |     # file_name       Partition file name. | 
 | 602 |     # content_dict    Dict contain the content. | 
 | 603 |     # status_code     HTTPS status code. | 
 | 604 |  | 
 | 605 |     FOR  ${conf_file}  IN  @{file_name} | 
| George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 606 |       ${resp}=  GET On Session  openbmc  /ibm/v1/Host/ConfigFiles/${conf_file} | 
 | 607 |       ...  expected_status=any | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 608 |       Should Be Equal As Strings  ${resp.status_code}  ${status_code} | 
 | 609 |  | 
 | 610 |       ${Partition_file_data}=  Remove String  ${resp.text}  \\n | 
 | 611 |       ${Partition_file_data}=  Evaluate  json.loads('''${Partition_file_data}''')  json | 
 | 612 |       Should Be Equal As Strings  ${Partition_file_data["Data"]}  ${content_dict['${conf_file}']} | 
 | 613 |     END | 
| Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 614 |  | 
| Vijay | 3937315 | 2020-02-14 08:08:20 -0600 | [diff] [blame] | 615 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 616 | Add Content To Files | 
 | 617 |     [Documentation]  Add defined content in partition file. | 
 | 618 |     [Arguments]  ${file_name}  ${index}=${0} | 
| Vijay | 3937315 | 2020-02-14 08:08:20 -0600 | [diff] [blame] | 619 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 620 |     # Description of argument(s): | 
 | 621 |     # file_name    Partition file name. | 
 | 622 |     # index        Index | 
 | 623 |  | 
 | 624 |     ${num_records}=  Get Length  ${file_name} | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 625 |     &{content_dict}=  Create Dictionary | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 626 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 627 |     FOR  ${conf_file}  IN  @{file_name} | 
 | 628 |        ${index}=  Get Index From List  ${file_name}  ${conf_file} | 
 | 629 |        ${index}=  Evaluate  ${index} + 1 | 
 | 630 |  | 
 | 631 |        Run  echo "${content-${index}}" > ${conf_file} | 
 | 632 |        OperatingSystem.File Should Exist  ${conf_file} | 
 | 633 |  | 
 | 634 |        Set To Dictionary  ${content_dict}  ${conf_file}  ${content-${index}} | 
 | 635 |     END | 
 | 636 |  | 
| George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 637 |     RETURN  &{content_dict} | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 638 |  | 
 | 639 |  | 
 | 640 | Redfish Read Partition File | 
 | 641 |     [Documentation]  Read partition file content. | 
 | 642 |     [Arguments]  ${file_name}  ${reboot_flag}=False | 
 | 643 |  | 
 | 644 |     # Description of argument(s): | 
 | 645 |     # file_name      Partition file name. | 
 | 646 |     # reboot_flag    Reboot flag. | 
 | 647 |  | 
 | 648 |     @{Partition_file_list} =  Split String  ${file_name}  , | 
 | 649 |     ${content_dict}=  Add Content To Files  ${Partition_file_list} | 
 | 650 |  | 
 | 651 |     ${num_records}=  Get Length  ${Partition_file_list} | 
 | 652 |  | 
 | 653 |     Upload Partition File To BMC  ${Partition_file_list}  ${HTTP_OK}  ${FILE_UPLOAD_MESSAGE} | 
 | 654 |     Verify Partition File On BMC  ${Partition_file_list}  Partition_status=1 | 
 | 655 |     Verify Redfish Partition File Content  ${Partition_file_list}  ${content_dict}  ${HTTP_OK} | 
 | 656 |  | 
| Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 657 |     ${before_reboot_xauth_token}=  Set Variable  ${XAUTH_TOKEN} | 
 | 658 |  | 
| Sridevi Ramesh | 162c52a | 2025-05-13 23:47:09 -0500 | [diff] [blame] | 659 |     IF  ${True} == ${reboot_flag} | 
 | 660 |         Redfish BMC Reset Operation | 
 | 661 |         Set Global Variable  ${XAUTH_TOKEN}  ${before_reboot_xauth_token} | 
 | 662 |         Wait Until Keyword Succeeds  3 min  10 sec  Redfish BMC Match States  match_state=Enabled | 
 | 663 |         Is BMC Standby | 
 | 664 |         Initialize OpenBMC | 
 | 665 |         Verify Redfish Partition File Content  ${Partition_file_list}  ${content_dict}  ${HTTP_OK} | 
 | 666 |     END | 
| Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 667 |  | 
| Sridevi Ramesh | 162c52a | 2025-05-13 23:47:09 -0500 | [diff] [blame] | 668 |     IF  ${num_records} == ${1} | 
 | 669 |         Delete BMC Partition File  ${Partition_file_list}  ${HTTP_OK}  ${FILE_DELETED_MESSAGE} | 
 | 670 |     ELSE | 
 | 671 |         Delete All BMC Partition File  ${HTTP_OK} | 
 | 672 |     END | 
| Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 673 |  | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 674 |     Delete Local Partition File  ${Partition_file_list} | 
 | 675 |  | 
 | 676 |  | 
 | 677 | Redfish Update Partition File With Same Content | 
 | 678 |     [Documentation]  Update partition file with same content. | 
 | 679 |     [Arguments]  ${file_name}  ${reboot_flag}=False | 
 | 680 |  | 
 | 681 |     # Description of argument(s): | 
 | 682 |     # file_name      Partition file name. | 
 | 683 |     # reboot_flag    Reboot flag. | 
 | 684 |  | 
 | 685 |     @{Partition_file_list} =  Split String  ${file_name}  , | 
 | 686 |     ${content_dict}=  Add Content To Files  ${Partition_file_list}  ${0} | 
 | 687 |  | 
 | 688 |     Upload Partition File To BMC  ${Partition_file_list}  ${HTTP_OK}  ${FILE_UPLOAD_MESSAGE} | 
 | 689 |     Verify Partition File On BMC  ${Partition_file_list}  Partition_status=1 | 
 | 690 |     Verify Redfish Partition File Content  ${Partition_file_list}  ${content_dict}  ${HTTP_OK} | 
 | 691 |  | 
| Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 692 |     ${before_reboot_xauth_token}=  Set Variable  ${XAUTH_TOKEN} | 
 | 693 |  | 
| Sridevi Ramesh | 162c52a | 2025-05-13 23:47:09 -0500 | [diff] [blame] | 694 |     IF  ${True} == ${reboot_flag} | 
 | 695 |         Redfish BMC Reset Operation | 
 | 696 |         Set Global Variable  ${XAUTH_TOKEN}  ${before_reboot_xauth_token} | 
 | 697 |         Wait Until Keyword Succeeds  3 min  10 sec  Redfish BMC Match States  match_state=Enabled | 
 | 698 |         Is BMC Standby | 
 | 699 |         Initialize OpenBMC | 
 | 700 |     END | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 701 |  | 
 | 702 |     ${content_dict}=  Add Content To Files  ${Partition_file_list}  ${0} | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 703 |     Upload Partition File To BMC  ${Partition_file_list}  ${HTTP_OK}  ${FILE_UPDATED_MESSAGE} | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 704 |     Verify Partition File On BMC  ${Partition_file_list}  Partition_status=1 | 
 | 705 |     Verify Redfish Partition File Content  ${Partition_file_list}  ${content_dict}  ${HTTP_OK} | 
 | 706 |  | 
 | 707 |     Delete BMC Partition File  ${Partition_file_list}  ${HTTP_OK}  ${FILE_DELETED_MESSAGE} | 
 | 708 |     Delete Local Partition File  ${Partition_file_list} | 
 | 709 |  | 
 | 710 |  | 
 | 711 | Redfish Update Partition File With Different Content | 
 | 712 |     [Documentation]  Update partition file with different content. | 
 | 713 |     [Arguments]  ${file_name}  ${reboot_flag}=False | 
 | 714 |  | 
 | 715 |     # Description of argument(s): | 
 | 716 |     # file_name      Partition file name. | 
 | 717 |     # reboot_flag    Reboot flag. | 
 | 718 |  | 
 | 719 |     @{Partition_file_list} =  Split String  ${file_name}  , | 
 | 720 |     ${content_dict}=  Add Content To Files  ${Partition_file_list}  ${0} | 
 | 721 |  | 
 | 722 |     Upload Partition File To BMC  ${Partition_file_list}  ${HTTP_OK}  ${FILE_UPLOAD_MESSAGE} | 
 | 723 |     Verify Partition File On BMC  ${Partition_file_list}  Partition_status=1 | 
 | 724 |     Verify Redfish Partition File Content  ${Partition_file_list}  ${content_dict}  ${HTTP_OK} | 
 | 725 |  | 
| Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 726 |     ${before_reboot_xauth_token}=  Set Variable  ${XAUTH_TOKEN} | 
 | 727 |  | 
| Sridevi Ramesh | 162c52a | 2025-05-13 23:47:09 -0500 | [diff] [blame] | 728 |     IF  ${True} == ${reboot_flag} | 
 | 729 |         Redfish BMC Reset Operation | 
 | 730 |         Set Global Variable  ${XAUTH_TOKEN}  ${before_reboot_xauth_token} | 
 | 731 |         Wait Until Keyword Succeeds  3 min  10 sec  Redfish BMC Match States  match_state=Enabled | 
 | 732 |         Is BMC Standby | 
 | 733 |         Initialize OpenBMC | 
 | 734 |     END | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 735 |  | 
 | 736 |     ${content_dict}=  Add Content To Files  ${Partition_file_list}  ${1} | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 737 |     Upload Partition File To BMC  ${Partition_file_list}  ${HTTP_OK}  ${FILE_UPDATED_MESSAGE} | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 738 |     Verify Partition File On BMC  ${Partition_file_list}  Partition_status=1 | 
 | 739 |     Verify Redfish Partition File Content  ${Partition_file_list}  ${content_dict}  ${HTTP_OK} | 
 | 740 |  | 
 | 741 |     Delete BMC Partition File  ${Partition_file_list}  ${HTTP_OK}  ${FILE_DELETED_MESSAGE} | 
 | 742 |     Delete Local Partition File  ${Partition_file_list} | 
 | 743 |  | 
 | 744 |  | 
 | 745 | Create File Names | 
 | 746 |     [Documentation]  Create partition file names. | 
 | 747 |     [Arguments]  ${range} | 
 | 748 |  | 
 | 749 |     # Description of argument(s): | 
 | 750 |     # range    Range in numbers. | 
 | 751 |  | 
 | 752 |     @{file_name_list}=  Create List | 
 | 753 |     Set Test Variable  ${file_name}  rangefile | 
 | 754 |     FOR  ${count}  IN RANGE  ${range} | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 755 |       Append To List  ${file_name_list}  1KB-file${count} | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 756 |     END | 
| George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 757 |     RETURN  ${file_name_list} | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 758 |  | 
 | 759 |  | 
 | 760 | Redfish Upload Partition File With Range | 
 | 761 |     [Documentation]  Upload the partition file with the range of files. | 
 | 762 |     [Arguments]  ${range} | 
 | 763 |  | 
 | 764 |     # Description of argument(s): | 
 | 765 |     # range    Range in numbers. | 
 | 766 |  | 
 | 767 |     ${Partition_file_list}=  Create File Names  ${range} | 
| Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 768 |     Delete Local Partition File  ${Partition_file_list} | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 769 |     Create Partition File  ${Partition_file_list} | 
 | 770 |     Upload Partition File To BMC  ${Partition_file_list}  ${HTTP_OK}  ${FILE_UPLOAD_MESSAGE} | 
 | 771 |     Verify Partition File On BMC  ${Partition_file_list}  Partition_status=1 | 
 | 772 |     Delete All BMC Partition File  ${HTTP_OK} | 
 | 773 |     Delete Local Partition File  ${Partition_file_list} | 
 | 774 |  | 
 | 775 |  | 
 | 776 | Redfish Delete Non Existence Partition File | 
 | 777 |     [Documentation]  Delete the partition file if do not exists. | 
 | 778 |     [Arguments]  ${file_name} | 
 | 779 |  | 
 | 780 |     # Description of argument(s): | 
 | 781 |     # file_name    Partition file name. | 
 | 782 |  | 
 | 783 |     @{Partition_file_list} =  Split String  ${file_name}  , | 
| Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 784 |     Delete BMC Partition File  ${Partition_file_list}  ${HTTP_NOT_FOUND}  ${RESOURCE_NOT_FOUND_MESSAGE} | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 785 |  | 
 | 786 |  | 
 | 787 | Non Admin User To Upload Partition File | 
| George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 788 |     [Documentation]  Non admin user to upload the partition file. | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 789 |     [Arguments]  ${file_name}  ${username}  ${password}  ${role}  ${enabled}=${True} | 
 | 790 |  | 
 | 791 |     # Description of argument(s): | 
 | 792 |     # file_name    Partition file name. | 
 | 793 |     # username     Username. | 
 | 794 |     # password     Password. | 
 | 795 |     # role         Role of user. | 
 | 796 |     # enabled      Value can be True or False. | 
 | 797 |  | 
 | 798 |     Redfish Create User  ${username}  ${password}  ${role}  ${enabled} | 
| Vijay | 3937315 | 2020-02-14 08:08:20 -0600 | [diff] [blame] | 799 |     Delete All Sessions | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 800 |     Initialize OpenBMC  rest_username=${username}  rest_password=${password} | 
 | 801 |     @{Partition_file_list} =  Split String  ${file_name}  , | 
 | 802 |     Create Partition File  ${Partition_file_list} | 
 | 803 |     Upload Partition File To BMC  ${Partition_file_list}  ${HTTP_FORBIDDEN}  ${FORBIDDEN_MESSAGE}  ${False} | 
 | 804 |     Delete Local Partition File  ${Partition_file_list} | 
 | 805 |     Redfish.Delete  /redfish/v1/AccountService/Accounts/${username} | 
 | 806 |  | 
 | 807 |  | 
 | 808 | Non Admin Delete Non Existence Partition File | 
| George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 809 |     [Documentation]  Non admin user to upload the partition file. | 
| Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 810 |     [Arguments]  ${file_name}  ${username}  ${password}  ${role}  ${enabled}=${True} | 
 | 811 |  | 
 | 812 |     # Description of argument(s): | 
 | 813 |     # file_name    Partition file name. | 
 | 814 |     # username     Username. | 
 | 815 |     # password     Password. | 
 | 816 |     # role         Role of user. | 
 | 817 |     # enabled      Value can be True or False. | 
 | 818 |  | 
 | 819 |     Redfish Create User  ${username}  ${password}  ${role}  ${enabled} | 
 | 820 |     Delete All Sessions | 
 | 821 |     Initialize OpenBMC  rest_username=${username}  rest_password=${password} | 
 | 822 |     @{Partition_file_list} =  Split String  ${file_name}  , | 
 | 823 |     Delete BMC Partition File  ${Partition_file_list}  ${HTTP_FORBIDDEN}  ${FORBIDDEN_MESSAGE} | 
 | 824 |  | 
 | 825 |  | 
 | 826 | Verify Update Wrong Partition File To BMC | 
 | 827 |     [Documentation]  Upload the wrong partition file to BMC. | 
 | 828 |     [Arguments]  ${file_name} | 
 | 829 |  | 
 | 830 |     # Description of argument(s): | 
 | 831 |     # file_name    Partition file name. | 
 | 832 |  | 
 | 833 |     Redfish.Login | 
 | 834 |     ${resp}=  Run Keyword And Return Status | 
 | 835 |     ...  Redfish.Put  /ibm/v1/Host/ConfigFiles/../../../../../etc/resolv.conf  body={"data": "test string"} | 
 | 836 |     Should Be Equal As Strings  ${resp}  False | 
| Sushil Singh | 9942df5 | 2021-09-03 02:28:11 -0500 | [diff] [blame] | 837 |  | 
 | 838 |  | 
 | 839 | Check Redfish Upload Partition File Name With Character Limit To BMC | 
 | 840 |     [Documentation]  Upload the partition file to BMC with file name character limit. | 
 | 841 |     [Arguments]  ${file_name}  ${status_code}  ${message} | 
 | 842 |  | 
 | 843 |     # Description of argument(s): | 
 | 844 |     # file_name       Partition file name. | 
 | 845 |     # status_code     HTTPS status code. | 
 | 846 |     # message         Expected message of from upload partition file URI. | 
 | 847 |  | 
 | 848 |     @{Partition_file_list} =  Split String  ${file_name}  , | 
 | 849 |     ${num_records}=  Get Length  ${Partition_file_list} | 
 | 850 |     Create Partition File  ${Partition_file_list} | 
 | 851 |  | 
 | 852 |     ${file_name_length}=  Get Length  ${Partition_file_list}[0] | 
 | 853 |  | 
| Sridevi Ramesh | 162c52a | 2025-05-13 23:47:09 -0500 | [diff] [blame] | 854 |     IF  ${file_name_length} == 20 | 
 | 855 |         Upload Partition File To BMC  ${Partition_file_list}  ${status_code}  ${message} | 
 | 856 |         Verify Partition File On BMC  ${Partition_file_list}  Partition_status=1 | 
 | 857 |         Delete BMC Partition File  ${Partition_file_list}  ${HTTP_OK}  ${FILE_DELETED_MESSAGE} | 
 | 858 |     ELSE | 
 | 859 |         Upload Partition File To BMC  ${Partition_file_list}  ${status_code}  ${message} | 
 | 860 |     END | 
| Sushil Singh | 9942df5 | 2021-09-03 02:28:11 -0500 | [diff] [blame] | 861 |  | 
 | 862 |     Delete Local Partition File  ${Partition_file_list} | 
| Sushil Singh | 2dbcbde | 2021-09-09 08:50:48 -0500 | [diff] [blame] | 863 |  | 
 | 864 |  | 
 | 865 | Check Redfish Fail To Upload Partition File Name With Special Character To BMC | 
 | 866 |     [Documentation]  Upload the partition file to BMC with special character file name. | 
 | 867 |     [Arguments]  ${file_name}  ${status_code}  ${message} | 
 | 868 |  | 
 | 869 |     # Description of argument(s): | 
 | 870 |     # file_name       Partition file name. | 
 | 871 |     # status_code     HTTPS status code. | 
 | 872 |     # message         Expected message from upload partition file URI. | 
 | 873 |  | 
 | 874 |     @{Partition_file_list} =  Split String  ${file_name}  , | 
 | 875 |     ${num_records}=  Get Length  ${Partition_file_list} | 
 | 876 |  | 
 | 877 |     Create Partition File  ${Partition_file_list} | 
 | 878 |  | 
 | 879 |     Upload Partition File To BMC  ${Partition_file_list}  ${status_code}  ${message} | 
 | 880 |  | 
 | 881 |     ${status}=  Run Keyword And Return Status | 
 | 882 |     ...  Verify Partition File On BMC  ${Partition_file_list}  Partition_status=1 | 
 | 883 |     Should Be Equal As Strings  ${status}  False | 
 | 884 |  | 
 | 885 |     Delete Local Partition File  ${Partition_file_list} | 
| Sushil Singh | 44b8cf3 | 2021-11-17 06:57:09 -0600 | [diff] [blame] | 886 |  | 
 | 887 |  | 
 | 888 | Redfish Upload Partition File From Path | 
 | 889 |     [Documentation]  Upload the partition file to BMC from file path. | 
 | 890 |     [Arguments]  ${PARTITION_FILE_PATH} | 
 | 891 |  | 
 | 892 |     # Description of argument(s): | 
 | 893 |     # PARTITION_FILE_PATH    Partition file path. | 
 | 894 |  | 
 | 895 |     ${file_list} =  OperatingSystem.List Files In Directory  ${PARTITION_FILE_PATH} | 
 | 896 |  | 
 | 897 |     ${num_records}=  Get Length  ${file_list} | 
 | 898 |     Should Not Be Equal As Integers  ${num_records}  0 | 
 | 899 |  | 
 | 900 |     FOR  ${file_name}  IN  @{file_list} | 
 | 901 |       @{Partition_file_list} =  Split String  ${file_name}  , | 
 | 902 |       ${num_records}=  Get Length  ${Partition_file_list} | 
| George Keishing | 538f174 | 2022-03-14 05:00:55 -0500 | [diff] [blame] | 903 |       Upload Partition File To BMC  file_name=${Partition_file_list} | 
 | 904 |       ...  status_code=${HTTP_OK}  expected_message=${FILE_UPLOAD_MESSAGE}  path=${PARTITION_FILE_PATH} | 
| Sushil Singh | 44b8cf3 | 2021-11-17 06:57:09 -0600 | [diff] [blame] | 905 |       Verify Partition File On BMC  ${Partition_file_list}  Partition_status=1 | 
 | 906 |       Delete BMC Partition File  ${Partition_file_list}  ${HTTP_OK}  ${FILE_DELETED_MESSAGE} | 
 | 907 |     END | 
 | 908 |  |