blob: 9d075a415d98028061d1f3a9b7ad10eb993e4dbb [file] [log] [blame]
Rahul Maheshwariad676bf2017-06-22 15:06:05 -05001*** Settings ***
2
3Documentation Test dump functionality of OpenBMC.
4
George Keishingfb3f9a52019-07-18 13:13:58 -05005Resource ../../lib/openbmc_ffdc.robot
6Resource ../../lib/rest_client.robot
7Resource ../../lib/dump_utils.robot
8Resource ../../lib/boot_utils.robot
9Resource ../../lib/utils.robot
George Keishingbac0c572019-08-08 23:19:45 -050010Resource ../../lib/state_manager.robot
George Keishingfb3f9a52019-07-18 13:13:58 -050011Library ../../lib/bmc_ssh_utils.py
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050012
13Test Setup Open Connection And Log In
George Keishing40b7ee02017-11-13 05:12:41 -060014Test Teardown Test Teardown Execution
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050015
16*** Test Cases ***
17
Sivas SRRc0957412017-10-06 13:02:08 -050018Pre 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 Keishing40b7ee02017-11-13 05:12:41 -060025
Rahul Maheshwari355f2702017-10-17 09:15:23 -050026Verify 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 Maheshwariad676bf2017-06-22 15:06:05 -050030
George Keishingfb3f9a52019-07-18 13:13:58 -050031 Redfish Power Off stack_mode=skip
Sivas SRR7aabd792017-10-18 21:28:23 -050032 ${dump_id}= Create User Initiated Dump
Steven Sombar336fa972019-11-07 13:12:58 -060033 Check Existence Of BMC Dump File ${dump_id}
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050034
Steven Sombara011c022019-01-16 18:13:52 -060035
George Keishinga2dab9f2017-09-05 13:54:01 -050036Verify 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 Keishingfee18cf2017-09-20 09:46:00 -050041 Delete All BMC Dump
Sivas SRR7aabd792017-10-18 21:28:23 -050042 ${dump_id}= Create User Initiated Dump
George Keishinga2dab9f2017-09-05 13:54:01 -050043 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 Sombaraaaab222018-12-19 13:16:23 -060047 ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}list
George Keishinga2dab9f2017-09-05 13:54:01 -050048 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
Steven Sombar336fa972019-11-07 13:12:58 -060049 Check Existence Of BMC Dump File ${dump_id}
Sivas SRR7aabd792017-10-18 21:28:23 -050050
51
52Verify 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 Sombaraaaab222018-12-19 13:16:23 -060059 ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}list
Sivas SRR7aabd792017-10-18 21:28:23 -050060 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
Steven Sombar336fa972019-11-07 13:12:58 -060061 Check Existence Of BMC Dump File ${dump_id}
George Keishinga2dab9f2017-09-05 13:54:01 -050062
63
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050064Delete 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
Steven Sombar336fa972019-11-07 13:12:58 -060069 Check Existence Of BMC Dump File ${dump_id}
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050070
71 Delete BMC Dump ${dump_id}
72
73
74Verify User Initiated Dump Size
George Keishing6db52022017-08-22 00:39:22 -050075 [Documentation] Verify user Initiated BMC dump size is under 200k.
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050076 [Tags] Verify_User_Initiated_Dump_Size
77
78 ${dump_id}= Create User Initiated Dump
79
Steven Sombaraaaab222018-12-19 13:16:23 -060080 ${dump_size}= Read Attribute ${DUMP_ENTRY_URI}${dump_id} Size
George Keishing6db52022017-08-22 00:39:22 -050081 # Max size for dump is 200k = 200x1024
82 Should Be True 0 < ${dump_size} < 204800
Steven Sombar336fa972019-11-07 13:12:58 -060083 Check Existence Of BMC Dump File ${dump_id}
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050084
85
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050086Create 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 Sombaraaaab222018-12-19 13:16:23 -060095 ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}${dump_id_1}
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050096 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
97
Steven Sombaraaaab222018-12-19 13:16:23 -060098 ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}${dump_id_2}
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050099 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
Steven Sombar336fa972019-11-07 13:12:58 -0600100 Check Existence Of BMC Dump File ${dump_id_2}
Rahul Maheshwariad676bf2017-06-22 15:06:05 -0500101
102
Rahul Maheshwari0dafbb42017-08-22 13:17:52 -0500103Create 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
Sushma M Md27fc312020-06-19 08:26:50 -0500107 FOR ${INDEX} IN 1 5
108 ${dump_id}= Create User Initiated Dump
109 Delete BMC Dump ${dump_id}
110 END
Rahul Maheshwari0dafbb42017-08-22 13:17:52 -0500111
112
113Delete All BMC Dumps And Verify
114 [Documentation] Delete all BMC dumps and verify.
115 [Tags] Delete_All_BMC_Dumps_And_Verify
116
117 # Create some dump.
118 Create User Initiated Dump
119 Create User Initiated Dump
120
George Keishingfee18cf2017-09-20 09:46:00 -0500121 Delete All BMC Dump
Steven Sombaraaaab222018-12-19 13:16:23 -0600122 ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}list
Rahul Maheshwari0dafbb42017-08-22 13:17:52 -0500123 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
124
George Keishing40b7ee02017-11-13 05:12:41 -0600125
126Verify User Initiated BMC Dump When Host Booted
127 [Documentation] Create user initiated BMC dump at host booted state and
128 ... verify dump entry for it.
129 [Tags] Verify_User_Initiated_BMC_Dump_When_Host_Booted
130
George Keishingfb3f9a52019-07-18 13:13:58 -0500131 Redfish Power On stack_mode=skip
George Keishing40b7ee02017-11-13 05:12:41 -0600132 Create User Initiated Dump
133
134
Rahul Maheshwari1612ac92017-08-30 14:42:32 -0500135Verify Core Dump Size
136 [Documentation] Verify BMC core dump size is under 200k.
137 [Tags] Verify_Core_Dump_Size
138
139 Delete All Dumps
140 Trigger Core Dump
George Keishing40efd762018-10-22 04:04:00 -0500141 Wait Until Keyword Succeeds 2 min 10 sec Get Dump Entries
Rahul Maheshwari1612ac92017-08-30 14:42:32 -0500142
143 ${dump_entries}= Get URL List ${DUMP_ENTRY_URI}
144 ${dump_size}= Read Attribute ${dump_entries[0]} Size
145
146 # Max size for dump is 200k = 200x1024
147 Should Be True 0 < ${dump_size} < 204800 msg=Size of dump is incorrect.
148
149
Steven Sombara011c022019-01-16 18:13:52 -0600150Dump Out Of Space Test
151 [Documentation] Verify out of dump space is reported when attempt
152 ... to create too many dumps.
153 [Tags] Dump_Out_Of_Space_Test
George Keishingda67cdd2019-08-26 23:40:57 -0500154 [Setup] Delete All BMC Dump
Steven Sombara011c022019-01-16 18:13:52 -0600155
156 # Systems typically hold 8-14 dumps before running out of dump space.
157 # Attempt to create too_many_dumps. Expect to run out of space
158 # before this.
George Keishing656eb4a2019-09-03 03:48:01 -0500159 ${too_many_dumps} Set Variable ${20}
Steven Sombara011c022019-01-16 18:13:52 -0600160
161 # Loop, creating a dump each iteration. Will either get dump_id or
162 # will get EMPTY when out of dump space.
Sushma M Md27fc312020-06-19 08:26:50 -0500163 FOR ${n} IN RANGE 0 ${too_many_dumps}
164 ${dump_id}= Create User Initiated Dump check_out_of_space=${True}
165 Exit For Loop If '${dump_id}' == '${EMPTY}'
166 Check Existence Of BMC Dump File ${dump_id}
167 END
Steven Sombara011c022019-01-16 18:13:52 -0600168
169 Run Keyword If '${dump_id}' != '${EMPTY}' Fail
170 ... msg=Did not run out of dump space as expected.
171
Steven Sombara011c022019-01-16 18:13:52 -0600172
Sivas SRRc0957412017-10-06 13:02:08 -0500173Post Dump BMC Performance Test
174 [Documentation] Check performance of memory, CPU & file system of BMC.
175 [Tags] Post_Dump_BMC_Performance_Test
176
177 Open Connection And Log In
178 Check BMC Performance
179
Steven Sombara011c022019-01-16 18:13:52 -0600180
Sivas SRRc0957412017-10-06 13:02:08 -0500181Post Dump Core Dump Check
182 [Documentation] Check core dump existence on BMC after code update.
183 [Tags] Post_Dump_Core_Dump_Check
184
185 Check For Core Dumps
Rahul Maheshwari0dafbb42017-08-22 13:17:52 -0500186
Rahul Maheshwari1612ac92017-08-30 14:42:32 -0500187
Anusha Dathatrieda09492019-02-26 08:30:13 -0600188Verify Dump After Host Watchdog Error Injection
189 [Documentation] Inject host watchdog error and verify whether dump is generated.
190 [Tags] Verify_Dump_After_Host_Watchdog_Error_Injection
191
George Keishingfb3f9a52019-07-18 13:13:58 -0500192 Redfish Power On
Anusha Dathatrieda09492019-02-26 08:30:13 -0600193
194 Run Keyword And Ignore Error Delete All Dumps
195
196 # Enable auto reboot
197 Set Auto Reboot ${1}
198
199 Trigger Host Watchdog Error 2000 30
200
201 Wait Until Keyword Succeeds 300 sec 20 sec Is Host Rebooted
202
203 #Get dump details
204 @{dump_entry_list}= Read Properties ${DUMP_ENTRY_URI}
205
206 # Verifing that there is only one dump
207 ${length}= Get length ${dump_entry_list}
208 Should Be Equal As Integers ${length} ${1}
209
210 # Get dump id
211 ${value}= Get From List ${dump_entry_list} 0
212 @{split_value}= Split String ${value} /
213 ${dump_id}= Get From List ${split_value} -1
214
215 # Max size for dump is 200k = 200x1024
216 ${dump_size}= Read Attribute ${DUMP_ENTRY_URI}${dump_id} Size
217 Should Be True 0 < ${dump_size} < 204800
218
219
Naman Navin Hegdeebd4d682019-07-22 02:39:35 -0500220Verify Download BMC Dump
221 [Documentation] Verify that a BMC dump can be downloaded to the local machine.
222 [Tags] Verify_Download_BMC_Dump
223
224 ${dump_id}= Create User Initiated Dump
225 ${dump_dict}= Get Dump Dict
226 ${bmc_dump_name}= Fetch From Right ${dump_dict['${dump_id}']} /
227 ${bmc_dump_checksum} ${stderr} ${rc}= BMC Execute Command
228 ... md5sum ${dump_dict['${dump_id}']}|awk '{print$1}'
229 ${bmc_dump_size} ${stderr} ${rc}= BMC Execute Command
230 ... stat -c "%s" ${dump_dict['${dump_id}']}
231
232 ${response}= OpenBMC Get Request ${DUMP_DOWNLOAD_URI}${dump_id}
233 ... quiet=${1}
234 Should Be Equal As Strings ${response.status_code} ${HTTP_OK}
235 Create Binary File ${EXECDIR}${/}dumps ${response.content}
236 Run tar -xvf ${EXECDIR}${/}dumps
237 ${download_dump_name}= Fetch From Left ${bmc_dump_name} .
238 ${download_dump_checksum}= Run md5sum ${EXECDIR}/dumps|awk '{print$1}'
239 ${download_dump_size}= Run stat -c "%s" ${EXECDIR}${/}dumps
240
241 OperatingSystem.Directory Should Exist ${EXECDIR}/${download_dump_name}
242 ... msg=Created dump name and downloaded dump name don't match.
243 Should Be Equal As Strings ${bmc_dump_checksum} ${download_dump_checksum}
244 Should Be Equal As Strings ${bmc_dump_size} ${download_dump_size}
245
246 Run rm -rf ${EXECDIR}${/}${download_dump_name};rm ${EXECDIR}${/}dumps
247
248
Rahul Maheshwariad676bf2017-06-22 15:06:05 -0500249*** Keywords ***
250
George Keishing40b7ee02017-11-13 05:12:41 -0600251Test Teardown Execution
Rahul Maheshwariad676bf2017-06-22 15:06:05 -0500252 [Documentation] Do the post test teardown.
253
Rahul Maheshwari953038b2017-10-17 05:08:59 -0500254 Wait Until Keyword Succeeds 3 min 15 sec Verify No Dump In Progress
Rahul Maheshwariad676bf2017-06-22 15:06:05 -0500255 FFDC On Test Case Fail
Rahul Maheshwaribf9024f2017-10-25 10:51:39 -0500256 Delete All BMC Dump
Rahul Maheshwariad676bf2017-06-22 15:06:05 -0500257 Close All Connections