blob: 4b3695cb7578f3e3a5d83aea9b417aab28547775 [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
2
George Keishing505d5b42017-02-21 11:01:54 -06003Documentation eSEL's Test cases.
Chris Austenb29d2e82016-06-07 12:25:35 -05004
George Keishing505d5b42017-02-21 11:01:54 -06005Resource ../lib/ipmi_client.robot
6Resource ../lib/openbmc_ffdc.robot
Sweta Potthurifc9cfd72017-05-10 11:58:13 -05007Resource ../lib/utils.robot
George Keishing505d5b42017-02-21 11:01:54 -06008Variables ../data/variables.py
Sridevi Ramesh87be0642017-05-19 01:20:50 -05009Resource ../lib/utils.robot
Sweta Potthurib2c50f12017-06-28 03:53:30 -050010Resource ../lib/boot_utils.robot
Chris Austenb29d2e82016-06-07 12:25:35 -050011
Steven Sombarfac31e92017-12-15 09:40:34 -060012Suite Setup Suite Setup Execution
13Suite Teardown Suite Teardown Execution
George Keishing505d5b42017-02-21 11:01:54 -060014Test Teardown FFDC On Test Case Fail
George Keishing9af2df02017-10-30 02:16:18 -050015Test Setup Delete All Error Logs
George Keishing505d5b42017-02-21 11:01:54 -060016
17Force Tags eSEL_Logging
18
19*** Variables ***
20
Sweta Potthuriaf741cb2017-07-04 09:41:17 -050021${stack_mode} skip
George Keishing505d5b42017-02-21 11:01:54 -060022${RESERVE_ID} raw 0x0a 0x42
George Keishing9af2df02017-10-30 02:16:18 -050023${RAW_PREFIX} raw 0x3a 0xf0 0x
George Keishing505d5b42017-02-21 11:01:54 -060024
25${RAW_SUFFIX} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00
George Keishing9af2df02017-10-30 02:16:18 -050026... 0xdf 0x00 0x00 0x00 0x00 0x20 0x00 0x04 0x12 0x35 0x6f 0xaa 0x00 0x00
George Keishing505d5b42017-02-21 11:01:54 -060027
28${RAW_SEL_COMMIT} raw 0x0a 0x44 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x20
George Keishingaf190192017-08-18 14:58:07 -050029... 0x00 0x04 0x12 0xA6 0x6f 0x02 0x00 0x01
George Keishing505d5b42017-02-21 11:01:54 -060030
31${LOGGING_SERVICE} xyz.openbmc_project.Logging.service
Chris Austenb29d2e82016-06-07 12:25:35 -050032
George Keishing616c2782017-02-23 13:04:04 -060033${ESEL_DATA} ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00
34
Chris Austenb29d2e82016-06-07 12:25:35 -050035*** Test Cases ***
36
George Keishing505d5b42017-02-21 11:01:54 -060037Verify eSEL Using REST
George Keishing616c2782017-02-23 13:04:04 -060038 [Documentation] Generate eSEL log and verify using REST.
George Keishing505d5b42017-02-21 11:01:54 -060039 [Tags] Verify_eSEL_Using_REST
40
George Keishing616c2782017-02-23 13:04:04 -060041 Create eSEL
George Keishing505d5b42017-02-21 11:01:54 -060042 # New eSEL log should exist
Sweta Potthuri85c36c12017-07-03 05:30:44 -050043 ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}/list
George Keishing505d5b42017-02-21 11:01:54 -060044 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
45
George Keishing616c2782017-02-23 13:04:04 -060046Verify eSEL Entries Using REST
47 [Documentation] Verify that eSEL entries have data.
George Keishing616c2782017-02-23 13:04:04 -060048 [Tags] Verify_eSEL_Entries_Using_REST
Sridevi Ramesh87be0642017-05-19 01:20:50 -050049
George Keishing616c2782017-02-23 13:04:04 -060050 Create eSEL
51 Verify eSEL Entries
52
George Keishing146da7e2018-04-20 10:35:55 -050053Verify eSEL Description And EntryID Using REST
54 [Documentation] Create eSEL log and verify "Description" and "EntryID"
55 ... are not empty via REST.
56 [Tags] Verify_eSEL_Description_And_EntryID_Using_REST
57
58 # {
59 # "AdditionalData": [
60 # "CALLOUT_INVENTORY_PATH=",
61 # "ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00",
62 # "_PID=1175"
63 # ],
64 # "Description": "An error was detected with the base platform,
65 # but was not able to be deciphered. Contact your next level of support.",
66 # "EventID": "FQPSPAA0011M",
67 # "Id": 1,
68 # "Message": "org.open_power.Host.Error.Event",
69 # "Resolved": 0,
70 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
71 # "Timestamp": 1524233022072,
72 # "associations": [
73 # [
74 # "callout",
75 # "fault",
76 # ""
77 # ]
78 # ]
79
80 Create eSEL
81
82 ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
83 ${desc}= Read Attribute ${elog_entry[0]} Description
84 Should Not Be Empty ${desc} msg=${desc} is not populated.
85
86 ${event_id}= Read Attribute ${elog_entry[0]} EventID
87 Should Not Be Equal ${event_id} ${None}
88 ... msg=${event_id} is populated default "None".
89
George Keishing616c2782017-02-23 13:04:04 -060090
91Verify Multiple eSEL Using REST
George Keishing3d14cfa2017-03-06 02:49:49 -060092 [Documentation] Generate multiple eSEL log and verify using REST.
George Keishing616c2782017-02-23 13:04:04 -060093 [Tags] Verify_Multiple_eSEL_Using_REST
Sridevi Ramesh87be0642017-05-19 01:20:50 -050094
George Keishing616c2782017-02-23 13:04:04 -060095 Create eSEL
96 Create eSEL
97 ${entries}= Count eSEL Entries
George Keishing9f398742017-11-23 02:42:33 -060098 # 1 eSEL creates 1 error log and 1 association.
99 Should Be Equal As Integers ${entries} ${4}
George Keishing616c2782017-02-23 13:04:04 -0600100
George Keishing3d14cfa2017-03-06 02:49:49 -0600101Check eSEL AdditionalData
102 [Documentation] Generate eSEL log and verify AdditionalData is
103 ... not empty.
George Keishing3d14cfa2017-03-06 02:49:49 -0600104 [Tags] Check_eSEL_AdditionalData
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500105
George Keishing3d14cfa2017-03-06 02:49:49 -0600106 Create eSEL
Sweta Potthuri85c36c12017-07-03 05:30:44 -0500107 ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
108 ${resp}= OpenBMC Get Request ${elog_entry[0]}
George Keishing3d14cfa2017-03-06 02:49:49 -0600109 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
110 ${jsondata}= To JSON ${resp.content}
111 # "/xyz/openbmc_project/logging/entry/1": {
112 # "Timestamp": 1487743771812,
113 # "AdditionalData": [],
114 # "Message": "org.open_power.Error.Host.Event.Event",
115 # "Id": 1,
116 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Emergency"
117 # }
118 Should Not Be Empty ${jsondata["data"]["AdditionalData"]}
119
Chris Austenb29d2e82016-06-07 12:25:35 -0500120Test Wrong Reservation_ID
George Keishingcac24c72016-09-23 04:44:19 -0500121 [Documentation] This testcase is to test BMC can handle multi-requestor's
122 ... oem partial add command with incorrect reservation id.
123 ... It simulates sending partial add command with fake content
124 ... and wrong Reservation ID. This command will be rejected.
125 [Tags] Test_Wrong_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -0600126
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500127 ${rev_id_1}= Run Inband IPMI Raw Command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600128 ${rev_id_ls}= Get Substring ${rev_id_1} 1 3
129 ${rev_id_ms}= Get Substring ${rev_id_1} -2
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500130 Run Inband IPMI Raw Command 0x0a 0x42
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500131 ${output}= Check IPMI OEMpartialadd Reject
132 ... 0x3a 0xf0 0x${rev_id_ls} 0x${rev_id_ms} 0 0 0 0 0 1 2 3 4 5 6 7 8 9 0xa 0xb 0xc 0xd 0xe 0xf
Chris Austenb29d2e82016-06-07 12:25:35 -0500133 Should Contain ${output} Reservation cancelled
134
135Test Correct Reservation_ID
George Keishingcac24c72016-09-23 04:44:19 -0500136 [Documentation] This testcase is to test BMC can handle multi-requestor's
137 ... oem partial add command with correct reservation id. It
138 ... simulates sending partial add command with fake content
139 ... and correct Reservation ID. This command will be accepted.
140 [Tags] Test_Correct_Reservation_ID
Gunnar Mills56b32892016-11-14 13:56:17 -0600141
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500142 Run Inband IPMI Raw Command 0x0a 0x42
143 ${rev_id_2}= Run Inband IPMI Raw Command 0x0a 0x42
Gunnar Mills1cd544d2016-12-06 11:19:22 -0600144 ${rev_id_ls}= Get Substring ${rev_id_2} 1 3
145 ${rev_id_ms}= Get Substring ${rev_id_2} -2
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500146 ${output}= Check IPMI OEMpartialadd Accept
147 ... 0x3a 0xf0 0x${rev_id_ls} 0x${rev_id_ms} 0 0 0 0 0 1 2 3 4 5 6 7 8 9 0xa 0xb 0xc 0xd 0xe 0xf
Chris Austenb29d2e82016-06-07 12:25:35 -0500148 Should Be Empty ${output}
149
Chris Austenb29d2e82016-06-07 12:25:35 -0500150*** Keywords ***
151
George Keishing616c2782017-02-23 13:04:04 -0600152Create eSEL
153 [Documentation] Create an eSEL.
154 Open Connection And Log In
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500155 ${Resv_id}= Run Inband IPMI Standard Command ${RESERVE_ID}
George Keishing616c2782017-02-23 13:04:04 -0600156 ${cmd}= Catenate
157 ... ${RAW_PREFIX}${Resv_id.strip().rsplit(' ', 1)[0]} ${RAW_SUFFIX}
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500158 Run Inband IPMI Standard Command ${cmd}
159 Run Inband IPMI Standard Command ${RAW_SEL_COMMIT}
George Keishing616c2782017-02-23 13:04:04 -0600160
George Keishing616c2782017-02-23 13:04:04 -0600161Count eSEL Entries
162 [Documentation] Count eSEL entries logged.
163 ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}
164 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
165 ${jsondata}= To JSON ${resp.content}
166 ${count}= Get Length ${jsondata["data"]}
167 [Return] ${count}
168
George Keishing616c2782017-02-23 13:04:04 -0600169Verify eSEL Entries
170 [Documentation] Verify eSEL entries logged.
Sweta Potthuri85c36c12017-07-03 05:30:44 -0500171 ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
172 ${resp}= OpenBMC Get Request ${elog_entry[0]}
George Keishing616c2782017-02-23 13:04:04 -0600173 # "data": {
174 # "AdditionalData": [
175 # "ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00 "
176 # ],
177 # "Id": 1,
George Keishing9f398742017-11-23 02:42:33 -0600178 # "Message": "org.open_power.Host.Error.Event",
179 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
George Keishing616c2782017-02-23 13:04:04 -0600180 # "Timestamp": 1485904869061
181 # }
Sweta Potthuri85c36c12017-07-03 05:30:44 -0500182 ${entry_id}= Read Attribute ${elog_entry[0]} message
183 Should Be Equal ${entry_id}
George Keishing9f398742017-11-23 02:42:33 -0600184 ... org.open_power.Host.Error.Event
Sweta Potthuri85c36c12017-07-03 05:30:44 -0500185 ${entry_id}= Read Attribute ${elog_entry[0]} Severity
186 Should Be Equal ${entry_id}
187 ... xyz.openbmc_project.Logging.Entry.Level.Error
George Keishing616c2782017-02-23 13:04:04 -0600188
Steven Sombarfac31e92017-12-15 09:40:34 -0600189Suite Teardown Execution
George Keishing616c2782017-02-23 13:04:04 -0600190 [Documentation] Cleanup test logs and connection.
George Keishing616c2782017-02-23 13:04:04 -0600191 Close All Connections
192
193
George Keishing505d5b42017-02-21 11:01:54 -0600194Restart Logging Service
195 [Documentation] Restart Logging to clear eSEL log.
196 ${MainPID} ${stderr}= Execute Command
197 ... systemctl restart ${LOGGING_SERVICE} return_stderr=True
198 Should Be Empty ${stderr}
199
200 Sleep 10s reason=Wait for service to restart properly.
201
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500202
Chris Austenb29d2e82016-06-07 12:25:35 -0500203Run IPMI Command Returned
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500204 [Documentation] Run the IPMI command and return the output.
Gunnar Mills38032802016-12-12 13:43:40 -0600205 [Arguments] ${args}
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500206 ${output_1}= Execute Command /tmp/ipmitool -I dbus raw ${args}
Gunnar Millsc9ea9362016-12-13 16:21:13 -0600207 [Return] ${output_1}
Chris Austenb29d2e82016-06-07 12:25:35 -0500208
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500209
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500210Check IPMI OEMpartialadd Reject
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500211 [Documentation] Check if IPMI rejects the OEM partial add command.
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500212 [Arguments] ${args}
213 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
214 ${stdout} ${stderr} ${output_2}= Execute Command ipmitool raw ${args}
215 ... return_stdout=True return_stderr=True return_rc=True
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500216 [Return] ${stderr}
Chris Austenb29d2e82016-06-07 12:25:35 -0500217
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500218
Steven Sombarfac31e92017-12-15 09:40:34 -0600219Suite Setup Execution
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500220 [Documentation] Validates input parameters & check if HOST OS is up.
221
222 Should Not Be Empty
223 ... ${OS_HOST} msg=You must provide DNS name/IP of the OS host.
224 Should Not Be Empty
225 ... ${OS_USERNAME} msg=You must provide OS host user name.
226 Should Not Be Empty
227 ... ${OS_PASSWORD} msg=You must provide OS host user password.
228
Sweta Potthurib2c50f12017-06-28 03:53:30 -0500229 # Boot to OS.
230 REST Power On
231
Sridevi Ramesh87be0642017-05-19 01:20:50 -0500232 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
233 Open Connection And Log In
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500234
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500235
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500236Check IPMI OEMpartialadd Accept
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500237 [Documentation] Check if IPMI accepts the OEM partial add command.
Sweta Potthurifc9cfd72017-05-10 11:58:13 -0500238 [Arguments] ${args}
239 Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
240 ${stdout} ${stderr} ${output_3}= Execute Command ipmitool raw ${args}
241 ... return_stdout=True return_stderr=True return_rc=True
242 Should Be Equal ${output_3} ${0} msg=${stderr}
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -0500243 [Return] ${stderr}