Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 3 | Documentation eSEL's Test cases. |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 4 | |
George Keishing | 4840c83 | 2019-06-03 08:31:09 -0500 | [diff] [blame] | 5 | Resource ../../../lib/ipmi_client.robot |
| 6 | Resource ../../../lib/openbmc_ffdc.robot |
| 7 | Resource ../../../lib/utils.robot |
George Keishing | 4840c83 | 2019-06-03 08:31:09 -0500 | [diff] [blame] | 8 | Resource ../../../lib/esel_utils.robot |
George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 9 | Resource ../../../lib/boot_utils.robot |
| 10 | Variables ../../../data/variables.py |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 11 | |
Steven Sombar | fac31e9 | 2017-12-15 09:40:34 -0600 | [diff] [blame] | 12 | Suite Setup Suite Setup Execution |
| 13 | Suite Teardown Suite Teardown Execution |
George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 14 | Test Setup Test Setup Execution |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 15 | Test Teardown FFDC On Test Case Fail |
| 16 | |
Matt Fischer | 6fb70d9 | 2023-10-24 19:06:33 -0600 | [diff] [blame] | 17 | Test Tags eSEL |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 18 | |
| 19 | *** Variables *** |
| 20 | |
Sridevi Ramesh | 2a2dbbd | 2025-03-18 00:57:14 -0500 | [diff] [blame] | 21 | ${stack_mode} skip |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 22 | |
Sridevi Ramesh | 2a2dbbd | 2025-03-18 00:57:14 -0500 | [diff] [blame] | 23 | ${LOGGING_SERVICE} xyz.openbmc_project.Logging.service |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 24 | |
Sridevi Ramesh | 2a2dbbd | 2025-03-18 00:57:14 -0500 | [diff] [blame] | 25 | ${ESEL_DATA} ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00 |
| 26 | |
| 27 | ${IPMI_RAW_PREFIX} 0x3a 0xf0 0x |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 28 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 29 | *** Test Cases *** |
| 30 | |
George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 31 | Verify eSEL Using Redfish |
| 32 | [Documentation] Generate eSEL log and verify using redfish. |
| 33 | [Tags] Verify_eSEL_Using_Redfish |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 34 | |
Sridevi Ramesh | 2a2dbbd | 2025-03-18 00:57:14 -0500 | [diff] [blame] | 35 | Create eSEL ${IPMI_RAW_PREFIX} |
George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 36 | Event Log Should Exist |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 37 | |
Steven Sombar | 31b6bd0 | 2019-03-06 10:58:07 -0600 | [diff] [blame] | 38 | |
George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 39 | Verify eSEL Entries Using Redfish |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 40 | [Documentation] Verify that eSEL entries have data. |
George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 41 | [Tags] Verify_eSEL_Entries_Using_Redfish |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 42 | |
Sridevi Ramesh | 2a2dbbd | 2025-03-18 00:57:14 -0500 | [diff] [blame] | 43 | Create eSEL ${IPMI_RAW_PREFIX} |
George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 44 | Redfish.Login |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 45 | Verify eSEL Entries |
| 46 | |
Steven Sombar | 31b6bd0 | 2019-03-06 10:58:07 -0600 | [diff] [blame] | 47 | |
George Keishing | 146da7e | 2018-04-20 10:35:55 -0500 | [diff] [blame] | 48 | Verify eSEL Description And EntryID Using REST |
| 49 | [Documentation] Create eSEL log and verify "Description" and "EntryID" |
| 50 | ... are not empty via REST. |
| 51 | [Tags] Verify_eSEL_Description_And_EntryID_Using_REST |
| 52 | |
| 53 | # { |
| 54 | # "AdditionalData": [ |
| 55 | # "CALLOUT_INVENTORY_PATH=", |
| 56 | # "ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00", |
| 57 | # "_PID=1175" |
| 58 | # ], |
| 59 | # "Description": "An error was detected with the base platform, |
| 60 | # but was not able to be deciphered. Contact your next level of support.", |
| 61 | # "EventID": "FQPSPAA0011M", |
| 62 | # "Id": 1, |
| 63 | # "Message": "org.open_power.Host.Error.Event", |
| 64 | # "Resolved": 0, |
| 65 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 66 | # "Timestamp": 1524233022072, |
George Keishing | 58520d0 | 2020-02-24 10:55:32 -0600 | [diff] [blame] | 67 | # "Associations": [ |
George Keishing | 146da7e | 2018-04-20 10:35:55 -0500 | [diff] [blame] | 68 | # [ |
| 69 | # "callout", |
| 70 | # "fault", |
| 71 | # "" |
| 72 | # ] |
| 73 | # ] |
| 74 | |
Sridevi Ramesh | 2a2dbbd | 2025-03-18 00:57:14 -0500 | [diff] [blame] | 75 | Create eSEL ${IPMI_RAW_PREFIX} |
George Keishing | 146da7e | 2018-04-20 10:35:55 -0500 | [diff] [blame] | 76 | |
| 77 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 78 | ${desc}= Read Attribute ${elog_entry[0]} Description |
| 79 | Should Not Be Empty ${desc} msg=${desc} is not populated. |
| 80 | |
| 81 | ${event_id}= Read Attribute ${elog_entry[0]} EventID |
| 82 | Should Not Be Equal ${event_id} ${None} |
| 83 | ... msg=${event_id} is populated default "None". |
| 84 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 85 | |
George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 86 | Verify Multiple eSEL Using Redfish |
| 87 | [Documentation] Generate multiple eSEL log and verify using redfish |
| 88 | [Tags] Verify_Multiple_eSEL_Using_Redfish |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 89 | |
Sridevi Ramesh | 2a2dbbd | 2025-03-18 00:57:14 -0500 | [diff] [blame] | 90 | Create eSEL ${IPMI_RAW_PREFIX} |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 91 | ${entries}= Count eSEL Entries |
Steven Sombar | 31b6bd0 | 2019-03-06 10:58:07 -0600 | [diff] [blame] | 92 | Should Be Equal As Integers ${entries} ${2} |
| 93 | ... msg=Expecting 2 eSELs but found ${entries}. |
| 94 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 95 | |
George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 96 | Check eSEL AdditionalData |
| 97 | [Documentation] Generate eSEL log and verify AdditionalData is |
| 98 | ... not empty. |
George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 99 | [Tags] Check_eSEL_AdditionalData |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 100 | |
Sridevi Ramesh | 2a2dbbd | 2025-03-18 00:57:14 -0500 | [diff] [blame] | 101 | Create eSEL ${IPMI_RAW_PREFIX} |
Sweta Potthuri | 85c36c1 | 2017-07-03 05:30:44 -0500 | [diff] [blame] | 102 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 103 | ${resp}= OpenBMC Get Request ${elog_entry[0]} |
George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 104 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 105 | # "/xyz/openbmc_project/logging/entry/1": { |
| 106 | # "Timestamp": 1487743771812, |
| 107 | # "AdditionalData": [], |
| 108 | # "Message": "org.open_power.Error.Host.Event.Event", |
| 109 | # "Id": 1, |
| 110 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Emergency" |
| 111 | # } |
George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 112 | Should Not Be Empty ${resp.json()["data"]["AdditionalData"]} |
George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 113 | |
Steven Sombar | 31b6bd0 | 2019-03-06 10:58:07 -0600 | [diff] [blame] | 114 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 115 | Test Wrong Reservation_ID |
Steven Sombar | a3f0439 | 2018-10-01 15:38:21 -0500 | [diff] [blame] | 116 | [Documentation] This testcase is to test BMC can handle multi-requestor's |
| 117 | ... oem partial add command with incorrect reservation id. |
| 118 | ... It simulates sending partial add command with fake content |
| 119 | ... and wrong Reservation ID. This command will be rejected. |
George Keishing | cac24c7 | 2016-09-23 04:44:19 -0500 | [diff] [blame] | 120 | [Tags] Test_Wrong_Reservation_ID |
Gunnar Mills | 56b3289 | 2016-11-14 13:56:17 -0600 | [diff] [blame] | 121 | |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 122 | ${rev_id_1}= Run Inband IPMI Raw Command 0x0a 0x42 |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 123 | ${rev_id_ls}= Get Substring ${rev_id_1} 1 3 |
| 124 | ${rev_id_ms}= Get Substring ${rev_id_1} -2 |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 125 | Run Inband IPMI Raw Command 0x0a 0x42 |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 126 | ${output}= Check IPMI OEMpartialadd Reject |
Sridevi Ramesh | 2a2dbbd | 2025-03-18 00:57:14 -0500 | [diff] [blame] | 127 | ... ${IPMI_RAW_PREFIX}${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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 128 | Should Contain ${output} Reservation cancelled |
| 129 | |
| 130 | Test Correct Reservation_ID |
Steven Sombar | a3f0439 | 2018-10-01 15:38:21 -0500 | [diff] [blame] | 131 | [Documentation] This testcase is to test BMC can handle multi-requestor's |
| 132 | ... oem partial add command with correct reservation id. It |
| 133 | ... simulates sending partial add command with fake content |
| 134 | ... and correct Reservation ID. This command will be accepted. |
George Keishing | cac24c7 | 2016-09-23 04:44:19 -0500 | [diff] [blame] | 135 | [Tags] Test_Correct_Reservation_ID |
Gunnar Mills | 56b3289 | 2016-11-14 13:56:17 -0600 | [diff] [blame] | 136 | |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 137 | Run Inband IPMI Raw Command 0x0a 0x42 |
| 138 | ${rev_id_2}= Run Inband IPMI Raw Command 0x0a 0x42 |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 139 | ${rev_id_ls}= Get Substring ${rev_id_2} 1 3 |
| 140 | ${rev_id_ms}= Get Substring ${rev_id_2} -2 |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 141 | ${output}= Check IPMI OEMpartialadd Accept |
Sridevi Ramesh | 2a2dbbd | 2025-03-18 00:57:14 -0500 | [diff] [blame] | 142 | ... ${IPMI_RAW_PREFIX}${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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 143 | Should Be Empty ${output} |
| 144 | |
Steven Sombar | a3f0439 | 2018-10-01 15:38:21 -0500 | [diff] [blame] | 145 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 146 | *** Keywords *** |
| 147 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 148 | |
Steven Sombar | fac31e9 | 2017-12-15 09:40:34 -0600 | [diff] [blame] | 149 | Suite Teardown Execution |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 150 | [Documentation] Cleanup test logs and connection. |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 151 | Close All Connections |
George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 152 | Redfish.Logout |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 153 | |
| 154 | |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 155 | Restart Logging Service |
| 156 | [Documentation] Restart Logging to clear eSEL log. |
| 157 | ${MainPID} ${stderr}= Execute Command |
| 158 | ... systemctl restart ${LOGGING_SERVICE} return_stderr=True |
| 159 | Should Be Empty ${stderr} |
| 160 | |
| 161 | Sleep 10s reason=Wait for service to restart properly. |
| 162 | |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 163 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 164 | Run IPMI Command Returned |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 165 | [Documentation] Run the IPMI command and return the output. |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 166 | [Arguments] ${args} |
Sridevi Ramesh | 2a2dbbd | 2025-03-18 00:57:14 -0500 | [diff] [blame] | 167 | |
| 168 | # Description of Argument(s): |
| 169 | # args IPMI raw data |
| 170 | # (e.g: 0x00 0x03 0x03). |
| 171 | |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 172 | ${output_1}= Execute Command /tmp/ipmitool -I dbus raw ${args} |
George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 173 | RETURN ${output_1} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 174 | |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 175 | |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 176 | Check IPMI OEMpartialadd Reject |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 177 | [Documentation] Check if IPMI rejects the OEM partial add command. |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 178 | [Arguments] ${args} |
Sridevi Ramesh | 2a2dbbd | 2025-03-18 00:57:14 -0500 | [diff] [blame] | 179 | |
| 180 | # Description of Argument(s): |
| 181 | # args IPMI raw data |
| 182 | # (e.g: 0x00 0x03 0x03). |
| 183 | |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 184 | Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD} |
| 185 | ${stdout} ${stderr} ${output_2}= Execute Command ipmitool raw ${args} |
| 186 | ... return_stdout=True return_stderr=True return_rc=True |
George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 187 | RETURN ${stderr} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 188 | |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 189 | |
George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 190 | Test Setup Execution |
| 191 | [Documentation] Do test case setup tasks. |
| 192 | |
| 193 | Redfish.Login |
| 194 | Redfish Purge Event Log |
| 195 | |
| 196 | |
Steven Sombar | fac31e9 | 2017-12-15 09:40:34 -0600 | [diff] [blame] | 197 | Suite Setup Execution |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 198 | [Documentation] Validates input parameters & check if HOST OS is up. |
| 199 | |
| 200 | Should Not Be Empty |
| 201 | ... ${OS_HOST} msg=You must provide DNS name/IP of the OS host. |
| 202 | Should Not Be Empty |
| 203 | ... ${OS_USERNAME} msg=You must provide OS host user name. |
| 204 | Should Not Be Empty |
| 205 | ... ${OS_PASSWORD} msg=You must provide OS host user password. |
| 206 | |
Sweta Potthuri | b2c50f1 | 2017-06-28 03:53:30 -0500 | [diff] [blame] | 207 | # Boot to OS. |
George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 208 | Redfish Power On |
| 209 | |
| 210 | Redfish.Login |
| 211 | Redfish Purge Event Log |
Sweta Potthuri | b2c50f1 | 2017-06-28 03:53:30 -0500 | [diff] [blame] | 212 | |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 213 | Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD} |
| 214 | Open Connection And Log In |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 215 | |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 216 | |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 217 | Check IPMI OEMpartialadd Accept |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 218 | [Documentation] Check if IPMI accepts the OEM partial add command. |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 219 | [Arguments] ${args} |
Sridevi Ramesh | 2a2dbbd | 2025-03-18 00:57:14 -0500 | [diff] [blame] | 220 | |
| 221 | # Description of Argument(s): |
| 222 | # args IPMI raw data |
| 223 | # (e.g: 0x00 0x03 0x03). |
| 224 | |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 225 | Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD} |
| 226 | ${stdout} ${stderr} ${output_3}= Execute Command ipmitool raw ${args} |
| 227 | ... return_stdout=True return_stderr=True return_rc=True |
| 228 | Should Be Equal ${output_3} ${0} msg=${stderr} |
George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 229 | RETURN ${stderr} |
George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 230 | |
| 231 | |
| 232 | Event Log Should Exist |
| 233 | [Documentation] Event log entries should exist. |
| 234 | |
| 235 | ${elogs}= Get Event Logs |
| 236 | Should Not Be Empty ${elogs} msg=System event log entry is not empty. |