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