blob: 109eb9546952468612a58bcf2264fb36fa099479 [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
Steven Sombara011c022019-01-16 18:13:52 -060030 REST Power Off stack_mode=skip
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
Steven Sombara011c022019-01-16 18:13:52 -060034
George Keishinga2dab9f2017-09-05 13:54:01 -050035Verify Dump Persistency On Service Restart
36 [Documentation] Create user dump, restart BMC service and verify dump
37 ... persistency.
38 [Tags] Verify_Dump_Persistency_On_Service_Restart
39
George Keishingfee18cf2017-09-20 09:46:00 -050040 Delete All BMC Dump
Sivas SRR7aabd792017-10-18 21:28:23 -050041 ${dump_id}= Create User Initiated Dump
George Keishinga2dab9f2017-09-05 13:54:01 -050042 BMC Execute Command
43 ... systemctl restart xyz.openbmc_project.Dump.Manager.service
44 Sleep 10s reason=Wait for BMC dump service to restart properly.
45
Steven Sombaraaaab222018-12-19 13:16:23 -060046 ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}list
George Keishinga2dab9f2017-09-05 13:54:01 -050047 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
Sivas SRR7aabd792017-10-18 21:28:23 -050048 Check Existence of BMC Dump file ${dump_id}
49
50
51Verify Dump Persistency On Reset
52 [Documentation] Create user dump, reset BMC and verify dump persistency.
53 [Tags] Verify_Dump_Persistency_On_Reset
54
55 Delete All BMC Dump
56 ${dump_id}= Create User Initiated Dump
57 OBMC Reboot (off)
Steven Sombaraaaab222018-12-19 13:16:23 -060058 ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}list
Sivas SRR7aabd792017-10-18 21:28:23 -050059 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
60 Check Existence of BMC Dump file ${dump_id}
George Keishinga2dab9f2017-09-05 13:54:01 -050061
62
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050063Delete User Initiated BMC Dump And Verify
64 [Documentation] Delete user initiated dump and verify.
65 [Tags] Delete_User_Initiated_Dump_And_Verify
66
67 ${dump_id}= Create User Initiated Dump
Sivas SRR7aabd792017-10-18 21:28:23 -050068 Check Existence of BMC Dump file ${dump_id}
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050069
70 Delete BMC Dump ${dump_id}
71
72
73Verify User Initiated Dump Size
George Keishing6db52022017-08-22 00:39:22 -050074 [Documentation] Verify user Initiated BMC dump size is under 200k.
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050075 [Tags] Verify_User_Initiated_Dump_Size
76
77 ${dump_id}= Create User Initiated Dump
78
Steven Sombaraaaab222018-12-19 13:16:23 -060079 ${dump_size}= Read Attribute ${DUMP_ENTRY_URI}${dump_id} Size
George Keishing6db52022017-08-22 00:39:22 -050080 # Max size for dump is 200k = 200x1024
81 Should Be True 0 < ${dump_size} < 204800
Sivas SRR7aabd792017-10-18 21:28:23 -050082 Check Existence of BMC Dump file ${dump_id}
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050083
84
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050085Create Two User Initiated Dump And Delete One
86 [Documentation] Create two dumps and delete the first.
87 [Tags] Create_Two_User_Initiated_Dump_And_Delete_One
88
89 ${dump_id_1}= Create User Initiated Dump
90 ${dump_id_2}= Create User Initiated Dump
91
92 Delete BMC Dump ${dump_id_1}
93
Steven Sombaraaaab222018-12-19 13:16:23 -060094 ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}${dump_id_1}
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050095 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
96
Steven Sombaraaaab222018-12-19 13:16:23 -060097 ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}${dump_id_2}
Rahul Maheshwariad676bf2017-06-22 15:06:05 -050098 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
Sivas SRR7aabd792017-10-18 21:28:23 -050099 Check Existence of BMC Dump file ${dump_id_2}
Rahul Maheshwariad676bf2017-06-22 15:06:05 -0500100
101
Rahul Maheshwari0dafbb42017-08-22 13:17:52 -0500102Create And Delete BMC Dump Multiple Times
103 [Documentation] Create and delete BMC dump multiple times.
104 [Tags] Create_And_Delete_BMC_Dump_Multiple_Times
105
106 :FOR ${INDEX} IN RANGE 1 5
107 \ ${dump_id}= Create User Initiated Dump
Rahul Maheshwari0dafbb42017-08-22 13:17:52 -0500108 \ Delete BMC Dump ${dump_id}
109
110
111Delete All BMC Dumps And Verify
112 [Documentation] Delete all BMC dumps and verify.
113 [Tags] Delete_All_BMC_Dumps_And_Verify
114
115 # Create some dump.
116 Create User Initiated Dump
117 Create User Initiated Dump
118
George Keishingfee18cf2017-09-20 09:46:00 -0500119 Delete All BMC Dump
Steven Sombaraaaab222018-12-19 13:16:23 -0600120 ${resp}= OpenBMC Get Request ${DUMP_ENTRY_URI}list
Rahul Maheshwari0dafbb42017-08-22 13:17:52 -0500121 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
122
George Keishing40b7ee02017-11-13 05:12:41 -0600123
124Verify User Initiated BMC Dump When Host Booted
125 [Documentation] Create user initiated BMC dump at host booted state and
126 ... verify dump entry for it.
127 [Tags] Verify_User_Initiated_BMC_Dump_When_Host_Booted
128
Steven Sombara011c022019-01-16 18:13:52 -0600129 REST Power On stack_mode=skip
George Keishing40b7ee02017-11-13 05:12:41 -0600130 Create User Initiated Dump
131
132
Rahul Maheshwari1612ac92017-08-30 14:42:32 -0500133Verify Core Dump Size
134 [Documentation] Verify BMC core dump size is under 200k.
135 [Tags] Verify_Core_Dump_Size
136
137 Delete All Dumps
138 Trigger Core Dump
George Keishing40efd762018-10-22 04:04:00 -0500139 Wait Until Keyword Succeeds 2 min 10 sec Get Dump Entries
Rahul Maheshwari1612ac92017-08-30 14:42:32 -0500140
141 ${dump_entries}= Get URL List ${DUMP_ENTRY_URI}
142 ${dump_size}= Read Attribute ${dump_entries[0]} Size
143
144 # Max size for dump is 200k = 200x1024
145 Should Be True 0 < ${dump_size} < 204800 msg=Size of dump is incorrect.
146
147
Steven Sombara011c022019-01-16 18:13:52 -0600148Dump Out Of Space Test
149 [Documentation] Verify out of dump space is reported when attempt
150 ... to create too many dumps.
151 [Tags] Dump_Out_Of_Space_Test
152
153 # Systems typically hold 8-14 dumps before running out of dump space.
154 # Attempt to create too_many_dumps. Expect to run out of space
155 # before this.
156 ${too_many_dumps} Set Variable ${100}
157
158 # Should be able to create at least this many dumps.
159 ${minimum_number_of_dumps} Set Variable ${7}
160
161 # Loop, creating a dump each iteration. Will either get dump_id or
162 # will get EMPTY when out of dump space.
163 :FOR ${n} IN RANGE ${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
168 Run Keyword If '${dump_id}' != '${EMPTY}' Fail
169 ... msg=Did not run out of dump space as expected.
170
171 Run Keyword If ${n} < ${minimum_number_of_dumps} Fail
172 ... msg=Insufficient space for at least ${minimum_number_of_dumps} dumps.
173
174
Sivas SRRc0957412017-10-06 13:02:08 -0500175Post Dump BMC Performance Test
176 [Documentation] Check performance of memory, CPU & file system of BMC.
177 [Tags] Post_Dump_BMC_Performance_Test
178
179 Open Connection And Log In
180 Check BMC Performance
181
Steven Sombara011c022019-01-16 18:13:52 -0600182
Sivas SRRc0957412017-10-06 13:02:08 -0500183Post Dump Core Dump Check
184 [Documentation] Check core dump existence on BMC after code update.
185 [Tags] Post_Dump_Core_Dump_Check
186
187 Check For Core Dumps
Rahul Maheshwari0dafbb42017-08-22 13:17:52 -0500188
Rahul Maheshwari1612ac92017-08-30 14:42:32 -0500189
Rahul Maheshwariad676bf2017-06-22 15:06:05 -0500190*** Keywords ***
191
George Keishing40b7ee02017-11-13 05:12:41 -0600192Test Teardown Execution
Rahul Maheshwariad676bf2017-06-22 15:06:05 -0500193 [Documentation] Do the post test teardown.
194
Rahul Maheshwari953038b2017-10-17 05:08:59 -0500195 Wait Until Keyword Succeeds 3 min 15 sec Verify No Dump In Progress
Rahul Maheshwariad676bf2017-06-22 15:06:05 -0500196 FFDC On Test Case Fail
Rahul Maheshwaribf9024f2017-10-25 10:51:39 -0500197 Delete All BMC Dump
Rahul Maheshwariad676bf2017-06-22 15:06:05 -0500198 Close All Connections