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 | |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 238 | *** Keywords *** |
| 239 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 240 | Suite Setup Execution |
| 241 | [Documentation] Suite setup execution. |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 242 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 243 | Redfish.Login |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 244 | |
| 245 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 246 | Test Teardown Execution |
| 247 | [Documentation] Test teardown execution. |
Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 248 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 249 | Delete All BMC Partition File ${HTTP_OK} |
| 250 | FFDC On Test Case Fail |
| 251 | |
| 252 | |
| 253 | Suite Teardown Execution |
| 254 | [Documentation] Suite teardown execution. |
Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 255 | |
| 256 | Delete All Sessions |
Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 257 | |
| 258 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 259 | Delete Local Partition File |
| 260 | [Documentation] Delete local partition file. |
| 261 | [Arguments] ${file_name} |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 262 | |
| 263 | # Description of argument(s): |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 264 | # file_name Partition file name. |
Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 265 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 266 | FOR ${conf_file} IN @{file_name} |
| 267 | ${file_exist}= Run Keyword And Return Status OperatingSystem.File Should Exist ${conf_file} |
| 268 | Run Keyword If 'True' == '${file_exist}' Remove File ${conf_file} |
| 269 | END |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 270 | |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 271 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 272 | Create Partition File |
| 273 | [Documentation] Create Partition file. |
| 274 | [Arguments] ${file_name} |
| 275 | |
| 276 | # Description of argument(s): |
| 277 | # file_name Partition file name. |
| 278 | |
| 279 | Delete Local Partition File ${file_name} |
| 280 | |
| 281 | FOR ${conf_file} IN @{file_name} |
Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 282 | @{words}= Split String ${conf_file} - |
Sushil Singh | 255ec63 | 2021-08-26 08:08:21 -0500 | [diff] [blame] | 283 | 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] | 284 | OperatingSystem.File Should Exist ${conf_file} |
| 285 | END |
| 286 | |
| 287 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 288 | Delete BMC Partition File |
Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 289 | [Documentation] Delete single partition file on BMC via Redfish. |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 290 | [Arguments] ${file_name} ${status_code} ${expected_message} |
| 291 | |
| 292 | # Description of argument(s): |
| 293 | # file_name Partition file name. |
| 294 | # status_code HTTPS status code. |
| 295 | # expected_message Expected message of URI. |
| 296 | |
| 297 | FOR ${conf_file} IN @{file_name} |
| 298 | ${data}= Create Dictionary |
| 299 | ${headers}= Create Dictionary X-Auth-Token=${XAUTH_TOKEN} |
| 300 | Set To Dictionary ${data} headers ${headers} |
| 301 | |
| 302 | ${resp}= Delete Request openbmc /ibm/v1/Host/ConfigFiles/${conf_file} &{data} |
| 303 | Should Be Equal As Strings ${resp.status_code} ${status_code} |
| 304 | |
Sushil Singh | 7aa3cc4 | 2021-08-19 07:42:29 -0500 | [diff] [blame] | 305 | ${description}= Return Description Of Response ${resp.text} |
| 306 | Should Be Equal As Strings ${description} ${expected_message} |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 307 | END |
| 308 | |
| 309 | |
| 310 | Delete All BMC Partition File |
Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 311 | [Documentation] Delete multiple partition file on BMC via Redfish. |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 312 | [Arguments] ${status_code} |
| 313 | |
| 314 | # Description of argument(s): |
| 315 | # status_code HTTPS status code. |
| 316 | |
| 317 | Initialize OpenBMC |
| 318 | ${data}= Create Dictionary |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 319 | ${headers}= Create Dictionary X-Auth-Token=${XAUTH_TOKEN} |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 320 | Set To Dictionary ${data} headers ${headers} |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 321 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 322 | ${resp}= Post Request openbmc /ibm/v1/Host/ConfigFiles/Actions/IBMConfigFiles.DeleteAll &{data} |
| 323 | Should Be Equal As Strings ${resp.status_code} ${status_code} |
Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 324 | |
| 325 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 326 | Return Description Of Response |
Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 327 | [Documentation] Return description of REST response. |
| 328 | [Arguments] ${resp_text} |
| 329 | |
| 330 | # Description of argument(s): |
| 331 | # resp_text REST response body. |
| 332 | |
| 333 | # resp_text after successful partition file upload looks like: |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 334 | # { |
| 335 | # "Description": "File Created" |
| 336 | # } |
Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 337 | |
Sushil Singh | 7aa3cc4 | 2021-08-19 07:42:29 -0500 | [diff] [blame] | 338 | ${status}= Run Keyword And Return Status Evaluate isinstance(${resp_text}, dict) |
| 339 | Return From Keyword If '${status}' == 'False' ${resp_text} |
Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 340 | ${message}= Evaluate json.loads('''${resp_text}''') json |
| 341 | |
| 342 | [Return] ${message["Description"]} |
| 343 | |
| 344 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 345 | Upload Partition File To BMC |
| 346 | [Documentation] Upload partition file to BMC. |
| 347 | [Arguments] ${file_name} ${status_code} ${expected_message} ${flag}=${True} |
Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 348 | |
| 349 | # Description of argument(s): |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 350 | # file_name Partition file name. |
| 351 | # status_code HTTPS status code. |
| 352 | # expected_message Expected message of URI. |
| 353 | # flag If True run part of program, else skip. |
Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 354 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 355 | Run Keyword If '${flag}' == '${True}' Initialize OpenBMC |
| 356 | FOR ${conf_file} IN @{file_name} |
| 357 | # Get the content of the file and upload to BMC. |
| 358 | ${image_data}= OperatingSystem.Get Binary File ${conf_file} |
Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 359 | ${headers}= Create Dictionary X-Auth-Token=${XAUTH_TOKEN} Content-Type=application/octet-stream |
Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 360 | |
Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 361 | ${kwargs}= Create Dictionary data=${image_data} |
| 362 | Set To Dictionary ${kwargs} headers ${headers} |
| 363 | ${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] | 364 | Should Be Equal As Strings ${resp.status_code} ${status_code} |
| 365 | |
Sushil Singh | 7aa3cc4 | 2021-08-19 07:42:29 -0500 | [diff] [blame] | 366 | ${description}= Return Description Of Response ${resp.text} |
| 367 | Should Be Equal As Strings ${description} ${expected_message} |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 368 | END |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 369 | |
| 370 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 371 | Verify Partition File On BMC |
| 372 | [Documentation] Verify partition file on BMC. |
| 373 | [Arguments] ${file_name} ${Partition_status} |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 374 | |
| 375 | # Description of argument(s): |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 376 | # file_name Partition file name. |
| 377 | # Partition_status Partition file status on BMC. |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 378 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 379 | FOR ${conf_file} IN @{file_name} |
| 380 | ${status} ${stderr} ${rc}= BMC Execute Command |
Sushil Singh | e5f39ee | 2021-01-06 00:39:12 -0600 | [diff] [blame] | 381 | ... 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] | 382 | Valid Value ${status} [${Partition_status}] |
| 383 | END |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 384 | |
| 385 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 386 | Redfish Upload Partition File |
| 387 | [Documentation] Upload the partition file. |
Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 388 | [Arguments] ${file_name} ${file_size}=${EMPTY} |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 389 | |
| 390 | # Description of argument(s): |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 391 | # file_name Partition file name. |
Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 392 | # file_size By Default is set to EMPTY, |
| 393 | # if user pass small_file_size the create file with small |
| 394 | # size keyword gets executed. |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 395 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 396 | @{Partition_file_list} = Split String ${file_name} , |
| 397 | ${num_records}= Get Length ${Partition_file_list} |
Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 398 | |
Sushil Singh | 255ec63 | 2021-08-26 08:08:21 -0500 | [diff] [blame] | 399 | Create Partition File ${Partition_file_list} |
Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 400 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 401 | Upload Partition File To BMC ${Partition_file_list} ${HTTP_OK} ${FILE_UPLOAD_MESSAGE} |
| 402 | Verify Partition File On BMC ${Partition_file_list} Partition_status=1 |
| 403 | Run Keyword If ${num_records} == ${1} |
| 404 | ... Delete BMC Partition File ${Partition_file_list} ${HTTP_OK} ${FILE_DELETED_MESSAGE} |
| 405 | ... ELSE |
| 406 | ... Delete All BMC Partition File ${HTTP_OK} |
| 407 | Delete Local Partition File ${Partition_file_list} |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 408 | |
| 409 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 410 | Redfish Fail To Upload Partition File |
George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 411 | [Documentation] Fail to upload the partition file. |
Sushil Singh | 255ec63 | 2021-08-26 08:08:21 -0500 | [diff] [blame] | 412 | [Arguments] ${file_name} ${response_message}=${EMPTY} |
Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 413 | |
| 414 | # Description of argument(s): |
Sushil Singh | 255ec63 | 2021-08-26 08:08:21 -0500 | [diff] [blame] | 415 | # file_name Partition file name. |
| 416 | # response_message By default is set to EMPTY, |
| 417 | # else user provide the information when user upload the partition with file size |
| 418 | # below lower linit of allowed partition or more than of large allowed partition. |
Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 419 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 420 | @{Partition_file_list} = Split String ${file_name} , |
Sushil Singh | 255ec63 | 2021-08-26 08:08:21 -0500 | [diff] [blame] | 421 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 422 | Create Partition File ${Partition_file_list} |
Sushil Singh | 255ec63 | 2021-08-26 08:08:21 -0500 | [diff] [blame] | 423 | Upload Partition File To BMC ${Partition_file_list} ${HTTP_BAD_REQUEST} ${response_message} |
| 424 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 425 | Verify Partition File On BMC ${Partition_file_list} Partition_status=0 |
Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 426 | 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] | 427 | Delete Local Partition File ${Partition_file_list} |
Vijay | 09839e2 | 2020-02-05 02:54:44 -0600 | [diff] [blame] | 428 | |
| 429 | |
Sushil Singh | df6ba52 | 2020-11-24 04:17:00 -0600 | [diff] [blame] | 430 | Redfish Upload Partition File In Loop |
| 431 | [Documentation] Upload the same partition file multiple times in loop to BMC. |
| 432 | [Arguments] ${file_name} |
| 433 | |
| 434 | # Description of argument(s): |
| 435 | # file_name Partition file name. |
| 436 | |
| 437 | @{Partition_file_list} = Split String ${file_name} , |
| 438 | Create Partition File ${Partition_file_list} |
| 439 | |
| 440 | Upload Partition File To BMC ${Partition_file_list} ${HTTP_OK} ${FILE_UPLOAD_MESSAGE} |
| 441 | Verify Partition File On BMC ${Partition_file_list} Partition_status=1 |
| 442 | |
| 443 | FOR ${count} IN RANGE 1 11 |
Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 444 | 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] | 445 | Verify Partition File On BMC ${Partition_file_list} Partition_status=1 |
| 446 | END |
| 447 | |
| 448 | Initialize OpenBMC |
| 449 | Delete BMC Partition File ${Partition_file_list} ${HTTP_OK} ${FILE_DELETED_MESSAGE} |
| 450 | Delete Local Partition File ${Partition_file_list} |
| 451 | |
| 452 | |
Sushil Singh | f39629c | 2020-12-11 07:30:21 -0600 | [diff] [blame] | 453 | Redfish Upload And Delete 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 | FOR ${count} IN RANGE 1 11 |
| 461 | Redfish Upload Partition File ${file_name} |
| 462 | END |
| 463 | |
| 464 | |
Sushil Singh | 5d0782f | 2020-11-23 06:35:35 -0600 | [diff] [blame] | 465 | Verify Partition File Upload Post BMC Reboot |
| 466 | [Documentation] Upload the partition file, after BMC reboot. |
| 467 | [Arguments] ${file_name} |
| 468 | |
| 469 | # Description of argument(s): |
| 470 | # file_name Partition file name. |
| 471 | |
Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 472 | ${before_reboot_xauth_token}= Set Variable ${XAUTH_TOKEN} |
| 473 | Redfish BMC Reset Operation |
| 474 | Set Global Variable ${XAUTH_TOKEN} ${before_reboot_xauth_token} |
| 475 | |
| 476 | Is BMC Standby |
Sushil Singh | 5d0782f | 2020-11-23 06:35:35 -0600 | [diff] [blame] | 477 | |
| 478 | Redfish Upload Partition File ${file_name} |
| 479 | |
| 480 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 481 | Redfish Partition File Persistency |
| 482 | [Documentation] Upload the partition file and check for persistency after reboot. |
| 483 | [Arguments] ${file_name} |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 484 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 485 | # Description of argument(s): |
| 486 | # file_name Partition file name. |
| 487 | |
| 488 | @{Partition_file_list} = Split String ${file_name} , |
| 489 | ${num_records}= Get Length ${Partition_file_list} |
| 490 | Create Partition File ${Partition_file_list} |
| 491 | Upload Partition File To BMC ${Partition_file_list} ${HTTP_OK} ${FILE_UPLOAD_MESSAGE} |
| 492 | Verify Partition File On BMC ${Partition_file_list} Partition_status=1 |
Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 493 | |
| 494 | ${before_reboot_xauth_token}= Set Variable ${XAUTH_TOKEN} |
| 495 | Redfish BMC Reset Operation |
| 496 | Set Global Variable ${XAUTH_TOKEN} ${before_reboot_xauth_token} |
| 497 | |
| 498 | Is BMC Standby |
| 499 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 500 | Verify Partition File On BMC ${Partition_file_list} Partition_status=1 |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 501 | Initialize OpenBMC |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 502 | Run Keyword If ${num_records} == ${1} |
| 503 | ... Delete BMC Partition File ${Partition_file_list} ${HTTP_OK} ${FILE_DELETED_MESSAGE} |
| 504 | ... ELSE |
| 505 | ... Delete All BMC Partition File ${HTTP_OK} |
| 506 | Delete Local Partition File ${Partition_file_list} |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 507 | |
| 508 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 509 | Verify Redfish Partition File Content |
| 510 | [Documentation] Verify partition file content. |
| 511 | [Arguments] ${file_name} ${content_dict} ${status_code} |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 512 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 513 | # Description of argument(s): |
| 514 | # file_name Partition file name. |
| 515 | # content_dict Dict contain the content. |
| 516 | # status_code HTTPS status code. |
| 517 | |
| 518 | FOR ${conf_file} IN @{file_name} |
| 519 | ${resp}= Get Request openbmc /ibm/v1/Host/ConfigFiles/${conf_file} |
| 520 | Should Be Equal As Strings ${resp.status_code} ${status_code} |
| 521 | |
| 522 | ${Partition_file_data}= Remove String ${resp.text} \\n |
| 523 | ${Partition_file_data}= Evaluate json.loads('''${Partition_file_data}''') json |
| 524 | Should Be Equal As Strings ${Partition_file_data["Data"]} ${content_dict['${conf_file}']} |
| 525 | END |
Vijay | fcdadc5 | 2020-01-21 01:48:19 -0600 | [diff] [blame] | 526 | |
Vijay | 3937315 | 2020-02-14 08:08:20 -0600 | [diff] [blame] | 527 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 528 | Add Content To Files |
| 529 | [Documentation] Add defined content in partition file. |
| 530 | [Arguments] ${file_name} ${index}=${0} |
Vijay | 3937315 | 2020-02-14 08:08:20 -0600 | [diff] [blame] | 531 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 532 | # Description of argument(s): |
| 533 | # file_name Partition file name. |
| 534 | # index Index |
| 535 | |
| 536 | ${num_records}= Get Length ${file_name} |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 537 | &{content_dict}= Create Dictionary |
Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 538 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 539 | FOR ${conf_file} IN @{file_name} |
| 540 | ${index}= Get Index From List ${file_name} ${conf_file} |
| 541 | ${index}= Evaluate ${index} + 1 |
| 542 | |
| 543 | Run echo "${content-${index}}" > ${conf_file} |
| 544 | OperatingSystem.File Should Exist ${conf_file} |
| 545 | |
| 546 | Set To Dictionary ${content_dict} ${conf_file} ${content-${index}} |
| 547 | END |
| 548 | |
| 549 | [Return] &{content_dict} |
| 550 | |
| 551 | |
| 552 | Redfish Read Partition File |
| 553 | [Documentation] Read partition file content. |
| 554 | [Arguments] ${file_name} ${reboot_flag}=False |
| 555 | |
| 556 | # Description of argument(s): |
| 557 | # file_name Partition file name. |
| 558 | # reboot_flag Reboot flag. |
| 559 | |
| 560 | @{Partition_file_list} = Split String ${file_name} , |
| 561 | ${content_dict}= Add Content To Files ${Partition_file_list} |
| 562 | |
| 563 | ${num_records}= Get Length ${Partition_file_list} |
| 564 | |
| 565 | Upload Partition File To BMC ${Partition_file_list} ${HTTP_OK} ${FILE_UPLOAD_MESSAGE} |
| 566 | Verify Partition File On BMC ${Partition_file_list} Partition_status=1 |
| 567 | Verify Redfish Partition File Content ${Partition_file_list} ${content_dict} ${HTTP_OK} |
| 568 | |
Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 569 | ${before_reboot_xauth_token}= Set Variable ${XAUTH_TOKEN} |
| 570 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 571 | Run Keyword If ${True} == ${reboot_flag} |
Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 572 | ... Run Keywords Redfish BMC Reset Operation AND |
| 573 | ... Set Global Variable ${XAUTH_TOKEN} ${before_reboot_xauth_token} AND |
| 574 | ... Is BMC Standby AND |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 575 | ... Initialize OpenBMC AND |
| 576 | ... Verify Redfish Partition File Content ${Partition_file_list} ${content_dict} ${HTTP_OK} |
Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 577 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 578 | Run Keyword If ${num_records} == ${1} |
| 579 | ... Delete BMC Partition File ${Partition_file_list} ${HTTP_OK} ${FILE_DELETED_MESSAGE} |
| 580 | ... ELSE |
| 581 | ... Delete All BMC Partition File ${HTTP_OK} |
Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 582 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 583 | Delete Local Partition File ${Partition_file_list} |
| 584 | |
| 585 | |
| 586 | Redfish Update Partition File With Same Content |
| 587 | [Documentation] Update partition file with same content. |
| 588 | [Arguments] ${file_name} ${reboot_flag}=False |
| 589 | |
| 590 | # Description of argument(s): |
| 591 | # file_name Partition file name. |
| 592 | # reboot_flag Reboot flag. |
| 593 | |
| 594 | @{Partition_file_list} = Split String ${file_name} , |
| 595 | ${content_dict}= Add Content To Files ${Partition_file_list} ${0} |
| 596 | |
| 597 | Upload Partition File To BMC ${Partition_file_list} ${HTTP_OK} ${FILE_UPLOAD_MESSAGE} |
| 598 | Verify Partition File On BMC ${Partition_file_list} Partition_status=1 |
| 599 | Verify Redfish Partition File Content ${Partition_file_list} ${content_dict} ${HTTP_OK} |
| 600 | |
Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 601 | ${before_reboot_xauth_token}= Set Variable ${XAUTH_TOKEN} |
| 602 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 603 | Run Keyword If ${True} == ${reboot_flag} |
Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 604 | ... Run Keywords Redfish BMC Reset Operation AND |
| 605 | ... Set Global Variable ${XAUTH_TOKEN} ${before_reboot_xauth_token} AND |
| 606 | ... Is BMC Standby AND |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 607 | ... Initialize OpenBMC |
| 608 | |
| 609 | ${content_dict}= Add Content To Files ${Partition_file_list} ${0} |
Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 610 | 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] | 611 | Verify Partition File On BMC ${Partition_file_list} Partition_status=1 |
| 612 | Verify Redfish Partition File Content ${Partition_file_list} ${content_dict} ${HTTP_OK} |
| 613 | |
| 614 | Delete BMC Partition File ${Partition_file_list} ${HTTP_OK} ${FILE_DELETED_MESSAGE} |
| 615 | Delete Local Partition File ${Partition_file_list} |
| 616 | |
| 617 | |
| 618 | Redfish Update Partition File With Different Content |
| 619 | [Documentation] Update partition file with different content. |
| 620 | [Arguments] ${file_name} ${reboot_flag}=False |
| 621 | |
| 622 | # Description of argument(s): |
| 623 | # file_name Partition file name. |
| 624 | # reboot_flag Reboot flag. |
| 625 | |
| 626 | @{Partition_file_list} = Split String ${file_name} , |
| 627 | ${content_dict}= Add Content To Files ${Partition_file_list} ${0} |
| 628 | |
| 629 | Upload Partition File To BMC ${Partition_file_list} ${HTTP_OK} ${FILE_UPLOAD_MESSAGE} |
| 630 | Verify Partition File On BMC ${Partition_file_list} Partition_status=1 |
| 631 | Verify Redfish Partition File Content ${Partition_file_list} ${content_dict} ${HTTP_OK} |
| 632 | |
Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 633 | ${before_reboot_xauth_token}= Set Variable ${XAUTH_TOKEN} |
| 634 | |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 635 | Run Keyword If ${True} == ${reboot_flag} |
Sushil Singh | 98ebdfa | 2021-02-10 04:24:06 -0600 | [diff] [blame] | 636 | ... Run Keywords Redfish BMC Reset Operation AND |
| 637 | ... Set Global Variable ${XAUTH_TOKEN} ${before_reboot_xauth_token} AND |
| 638 | ... Is BMC Standby AND |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 639 | ... Initialize OpenBMC |
| 640 | |
| 641 | ${content_dict}= Add Content To Files ${Partition_file_list} ${1} |
Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 642 | 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] | 643 | Verify Partition File On BMC ${Partition_file_list} Partition_status=1 |
| 644 | Verify Redfish Partition File Content ${Partition_file_list} ${content_dict} ${HTTP_OK} |
| 645 | |
| 646 | Delete BMC Partition File ${Partition_file_list} ${HTTP_OK} ${FILE_DELETED_MESSAGE} |
| 647 | Delete Local Partition File ${Partition_file_list} |
| 648 | |
| 649 | |
| 650 | Create File Names |
| 651 | [Documentation] Create partition file names. |
| 652 | [Arguments] ${range} |
| 653 | |
| 654 | # Description of argument(s): |
| 655 | # range Range in numbers. |
| 656 | |
| 657 | @{file_name_list}= Create List |
| 658 | Set Test Variable ${file_name} rangefile |
| 659 | FOR ${count} IN RANGE ${range} |
Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 660 | Append To List ${file_name_list} 1KB-file${count} |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 661 | END |
| 662 | [Return] ${file_name_list} |
| 663 | |
| 664 | |
| 665 | Redfish Upload Partition File With Range |
| 666 | [Documentation] Upload the partition file with the range of files. |
| 667 | [Arguments] ${range} |
| 668 | |
| 669 | # Description of argument(s): |
| 670 | # range Range in numbers. |
| 671 | |
| 672 | ${Partition_file_list}= Create File Names ${range} |
Sushil Singh | 85c381c | 2021-08-17 23:25:10 -0500 | [diff] [blame] | 673 | Delete Local Partition File ${Partition_file_list} |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 674 | Create Partition File ${Partition_file_list} |
| 675 | Upload Partition File To BMC ${Partition_file_list} ${HTTP_OK} ${FILE_UPLOAD_MESSAGE} |
| 676 | Verify Partition File On BMC ${Partition_file_list} Partition_status=1 |
| 677 | Delete All BMC Partition File ${HTTP_OK} |
| 678 | Delete Local Partition File ${Partition_file_list} |
| 679 | |
| 680 | |
| 681 | Redfish Delete Non Existence Partition File |
| 682 | [Documentation] Delete the partition file if do not exists. |
| 683 | [Arguments] ${file_name} |
| 684 | |
| 685 | # Description of argument(s): |
| 686 | # file_name Partition file name. |
| 687 | |
| 688 | @{Partition_file_list} = Split String ${file_name} , |
Sushil Singh | 251a0bc | 2021-08-24 01:12:14 -0500 | [diff] [blame] | 689 | 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] | 690 | |
| 691 | |
| 692 | Non Admin User To Upload Partition File |
George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 693 | [Documentation] Non admin user to upload the partition file. |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 694 | [Arguments] ${file_name} ${username} ${password} ${role} ${enabled}=${True} |
| 695 | |
| 696 | # Description of argument(s): |
| 697 | # file_name Partition file name. |
| 698 | # username Username. |
| 699 | # password Password. |
| 700 | # role Role of user. |
| 701 | # enabled Value can be True or False. |
| 702 | |
| 703 | Redfish Create User ${username} ${password} ${role} ${enabled} |
Vijay | 3937315 | 2020-02-14 08:08:20 -0600 | [diff] [blame] | 704 | Delete All Sessions |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 705 | Initialize OpenBMC rest_username=${username} rest_password=${password} |
| 706 | @{Partition_file_list} = Split String ${file_name} , |
| 707 | Create Partition File ${Partition_file_list} |
| 708 | Upload Partition File To BMC ${Partition_file_list} ${HTTP_FORBIDDEN} ${FORBIDDEN_MESSAGE} ${False} |
| 709 | Delete Local Partition File ${Partition_file_list} |
| 710 | Redfish.Delete /redfish/v1/AccountService/Accounts/${username} |
| 711 | |
| 712 | |
| 713 | Non Admin Delete Non Existence Partition File |
George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 714 | [Documentation] Non admin user to upload the partition file. |
Sushil Singh | cbbce6a | 2020-09-07 00:57:37 -0500 | [diff] [blame] | 715 | [Arguments] ${file_name} ${username} ${password} ${role} ${enabled}=${True} |
| 716 | |
| 717 | # Description of argument(s): |
| 718 | # file_name Partition file name. |
| 719 | # username Username. |
| 720 | # password Password. |
| 721 | # role Role of user. |
| 722 | # enabled Value can be True or False. |
| 723 | |
| 724 | Redfish Create User ${username} ${password} ${role} ${enabled} |
| 725 | Delete All Sessions |
| 726 | Initialize OpenBMC rest_username=${username} rest_password=${password} |
| 727 | @{Partition_file_list} = Split String ${file_name} , |
| 728 | Delete BMC Partition File ${Partition_file_list} ${HTTP_FORBIDDEN} ${FORBIDDEN_MESSAGE} |
| 729 | |
| 730 | |
| 731 | Verify Update Wrong Partition File To BMC |
| 732 | [Documentation] Upload the wrong partition file to BMC. |
| 733 | [Arguments] ${file_name} |
| 734 | |
| 735 | # Description of argument(s): |
| 736 | # file_name Partition file name. |
| 737 | |
| 738 | Redfish.Login |
| 739 | ${resp}= Run Keyword And Return Status |
| 740 | ... Redfish.Put /ibm/v1/Host/ConfigFiles/../../../../../etc/resolv.conf body={"data": "test string"} |
| 741 | Should Be Equal As Strings ${resp} False |