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