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