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