blob: 82fc1634384f6917f16f4a9f70d863a5e349c6a2 [file] [log] [blame]
Rahul Maheshwariad676bf2017-06-22 15:06:05 -05001*** Settings ***
2
3Documentation Test dump functionality of OpenBMC.
4
5Resource ../lib/openbmc_ffdc.robot
6Resource ../lib/rest_client.robot
7Resource ../lib/dump_utils.robot
George Keishinga2dab9f2017-09-05 13:54:01 -05008Resource ../lib/boot_utils.robot
Sivas SRRc0957412017-10-06 13:02:08 -05009Resource ../lib/utils.robot
George Keishinga2dab9f2017-09-05 13:54:01 -050010Library ../lib/bmc_ssh_utils.py
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050011
12Test Setup Open Connection And Log In
George Keishing40b7ee02017-11-13 05:12:41 -060013Test Teardown Test Teardown Execution
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050014
15*** Test Cases ***
16
Sivas SRRc0957412017-10-06 13:02:08 -050017Pre Dump BMC Performance Test
18 [Documentation] Check performance of memory, CPU & file system of BMC.
19 [Tags] Pre_Dump_BMC_Performance_Test
20
21 Open Connection And Log In
22 Check BMC Performance
23
George Keishing40b7ee02017-11-13 05:12:41 -060024
Rahul Maheshwari355f2702017-10-17 09:15:23 -050025Verify User Initiated BMC Dump When Powered Off
26 [Documentation] Create user initiated BMC dump at host off state and
27 ... verify dump entry for it.
28 [Tags] Verify_User_Initiated_BMC_Dump_When_Powered_Off
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050029
Rahul Maheshwari355f2702017-10-17 09:15:23 -050030 REST Power Off stack_mode=skip quiet=1
Sivas SRR7aabd792017-10-18 21:28:23 -050031 ${dump_id}= Create User Initiated Dump
32 Check Existence of BMC Dump file ${dump_id}
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050033
George Keishinga2dab9f2017-09-05 13:54:01 -050034Verify Dump Persistency On Service Restart
35 [Documentation] Create user dump, restart BMC service and verify dump
36 ... persistency.
37 [Tags] Verify_Dump_Persistency_On_Service_Restart
38
George Keishingfee18cf2017-09-20 09:46:00 -050039 Delete All BMC Dump
Sivas SRR7aabd792017-10-18 21:28:23 -050040 ${dump_id}= Create User Initiated Dump
George Keishinga2dab9f2017-09-05 13:54:01 -050041 BMC Execute Command
42 ... systemctl restart xyz.openbmc_project.Dump.Manager.service
43 Sleep 10s reason=Wait for BMC dump service to restart properly.
44
45 ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}/list
46 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
Sivas SRR7aabd792017-10-18 21:28:23 -050047 Check Existence of BMC Dump file ${dump_id}
48
49
50Verify Dump Persistency On Reset
51 [Documentation] Create user dump, reset BMC and verify dump persistency.
52 [Tags] Verify_Dump_Persistency_On_Reset
53
54 Delete All BMC Dump
55 ${dump_id}= Create User Initiated Dump
56 OBMC Reboot (off)
57 ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}/list
58 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
59 Check Existence of BMC Dump file ${dump_id}
George Keishinga2dab9f2017-09-05 13:54:01 -050060
61
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050062Delete User Initiated BMC Dump And Verify
63 [Documentation] Delete user initiated dump and verify.
64 [Tags] Delete_User_Initiated_Dump_And_Verify
65
66 ${dump_id}= Create User Initiated Dump
Sivas SRR7aabd792017-10-18 21:28:23 -050067 Check Existence of BMC Dump file ${dump_id}
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050068
69 Delete BMC Dump ${dump_id}
70
71
72Verify User Initiated Dump Size
George Keishing6db52022017-08-22 00:39:22 -050073 [Documentation] Verify user Initiated BMC dump size is under 200k.
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050074 [Tags] Verify_User_Initiated_Dump_Size
75
76 ${dump_id}= Create User Initiated Dump
77
78 ${dump_size}= Read Attribute ${DUMP_ENTRY_URI}/${dump_id} Size
George Keishing6db52022017-08-22 00:39:22 -050079 # Max size for dump is 200k = 200x1024
80 Should Be True 0 < ${dump_size} < 204800
Sivas SRR7aabd792017-10-18 21:28:23 -050081 Check Existence of BMC Dump file ${dump_id}
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050082
83
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050084Create Two User Initiated Dump And Delete One
85 [Documentation] Create two dumps and delete the first.
86 [Tags] Create_Two_User_Initiated_Dump_And_Delete_One
87
88 ${dump_id_1}= Create User Initiated Dump
89 ${dump_id_2}= Create User Initiated Dump
90
91 Delete BMC Dump ${dump_id_1}
92
93 ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}/${dump_id_1}
94 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
95
96 ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}/${dump_id_2}
97 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
Sivas SRR7aabd792017-10-18 21:28:23 -050098 Check Existence of BMC Dump file ${dump_id_2}
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050099
100
Rahul Maheshwari0dafbb42017-08-22 13:17:52 -0500101Create And Delete BMC Dump Multiple Times
102 [Documentation] Create and delete BMC dump multiple times.
103 [Tags] Create_And_Delete_BMC_Dump_Multiple_Times
104
105 :FOR ${INDEX} IN RANGE 1 5
106 \ ${dump_id}= Create User Initiated Dump
Rahul Maheshwari0dafbb42017-08-22 13:17:52 -0500107 \ Delete BMC Dump ${dump_id}
108
109
110Delete All BMC Dumps And Verify
111 [Documentation] Delete all BMC dumps and verify.
112 [Tags] Delete_All_BMC_Dumps_And_Verify
113
114 # Create some dump.
115 Create User Initiated Dump
116 Create User Initiated Dump
117
George Keishingfee18cf2017-09-20 09:46:00 -0500118 Delete All BMC Dump
Rahul Maheshwari0dafbb42017-08-22 13:17:52 -0500119 ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}/list
120 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
121
George Keishing40b7ee02017-11-13 05:12:41 -0600122
123Verify User Initiated BMC Dump When Host Booted
124 [Documentation] Create user initiated BMC dump at host booted state and
125 ... verify dump entry for it.
126 [Tags] Verify_User_Initiated_BMC_Dump_When_Host_Booted
127
George Keishing31585562019-03-09 21:40:12 -0600128 REST Power On stack_mode=skip
George Keishing40b7ee02017-11-13 05:12:41 -0600129 Create User Initiated Dump
130
131
Rahul Maheshwari1612ac92017-08-30 14:42:32 -0500132Verify Core Dump Size
133 [Documentation] Verify BMC core dump size is under 200k.
134 [Tags] Verify_Core_Dump_Size
135
136 Delete All Dumps
137 Trigger Core Dump
George Keishing40efd762018-10-22 04:04:00 -0500138 Wait Until Keyword Succeeds 2 min 10 sec Get Dump Entries
Rahul Maheshwari1612ac92017-08-30 14:42:32 -0500139
140 ${dump_entries}= Get URL List ${DUMP_ENTRY_URI}
141 ${dump_size}= Read Attribute ${dump_entries[0]} Size
142
143 # Max size for dump is 200k = 200x1024
144 Should Be True 0 < ${dump_size} < 204800 msg=Size of dump is incorrect.
145
146
George Keishing31585562019-03-09 21:40:12 -0600147Dump Out Of Space Test
148 [Documentation] Verify out of dump space is reported when attempt
149 ... to create too many dumps.
150 [Tags] Dump_Out_Of_Space_Test
151
152 # Systems typically hold 8-14 dumps before running out of dump space.
153 # Attempt to create too_many_dumps. Expect to run out of space
154 # before this.
155 ${too_many_dumps} Set Variable ${100}
156
157 # Should be able to create at least this many dumps.
158 ${minimum_number_of_dumps} Set Variable ${7}
159
160 # Loop, creating a dump each iteration. Will either get dump_id or
161 # will get EMPTY when out of dump space.
162 :FOR ${n} IN RANGE ${too_many_dumps}
163 \ ${dump_id}= Create User Initiated Dump check_out_of_space=${True}
164 \ Exit For Loop If '${dump_id}' == '${EMPTY}'
165 \ Check Existence of BMC Dump file ${dump_id}
166
167 Run Keyword If '${dump_id}' != '${EMPTY}' Fail
168 ... msg=Did not run out of dump space as expected.
169
170 Run Keyword If ${n} < ${minimum_number_of_dumps} Fail
171 ... msg=Insufficient space for at least ${minimum_number_of_dumps} dumps.
172
173
Sivas SRRc0957412017-10-06 13:02:08 -0500174Post 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
George Keishing31585562019-03-09 21:40:12 -0600181
Sivas SRRc0957412017-10-06 13:02:08 -0500182Post 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 Maheshwari0dafbb42017-08-22 13:17:52 -0500187
Rahul Maheshwari1612ac92017-08-30 14:42:32 -0500188
George Keishing31585562019-03-09 21:40:12 -0600189Verify 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
193 REST Power On
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
207 # Verifing that there is only one dump
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
Rahul Maheshwariad676bf2017-06-22 15:06:05 -0500221*** Keywords ***
222
George Keishing40b7ee02017-11-13 05:12:41 -0600223Test Teardown Execution
Rahul Maheshwariad676bf2017-06-22 15:06:05 -0500224 [Documentation] Do the post test teardown.
225
Rahul Maheshwari953038b2017-10-17 05:08:59 -0500226 Wait Until Keyword Succeeds 3 min 15 sec Verify No Dump In Progress
George Keishing31585562019-03-09 21:40:12 -0600227 #FFDC On Test Case Fail
Rahul Maheshwaribf9024f2017-10-25 10:51:39 -0500228 Delete All BMC Dump
Rahul Maheshwariad676bf2017-06-22 15:06:05 -0500229 Close All Connections