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 | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 5 | Resource ../lib/ipmi_client.robot |
| 6 | Resource ../lib/openbmc_ffdc.robot |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 7 | Resource ../lib/utils.robot |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 8 | Variables ../data/variables.py |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 9 | Resource ../lib/utils.robot |
Sweta Potthuri | b2c50f1 | 2017-06-28 03:53:30 -0500 | [diff] [blame] | 10 | Resource ../lib/boot_utils.robot |
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 | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 14 | Test Teardown FFDC On Test Case Fail |
George Keishing | 9af2df0 | 2017-10-30 02:16:18 -0500 | [diff] [blame] | 15 | Test Setup Delete All Error Logs |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 16 | |
| 17 | Force Tags eSEL_Logging |
| 18 | |
| 19 | *** Variables *** |
| 20 | |
Sweta Potthuri | af741cb | 2017-07-04 09:41:17 -0500 | [diff] [blame] | 21 | ${stack_mode} skip |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 22 | ${RESERVE_ID} raw 0x0a 0x42 |
George Keishing | 9af2df0 | 2017-10-30 02:16:18 -0500 | [diff] [blame] | 23 | ${RAW_PREFIX} raw 0x3a 0xf0 0x |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 24 | |
| 25 | ${RAW_SUFFIX} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00 |
George Keishing | 9af2df0 | 2017-10-30 02:16:18 -0500 | [diff] [blame] | 26 | ... 0xdf 0x00 0x00 0x00 0x00 0x20 0x00 0x04 0x12 0x35 0x6f 0xaa 0x00 0x00 |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 27 | |
| 28 | ${RAW_SEL_COMMIT} raw 0x0a 0x44 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x20 |
George Keishing | af19019 | 2017-08-18 14:58:07 -0500 | [diff] [blame] | 29 | ... 0x00 0x04 0x12 0xA6 0x6f 0x02 0x00 0x01 |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 30 | |
| 31 | ${LOGGING_SERVICE} xyz.openbmc_project.Logging.service |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 32 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 33 | ${ESEL_DATA} ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00 |
| 34 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 35 | *** Test Cases *** |
| 36 | |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 37 | Verify eSEL Using REST |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 38 | [Documentation] Generate eSEL log and verify using REST. |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 39 | [Tags] Verify_eSEL_Using_REST |
| 40 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 41 | Create eSEL |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 42 | # New eSEL log should exist |
Sweta Potthuri | 85c36c1 | 2017-07-03 05:30:44 -0500 | [diff] [blame] | 43 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}/list |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 44 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 45 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 46 | Verify eSEL Entries Using REST |
| 47 | [Documentation] Verify that eSEL entries have data. |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 48 | [Tags] Verify_eSEL_Entries_Using_REST |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 49 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 50 | Create eSEL |
| 51 | Verify eSEL Entries |
| 52 | |
George Keishing | 146da7e | 2018-04-20 10:35:55 -0500 | [diff] [blame] | 53 | Verify 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 Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 90 | |
| 91 | Verify Multiple eSEL Using REST |
George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 92 | [Documentation] Generate multiple eSEL log and verify using REST. |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 93 | [Tags] Verify_Multiple_eSEL_Using_REST |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 94 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 95 | Create eSEL |
| 96 | Create eSEL |
| 97 | ${entries}= Count eSEL Entries |
George Keishing | 9f39874 | 2017-11-23 02:42:33 -0600 | [diff] [blame] | 98 | # 1 eSEL creates 1 error log and 1 association. |
| 99 | Should Be Equal As Integers ${entries} ${4} |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 100 | |
George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 101 | Check eSEL AdditionalData |
| 102 | [Documentation] Generate eSEL log and verify AdditionalData is |
| 103 | ... not empty. |
George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 104 | [Tags] Check_eSEL_AdditionalData |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 105 | |
George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 106 | Create eSEL |
Sweta Potthuri | 85c36c1 | 2017-07-03 05:30:44 -0500 | [diff] [blame] | 107 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 108 | ${resp}= OpenBMC Get Request ${elog_entry[0]} |
George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 109 | 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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 120 | Test Wrong Reservation_ID |
George Keishing | cac24c7 | 2016-09-23 04:44:19 -0500 | [diff] [blame] | 121 | [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 Mills | 56b3289 | 2016-11-14 13:56:17 -0600 | [diff] [blame] | 126 | |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 127 | ${rev_id_1}= Run Inband IPMI Raw Command 0x0a 0x42 |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 128 | ${rev_id_ls}= Get Substring ${rev_id_1} 1 3 |
| 129 | ${rev_id_ms}= Get Substring ${rev_id_1} -2 |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 130 | Run Inband IPMI Raw Command 0x0a 0x42 |
George Keishing | 7d2e551 | 2017-11-06 02:10:04 -0600 | [diff] [blame] | 131 | ${output}= Check IPMI OEMpartialadd Reject 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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 132 | Should Contain ${output} Reservation cancelled |
| 133 | |
| 134 | Test Correct Reservation_ID |
George Keishing | cac24c7 | 2016-09-23 04:44:19 -0500 | [diff] [blame] | 135 | [Documentation] This testcase is to test BMC can handle multi-requestor's |
| 136 | ... oem partial add command with correct reservation id. It |
| 137 | ... simulates sending partial add command with fake content |
| 138 | ... and correct Reservation ID. This command will be accepted. |
| 139 | [Tags] Test_Correct_Reservation_ID |
Gunnar Mills | 56b3289 | 2016-11-14 13:56:17 -0600 | [diff] [blame] | 140 | |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 141 | Run Inband IPMI Raw Command 0x0a 0x42 |
| 142 | ${rev_id_2}= Run Inband IPMI Raw Command 0x0a 0x42 |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 143 | ${rev_id_ls}= Get Substring ${rev_id_2} 1 3 |
| 144 | ${rev_id_ms}= Get Substring ${rev_id_2} -2 |
George Keishing | 7d2e551 | 2017-11-06 02:10:04 -0600 | [diff] [blame] | 145 | ${output}= Check IPMI OEMpartialadd Accept 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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 146 | Should Be Empty ${output} |
| 147 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 148 | *** Keywords *** |
| 149 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 150 | Create eSEL |
| 151 | [Documentation] Create an eSEL. |
| 152 | Open Connection And Log In |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 153 | ${Resv_id}= Run Inband IPMI Standard Command ${RESERVE_ID} |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 154 | ${cmd}= Catenate |
| 155 | ... ${RAW_PREFIX}${Resv_id.strip().rsplit(' ', 1)[0]} ${RAW_SUFFIX} |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 156 | Run Inband IPMI Standard Command ${cmd} |
| 157 | Run Inband IPMI Standard Command ${RAW_SEL_COMMIT} |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 158 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 159 | Count eSEL Entries |
| 160 | [Documentation] Count eSEL entries logged. |
| 161 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY} |
| 162 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 163 | ${jsondata}= To JSON ${resp.content} |
| 164 | ${count}= Get Length ${jsondata["data"]} |
| 165 | [Return] ${count} |
| 166 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 167 | Verify eSEL Entries |
| 168 | [Documentation] Verify eSEL entries logged. |
Sweta Potthuri | 85c36c1 | 2017-07-03 05:30:44 -0500 | [diff] [blame] | 169 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 170 | ${resp}= OpenBMC Get Request ${elog_entry[0]} |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 171 | # "data": { |
| 172 | # "AdditionalData": [ |
| 173 | # "ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00 " |
| 174 | # ], |
| 175 | # "Id": 1, |
George Keishing | 9f39874 | 2017-11-23 02:42:33 -0600 | [diff] [blame] | 176 | # "Message": "org.open_power.Host.Error.Event", |
| 177 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 178 | # "Timestamp": 1485904869061 |
| 179 | # } |
Sweta Potthuri | 85c36c1 | 2017-07-03 05:30:44 -0500 | [diff] [blame] | 180 | ${entry_id}= Read Attribute ${elog_entry[0]} message |
| 181 | Should Be Equal ${entry_id} |
George Keishing | 9f39874 | 2017-11-23 02:42:33 -0600 | [diff] [blame] | 182 | ... org.open_power.Host.Error.Event |
Sweta Potthuri | 85c36c1 | 2017-07-03 05:30:44 -0500 | [diff] [blame] | 183 | ${entry_id}= Read Attribute ${elog_entry[0]} Severity |
| 184 | Should Be Equal ${entry_id} |
| 185 | ... xyz.openbmc_project.Logging.Entry.Level.Error |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 186 | |
Steven Sombar | fac31e9 | 2017-12-15 09:40:34 -0600 | [diff] [blame] | 187 | Suite Teardown Execution |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 188 | [Documentation] Cleanup test logs and connection. |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 189 | Close All Connections |
| 190 | |
| 191 | |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 192 | Restart Logging Service |
| 193 | [Documentation] Restart Logging to clear eSEL log. |
| 194 | ${MainPID} ${stderr}= Execute Command |
| 195 | ... systemctl restart ${LOGGING_SERVICE} return_stderr=True |
| 196 | Should Be Empty ${stderr} |
| 197 | |
| 198 | Sleep 10s reason=Wait for service to restart properly. |
| 199 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 200 | Run IPMI Command Returned |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 201 | [Arguments] ${args} |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 202 | ${output_1}= Execute Command /tmp/ipmitool -I dbus raw ${args} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 203 | [Return] ${output_1} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 204 | |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 205 | Check IPMI OEMpartialadd Reject |
| 206 | [Arguments] ${args} |
| 207 | Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD} |
| 208 | ${stdout} ${stderr} ${output_2}= Execute Command ipmitool raw ${args} |
| 209 | ... return_stdout=True return_stderr=True return_rc=True |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 210 | [Return] ${stderr} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 211 | |
Steven Sombar | fac31e9 | 2017-12-15 09:40:34 -0600 | [diff] [blame] | 212 | Suite Setup Execution |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 213 | [Documentation] Validates input parameters & check if HOST OS is up. |
| 214 | |
| 215 | Should Not Be Empty |
| 216 | ... ${OS_HOST} msg=You must provide DNS name/IP of the OS host. |
| 217 | Should Not Be Empty |
| 218 | ... ${OS_USERNAME} msg=You must provide OS host user name. |
| 219 | Should Not Be Empty |
| 220 | ... ${OS_PASSWORD} msg=You must provide OS host user password. |
| 221 | |
Sweta Potthuri | b2c50f1 | 2017-06-28 03:53:30 -0500 | [diff] [blame] | 222 | # Boot to OS. |
| 223 | REST Power On |
| 224 | |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 225 | Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD} |
| 226 | Open Connection And Log In |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 227 | |
| 228 | Check IPMI OEMpartialadd Accept |
| 229 | [Arguments] ${args} |
| 230 | Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD} |
| 231 | ${stdout} ${stderr} ${output_3}= Execute Command ipmitool raw ${args} |
| 232 | ... return_stdout=True return_stderr=True return_rc=True |
| 233 | Should Be Equal ${output_3} ${0} msg=${stderr} |
| 234 | [Return] ${stderr} |
| 235 | |