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