Rahul Maheshwari | ad676bf | 2017-06-22 15:06:05 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation Test dump functionality of OpenBMC. |
| 4 | |
George Keishing | fb3f9a5 | 2019-07-18 13:13:58 -0500 | [diff] [blame] | 5 | Resource ../../lib/openbmc_ffdc.robot |
| 6 | Resource ../../lib/rest_client.robot |
| 7 | Resource ../../lib/dump_utils.robot |
| 8 | Resource ../../lib/boot_utils.robot |
| 9 | Resource ../../lib/utils.robot |
George Keishing | bac0c57 | 2019-08-08 23:19:45 -0500 | [diff] [blame] | 10 | Resource ../../lib/state_manager.robot |
George Keishing | fb3f9a5 | 2019-07-18 13:13:58 -0500 | [diff] [blame] | 11 | Library ../../lib/bmc_ssh_utils.py |
Rahul Maheshwari | ad676bf | 2017-06-22 15:06:05 -0500 | [diff] [blame] | 12 | |
Rahul Maheshwari | a89ff9e | 2020-09-25 05:04:33 -0500 | [diff] [blame] | 13 | Suite Setup Suite Setup Execution |
Rahul Maheshwari | ad676bf | 2017-06-22 15:06:05 -0500 | [diff] [blame] | 14 | Test Setup Open Connection And Log In |
George Keishing | 40b7ee0 | 2017-11-13 05:12:41 -0600 | [diff] [blame] | 15 | Test Teardown Test Teardown Execution |
Rahul Maheshwari | ad676bf | 2017-06-22 15:06:05 -0500 | [diff] [blame] | 16 | |
| 17 | *** Test Cases *** |
| 18 | |
Sivas SRR | c095741 | 2017-10-06 13:02:08 -0500 | [diff] [blame] | 19 | Pre Dump BMC Performance Test |
| 20 | [Documentation] Check performance of memory, CPU & file system of BMC. |
| 21 | [Tags] Pre_Dump_BMC_Performance_Test |
| 22 | |
| 23 | Open Connection And Log In |
| 24 | Check BMC Performance |
| 25 | |
George Keishing | 40b7ee0 | 2017-11-13 05:12:41 -0600 | [diff] [blame] | 26 | |
Rahul Maheshwari | 355f270 | 2017-10-17 09:15:23 -0500 | [diff] [blame] | 27 | Verify User Initiated BMC Dump When Powered Off |
| 28 | [Documentation] Create user initiated BMC dump at host off state and |
| 29 | ... verify dump entry for it. |
| 30 | [Tags] Verify_User_Initiated_BMC_Dump_When_Powered_Off |
Rahul Maheshwari | ad676bf | 2017-06-22 15:06:05 -0500 | [diff] [blame] | 31 | |
George Keishing | fb3f9a5 | 2019-07-18 13:13:58 -0500 | [diff] [blame] | 32 | Redfish Power Off stack_mode=skip |
Sivas SRR | 7aabd79 | 2017-10-18 21:28:23 -0500 | [diff] [blame] | 33 | ${dump_id}= Create User Initiated Dump |
Steven Sombar | 336fa97 | 2019-11-07 13:12:58 -0600 | [diff] [blame] | 34 | Check Existence Of BMC Dump File ${dump_id} |
Rahul Maheshwari | ad676bf | 2017-06-22 15:06:05 -0500 | [diff] [blame] | 35 | |
Steven Sombar | a011c02 | 2019-01-16 18:13:52 -0600 | [diff] [blame] | 36 | |
George Keishing | a2dab9f | 2017-09-05 13:54:01 -0500 | [diff] [blame] | 37 | Verify Dump Persistency On Service Restart |
| 38 | [Documentation] Create user dump, restart BMC service and verify dump |
| 39 | ... persistency. |
| 40 | [Tags] Verify_Dump_Persistency_On_Service_Restart |
| 41 | |
George Keishing | fee18cf | 2017-09-20 09:46:00 -0500 | [diff] [blame] | 42 | Delete All BMC Dump |
Sivas SRR | 7aabd79 | 2017-10-18 21:28:23 -0500 | [diff] [blame] | 43 | ${dump_id}= Create User Initiated Dump |
George Keishing | a2dab9f | 2017-09-05 13:54:01 -0500 | [diff] [blame] | 44 | BMC Execute Command |
| 45 | ... systemctl restart xyz.openbmc_project.Dump.Manager.service |
| 46 | Sleep 10s reason=Wait for BMC dump service to restart properly. |
| 47 | |
Steven Sombar | aaaab22 | 2018-12-19 13:16:23 -0600 | [diff] [blame] | 48 | ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}list |
George Keishing | a2dab9f | 2017-09-05 13:54:01 -0500 | [diff] [blame] | 49 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
Steven Sombar | 336fa97 | 2019-11-07 13:12:58 -0600 | [diff] [blame] | 50 | Check Existence Of BMC Dump File ${dump_id} |
Sivas SRR | 7aabd79 | 2017-10-18 21:28:23 -0500 | [diff] [blame] | 51 | |
| 52 | |
| 53 | Verify Dump Persistency On Reset |
| 54 | [Documentation] Create user dump, reset BMC and verify dump persistency. |
| 55 | [Tags] Verify_Dump_Persistency_On_Reset |
| 56 | |
| 57 | Delete All BMC Dump |
| 58 | ${dump_id}= Create User Initiated Dump |
| 59 | OBMC Reboot (off) |
Steven Sombar | aaaab22 | 2018-12-19 13:16:23 -0600 | [diff] [blame] | 60 | ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}list |
Sivas SRR | 7aabd79 | 2017-10-18 21:28:23 -0500 | [diff] [blame] | 61 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
Steven Sombar | 336fa97 | 2019-11-07 13:12:58 -0600 | [diff] [blame] | 62 | Check Existence Of BMC Dump File ${dump_id} |
George Keishing | a2dab9f | 2017-09-05 13:54:01 -0500 | [diff] [blame] | 63 | |
| 64 | |
Rahul Maheshwari | ad676bf | 2017-06-22 15:06:05 -0500 | [diff] [blame] | 65 | Delete User Initiated BMC Dump And Verify |
| 66 | [Documentation] Delete user initiated dump and verify. |
| 67 | [Tags] Delete_User_Initiated_Dump_And_Verify |
| 68 | |
| 69 | ${dump_id}= Create User Initiated Dump |
Steven Sombar | 336fa97 | 2019-11-07 13:12:58 -0600 | [diff] [blame] | 70 | Check Existence Of BMC Dump File ${dump_id} |
Rahul Maheshwari | ad676bf | 2017-06-22 15:06:05 -0500 | [diff] [blame] | 71 | |
| 72 | Delete BMC Dump ${dump_id} |
| 73 | |
| 74 | |
| 75 | Verify User Initiated Dump Size |
George Keishing | 6db5202 | 2017-08-22 00:39:22 -0500 | [diff] [blame] | 76 | [Documentation] Verify user Initiated BMC dump size is under 200k. |
Rahul Maheshwari | ad676bf | 2017-06-22 15:06:05 -0500 | [diff] [blame] | 77 | [Tags] Verify_User_Initiated_Dump_Size |
| 78 | |
| 79 | ${dump_id}= Create User Initiated Dump |
| 80 | |
Steven Sombar | aaaab22 | 2018-12-19 13:16:23 -0600 | [diff] [blame] | 81 | ${dump_size}= Read Attribute ${DUMP_ENTRY_URI}${dump_id} Size |
George Keishing | 6db5202 | 2017-08-22 00:39:22 -0500 | [diff] [blame] | 82 | # Max size for dump is 200k = 200x1024 |
| 83 | Should Be True 0 < ${dump_size} < 204800 |
Steven Sombar | 336fa97 | 2019-11-07 13:12:58 -0600 | [diff] [blame] | 84 | Check Existence Of BMC Dump File ${dump_id} |
Rahul Maheshwari | ad676bf | 2017-06-22 15:06:05 -0500 | [diff] [blame] | 85 | |
| 86 | |
Rahul Maheshwari | ad676bf | 2017-06-22 15:06:05 -0500 | [diff] [blame] | 87 | Create Two User Initiated Dump And Delete One |
| 88 | [Documentation] Create two dumps and delete the first. |
| 89 | [Tags] Create_Two_User_Initiated_Dump_And_Delete_One |
| 90 | |
| 91 | ${dump_id_1}= Create User Initiated Dump |
| 92 | ${dump_id_2}= Create User Initiated Dump |
| 93 | |
| 94 | Delete BMC Dump ${dump_id_1} |
| 95 | |
Steven Sombar | aaaab22 | 2018-12-19 13:16:23 -0600 | [diff] [blame] | 96 | ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}${dump_id_1} |
Rahul Maheshwari | ad676bf | 2017-06-22 15:06:05 -0500 | [diff] [blame] | 97 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 98 | |
Steven Sombar | aaaab22 | 2018-12-19 13:16:23 -0600 | [diff] [blame] | 99 | ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}${dump_id_2} |
Rahul Maheshwari | ad676bf | 2017-06-22 15:06:05 -0500 | [diff] [blame] | 100 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
Steven Sombar | 336fa97 | 2019-11-07 13:12:58 -0600 | [diff] [blame] | 101 | Check Existence Of BMC Dump File ${dump_id_2} |
Rahul Maheshwari | ad676bf | 2017-06-22 15:06:05 -0500 | [diff] [blame] | 102 | |
| 103 | |
Rahul Maheshwari | 0dafbb4 | 2017-08-22 13:17:52 -0500 | [diff] [blame] | 104 | Create And Delete BMC Dump Multiple Times |
| 105 | [Documentation] Create and delete BMC dump multiple times. |
| 106 | [Tags] Create_And_Delete_BMC_Dump_Multiple_Times |
| 107 | |
Sushma M M | d27fc31 | 2020-06-19 08:26:50 -0500 | [diff] [blame] | 108 | FOR ${INDEX} IN 1 5 |
| 109 | ${dump_id}= Create User Initiated Dump |
| 110 | Delete BMC Dump ${dump_id} |
| 111 | END |
Rahul Maheshwari | 0dafbb4 | 2017-08-22 13:17:52 -0500 | [diff] [blame] | 112 | |
| 113 | |
| 114 | Delete All BMC Dumps And Verify |
| 115 | [Documentation] Delete all BMC dumps and verify. |
| 116 | [Tags] Delete_All_BMC_Dumps_And_Verify |
| 117 | |
| 118 | # Create some dump. |
| 119 | Create User Initiated Dump |
| 120 | Create User Initiated Dump |
| 121 | |
George Keishing | fee18cf | 2017-09-20 09:46:00 -0500 | [diff] [blame] | 122 | Delete All BMC Dump |
Steven Sombar | aaaab22 | 2018-12-19 13:16:23 -0600 | [diff] [blame] | 123 | ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}list |
Rahul Maheshwari | 0dafbb4 | 2017-08-22 13:17:52 -0500 | [diff] [blame] | 124 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 125 | |
George Keishing | 40b7ee0 | 2017-11-13 05:12:41 -0600 | [diff] [blame] | 126 | |
| 127 | Verify User Initiated BMC Dump When Host Booted |
| 128 | [Documentation] Create user initiated BMC dump at host booted state and |
| 129 | ... verify dump entry for it. |
| 130 | [Tags] Verify_User_Initiated_BMC_Dump_When_Host_Booted |
| 131 | |
George Keishing | fb3f9a5 | 2019-07-18 13:13:58 -0500 | [diff] [blame] | 132 | Redfish Power On stack_mode=skip |
George Keishing | 40b7ee0 | 2017-11-13 05:12:41 -0600 | [diff] [blame] | 133 | Create User Initiated Dump |
| 134 | |
| 135 | |
Rahul Maheshwari | 1612ac9 | 2017-08-30 14:42:32 -0500 | [diff] [blame] | 136 | Verify Core Dump Size |
| 137 | [Documentation] Verify BMC core dump size is under 200k. |
| 138 | [Tags] Verify_Core_Dump_Size |
| 139 | |
| 140 | Delete All Dumps |
| 141 | Trigger Core Dump |
George Keishing | 40efd76 | 2018-10-22 04:04:00 -0500 | [diff] [blame] | 142 | Wait Until Keyword Succeeds 2 min 10 sec Get Dump Entries |
Rahul Maheshwari | 1612ac9 | 2017-08-30 14:42:32 -0500 | [diff] [blame] | 143 | |
| 144 | ${dump_entries}= Get URL List ${DUMP_ENTRY_URI} |
| 145 | ${dump_size}= Read Attribute ${dump_entries[0]} Size |
| 146 | |
| 147 | # Max size for dump is 200k = 200x1024 |
| 148 | Should Be True 0 < ${dump_size} < 204800 msg=Size of dump is incorrect. |
| 149 | |
| 150 | |
Steven Sombar | a011c02 | 2019-01-16 18:13:52 -0600 | [diff] [blame] | 151 | Dump Out Of Space Test |
| 152 | [Documentation] Verify out of dump space is reported when attempt |
| 153 | ... to create too many dumps. |
| 154 | [Tags] Dump_Out_Of_Space_Test |
George Keishing | da67cdd | 2019-08-26 23:40:57 -0500 | [diff] [blame] | 155 | [Setup] Delete All BMC Dump |
Steven Sombar | a011c02 | 2019-01-16 18:13:52 -0600 | [diff] [blame] | 156 | |
| 157 | # Systems typically hold 8-14 dumps before running out of dump space. |
| 158 | # Attempt to create too_many_dumps. Expect to run out of space |
| 159 | # before this. |
George Keishing | 656eb4a | 2019-09-03 03:48:01 -0500 | [diff] [blame] | 160 | ${too_many_dumps} Set Variable ${20} |
Steven Sombar | a011c02 | 2019-01-16 18:13:52 -0600 | [diff] [blame] | 161 | |
| 162 | # Loop, creating a dump each iteration. Will either get dump_id or |
| 163 | # will get EMPTY when out of dump space. |
Sushma M M | d27fc31 | 2020-06-19 08:26:50 -0500 | [diff] [blame] | 164 | FOR ${n} IN RANGE 0 ${too_many_dumps} |
| 165 | ${dump_id}= Create User Initiated Dump check_out_of_space=${True} |
| 166 | Exit For Loop If '${dump_id}' == '${EMPTY}' |
| 167 | Check Existence Of BMC Dump File ${dump_id} |
| 168 | END |
Steven Sombar | a011c02 | 2019-01-16 18:13:52 -0600 | [diff] [blame] | 169 | |
| 170 | Run Keyword If '${dump_id}' != '${EMPTY}' Fail |
| 171 | ... msg=Did not run out of dump space as expected. |
| 172 | |
Steven Sombar | a011c02 | 2019-01-16 18:13:52 -0600 | [diff] [blame] | 173 | |
Sivas SRR | c095741 | 2017-10-06 13:02:08 -0500 | [diff] [blame] | 174 | Post Dump BMC Performance Test |
| 175 | [Documentation] Check performance of memory, CPU & file system of BMC. |
| 176 | [Tags] Post_Dump_BMC_Performance_Test |
| 177 | |
| 178 | Open Connection And Log In |
| 179 | Check BMC Performance |
| 180 | |
Steven Sombar | a011c02 | 2019-01-16 18:13:52 -0600 | [diff] [blame] | 181 | |
Sivas SRR | c095741 | 2017-10-06 13:02:08 -0500 | [diff] [blame] | 182 | Post Dump Core Dump Check |
| 183 | [Documentation] Check core dump existence on BMC after code update. |
| 184 | [Tags] Post_Dump_Core_Dump_Check |
| 185 | |
| 186 | Check For Core Dumps |
Rahul Maheshwari | 0dafbb4 | 2017-08-22 13:17:52 -0500 | [diff] [blame] | 187 | |
Rahul Maheshwari | 1612ac9 | 2017-08-30 14:42:32 -0500 | [diff] [blame] | 188 | |
Anusha Dathatri | eda0949 | 2019-02-26 08:30:13 -0600 | [diff] [blame] | 189 | Verify Dump After Host Watchdog Error Injection |
| 190 | [Documentation] Inject host watchdog error and verify whether dump is generated. |
| 191 | [Tags] Verify_Dump_After_Host_Watchdog_Error_Injection |
| 192 | |
George Keishing | fb3f9a5 | 2019-07-18 13:13:58 -0500 | [diff] [blame] | 193 | Redfish Power On |
Anusha Dathatri | eda0949 | 2019-02-26 08:30:13 -0600 | [diff] [blame] | 194 | |
| 195 | Run Keyword And Ignore Error Delete All Dumps |
| 196 | |
| 197 | # Enable auto reboot |
| 198 | Set Auto Reboot ${1} |
| 199 | |
| 200 | Trigger Host Watchdog Error 2000 30 |
| 201 | |
| 202 | Wait Until Keyword Succeeds 300 sec 20 sec Is Host Rebooted |
| 203 | |
| 204 | #Get dump details |
| 205 | @{dump_entry_list}= Read Properties ${DUMP_ENTRY_URI} |
| 206 | |
George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 207 | # Verifying that there is only one dump |
Anusha Dathatri | eda0949 | 2019-02-26 08:30:13 -0600 | [diff] [blame] | 208 | ${length}= Get length ${dump_entry_list} |
| 209 | Should Be Equal As Integers ${length} ${1} |
| 210 | |
| 211 | # Get dump id |
| 212 | ${value}= Get From List ${dump_entry_list} 0 |
| 213 | @{split_value}= Split String ${value} / |
| 214 | ${dump_id}= Get From List ${split_value} -1 |
| 215 | |
| 216 | # Max size for dump is 200k = 200x1024 |
| 217 | ${dump_size}= Read Attribute ${DUMP_ENTRY_URI}${dump_id} Size |
| 218 | Should Be True 0 < ${dump_size} < 204800 |
| 219 | |
| 220 | |
Naman Navin Hegde | ebd4d68 | 2019-07-22 02:39:35 -0500 | [diff] [blame] | 221 | Verify Download BMC Dump |
| 222 | [Documentation] Verify that a BMC dump can be downloaded to the local machine. |
| 223 | [Tags] Verify_Download_BMC_Dump |
| 224 | |
| 225 | ${dump_id}= Create User Initiated Dump |
| 226 | ${dump_dict}= Get Dump Dict |
| 227 | ${bmc_dump_name}= Fetch From Right ${dump_dict['${dump_id}']} / |
| 228 | ${bmc_dump_checksum} ${stderr} ${rc}= BMC Execute Command |
| 229 | ... md5sum ${dump_dict['${dump_id}']}|awk '{print$1}' |
| 230 | ${bmc_dump_size} ${stderr} ${rc}= BMC Execute Command |
| 231 | ... stat -c "%s" ${dump_dict['${dump_id}']} |
| 232 | |
| 233 | ${response}= OpenBMC Get Request ${DUMP_DOWNLOAD_URI}${dump_id} |
| 234 | ... quiet=${1} |
| 235 | Should Be Equal As Strings ${response.status_code} ${HTTP_OK} |
| 236 | Create Binary File ${EXECDIR}${/}dumps ${response.content} |
| 237 | Run tar -xvf ${EXECDIR}${/}dumps |
| 238 | ${download_dump_name}= Fetch From Left ${bmc_dump_name} . |
| 239 | ${download_dump_checksum}= Run md5sum ${EXECDIR}/dumps|awk '{print$1}' |
| 240 | ${download_dump_size}= Run stat -c "%s" ${EXECDIR}${/}dumps |
| 241 | |
| 242 | OperatingSystem.Directory Should Exist ${EXECDIR}/${download_dump_name} |
| 243 | ... msg=Created dump name and downloaded dump name don't match. |
| 244 | Should Be Equal As Strings ${bmc_dump_checksum} ${download_dump_checksum} |
| 245 | Should Be Equal As Strings ${bmc_dump_size} ${download_dump_size} |
| 246 | |
| 247 | Run rm -rf ${EXECDIR}${/}${download_dump_name};rm ${EXECDIR}${/}dumps |
| 248 | |
| 249 | |
Rahul Maheshwari | ad676bf | 2017-06-22 15:06:05 -0500 | [diff] [blame] | 250 | *** Keywords *** |
| 251 | |
Rahul Maheshwari | a89ff9e | 2020-09-25 05:04:33 -0500 | [diff] [blame] | 252 | Suite Setup Execution |
| 253 | [Documentation] Do initial suite setup tasks. |
| 254 | |
| 255 | ${resp}= OpenBMC Get Request ${DUMP_URI} |
| 256 | Run Keyword If '${resp.status_code}' == '${HTTP_NOT_FOUND}' |
| 257 | ... Run Keywords Set Suite Variable ${DUMP_URI} /xyz/openbmc_project/dump/ AND |
| 258 | ... Set Suite Variable ${DUMP_ENTRY_URI} /xyz/openbmc_project/dump/entry/ |
| 259 | |
| 260 | |
George Keishing | 40b7ee0 | 2017-11-13 05:12:41 -0600 | [diff] [blame] | 261 | Test Teardown Execution |
Rahul Maheshwari | ad676bf | 2017-06-22 15:06:05 -0500 | [diff] [blame] | 262 | [Documentation] Do the post test teardown. |
| 263 | |
Rahul Maheshwari | 953038b | 2017-10-17 05:08:59 -0500 | [diff] [blame] | 264 | Wait Until Keyword Succeeds 3 min 15 sec Verify No Dump In Progress |
Rahul Maheshwari | ad676bf | 2017-06-22 15:06:05 -0500 | [diff] [blame] | 265 | FFDC On Test Case Fail |
Rahul Maheshwari | bf9024f | 2017-10-25 10:51:39 -0500 | [diff] [blame] | 266 | Delete All BMC Dump |
Rahul Maheshwari | ad676bf | 2017-06-22 15:06:05 -0500 | [diff] [blame] | 267 | Close All Connections |