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