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