| 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 |  | 
 | 18 | Force Tags  eSEL_Logging | 
 | 19 |  | 
 | 20 | *** Variables *** | 
 | 21 |  | 
| Sweta Potthuri | af741cb | 2017-07-04 09:41:17 -0500 | [diff] [blame] | 22 | ${stack_mode}       skip | 
| George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 23 |  | 
 | 24 | ${LOGGING_SERVICE}  xyz.openbmc_project.Logging.service | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 25 |  | 
| George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 26 | ${ESEL_DATA}        ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00 | 
 | 27 |  | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 28 | *** Test Cases *** | 
 | 29 |  | 
| George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 30 | Verify eSEL Using Redfish | 
 | 31 |     [Documentation]  Generate eSEL log and verify using redfish. | 
 | 32 |     [Tags]  Verify_eSEL_Using_Redfish | 
| George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 33 |  | 
| George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 34 |     Create eSEL | 
| George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 35 |     Event Log Should Exist | 
| George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 36 |  | 
| Steven Sombar | 31b6bd0 | 2019-03-06 10:58:07 -0600 | [diff] [blame] | 37 |  | 
| George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 38 | Verify eSEL Entries Using Redfish | 
| George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 39 |     [Documentation]  Verify that eSEL entries have data. | 
| George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 40 |     [Tags]  Verify_eSEL_Entries_Using_Redfish | 
| Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 41 |  | 
| George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 42 |     Create eSEL | 
| George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 43 |     Redfish.Login | 
| George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 44 |     Verify eSEL Entries | 
 | 45 |  | 
| Steven Sombar | 31b6bd0 | 2019-03-06 10:58:07 -0600 | [diff] [blame] | 46 |  | 
| George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 47 | # TODO: openbmc/openbmc-test-automation#1789 | 
| 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 |  | 
 | 75 |     Create eSEL | 
 | 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 |  | 
| George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 90 |     Create eSEL | 
 | 91 |     Create eSEL | 
 | 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 | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 97 | # TODO: openbmc/openbmc-test-automation#1789 | 
| George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 98 | Check eSEL AdditionalData | 
 | 99 |     [Documentation]  Generate eSEL log and verify AdditionalData is | 
 | 100 |     ...              not empty. | 
| George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 101 |     [Tags]  Check_eSEL_AdditionalData | 
| Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 102 |  | 
| George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 103 |     Create eSEL | 
| Sweta Potthuri | 85c36c1 | 2017-07-03 05:30:44 -0500 | [diff] [blame] | 104 |     ${elog_entry}=  Get URL List  ${BMC_LOGGING_ENTRY} | 
 | 105 |     ${resp}=  OpenBMC Get Request  ${elog_entry[0]} | 
| George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 106 |     Should Be Equal As Strings  ${resp.status_code}  ${HTTP_OK} | 
 | 107 |     ${jsondata}=  To JSON  ${resp.content} | 
 | 108 |     # "/xyz/openbmc_project/logging/entry/1": { | 
 | 109 |     #    "Timestamp": 1487743771812, | 
 | 110 |     #    "AdditionalData": [], | 
 | 111 |     #    "Message": "org.open_power.Error.Host.Event.Event", | 
 | 112 |     #    "Id": 1, | 
 | 113 |     #    "Severity": "xyz.openbmc_project.Logging.Entry.Level.Emergency" | 
 | 114 |     # } | 
 | 115 |     Should Not Be Empty  ${jsondata["data"]["AdditionalData"]} | 
 | 116 |  | 
| Steven Sombar | 31b6bd0 | 2019-03-06 10:58:07 -0600 | [diff] [blame] | 117 |  | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 118 | Test Wrong Reservation_ID | 
| Steven Sombar | a3f0439 | 2018-10-01 15:38:21 -0500 | [diff] [blame] | 119 |     [Documentation]  This testcase is to test BMC can handle multi-requestor's | 
 | 120 |     ...              oem partial add command with incorrect reservation id. | 
 | 121 |     ...              It simulates sending partial add command with fake content | 
 | 122 |     ...              and wrong Reservation ID. This command will be rejected. | 
| George Keishing | cac24c7 | 2016-09-23 04:44:19 -0500 | [diff] [blame] | 123 |     [Tags]  Test_Wrong_Reservation_ID | 
| Gunnar Mills | 56b3289 | 2016-11-14 13:56:17 -0600 | [diff] [blame] | 124 |  | 
| Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 125 |     ${rev_id_1}=   Run Inband IPMI Raw Command  0x0a 0x42 | 
| Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 126 |     ${rev_id_ls}=   Get Substring   ${rev_id_1}   1   3 | 
 | 127 |     ${rev_id_ms}=   Get Substring   ${rev_id_1}   -2 | 
| Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 128 |     Run Inband IPMI Raw Command   0x0a 0x42 | 
| Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 129 |     ${output}=  Check IPMI OEMpartialadd Reject | 
 | 130 |     ...  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] | 131 |     Should Contain   ${output}   Reservation cancelled | 
 | 132 |  | 
 | 133 | Test Correct Reservation_ID | 
| Steven Sombar | a3f0439 | 2018-10-01 15:38:21 -0500 | [diff] [blame] | 134 |     [Documentation]  This testcase is to test BMC can handle multi-requestor's | 
 | 135 |     ...              oem partial add command with correct reservation id. It | 
 | 136 |     ...              simulates sending partial add command with fake content | 
 | 137 |     ...              and correct Reservation ID. This command will be accepted. | 
| George Keishing | cac24c7 | 2016-09-23 04:44:19 -0500 | [diff] [blame] | 138 |     [Tags]  Test_Correct_Reservation_ID | 
| Gunnar Mills | 56b3289 | 2016-11-14 13:56:17 -0600 | [diff] [blame] | 139 |  | 
| Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 140 |     Run Inband IPMI Raw Command  0x0a 0x42 | 
 | 141 |     ${rev_id_2}=    Run Inband IPMI Raw Command  0x0a 0x42 | 
| Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 142 |     ${rev_id_ls}=   Get Substring   ${rev_id_2}   1   3 | 
 | 143 |     ${rev_id_ms}=   Get Substring   ${rev_id_2}   -2 | 
| Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 144 |     ${output}=  Check IPMI OEMpartialadd Accept | 
 | 145 |     ...  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 |  | 
| Steven Sombar | a3f0439 | 2018-10-01 15:38:21 -0500 | [diff] [blame] | 148 |  | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 149 | *** Keywords *** | 
 | 150 |  | 
| George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 151 |  | 
| Steven Sombar | fac31e9 | 2017-12-15 09:40:34 -0600 | [diff] [blame] | 152 | Suite Teardown Execution | 
| George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 153 |     [Documentation]  Cleanup test logs and connection. | 
| George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 154 |     Close All Connections | 
| George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 155 |     Redfish.Logout | 
| George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 156 |  | 
 | 157 |  | 
| George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 158 | Restart Logging Service | 
 | 159 |     [Documentation]  Restart Logging to clear eSEL log. | 
 | 160 |     ${MainPID}  ${stderr}=  Execute Command | 
 | 161 |     ...  systemctl restart ${LOGGING_SERVICE}  return_stderr=True | 
 | 162 |     Should Be Empty  ${stderr} | 
 | 163 |  | 
 | 164 |     Sleep  10s  reason=Wait for service to restart properly. | 
 | 165 |  | 
| Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 166 |  | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 167 | Run IPMI Command Returned | 
| Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 168 |     [Documentation]  Run the IPMI command and return the output. | 
| Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 169 |     [Arguments]    ${args} | 
| Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 170 |     ${output_1}=    Execute Command   /tmp/ipmitool -I dbus raw ${args} | 
| Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 171 |     [Return]    ${output_1} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 172 |  | 
| Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 173 |  | 
| Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 174 | Check IPMI OEMpartialadd Reject | 
| Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 175 |     [Documentation]  Check if IPMI rejects the OEM partial add command. | 
| Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 176 |     [Arguments]    ${args} | 
 | 177 |     Login To OS Host  ${OS_HOST}  ${OS_USERNAME}  ${OS_PASSWORD} | 
 | 178 |     ${stdout}  ${stderr}  ${output_2}=  Execute Command  ipmitool raw ${args} | 
 | 179 |     ...        return_stdout=True  return_stderr=True  return_rc=True | 
| Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 180 |     [Return]  ${stderr} | 
| Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 181 |  | 
| Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 182 |  | 
| George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 183 | Test Setup Execution | 
 | 184 |    [Documentation]  Do test case setup tasks. | 
 | 185 |  | 
 | 186 |     Redfish.Login | 
 | 187 |     Redfish Purge Event Log | 
 | 188 |  | 
 | 189 |  | 
| Steven Sombar | fac31e9 | 2017-12-15 09:40:34 -0600 | [diff] [blame] | 190 | Suite Setup Execution | 
| Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 191 |     [Documentation]  Validates input parameters & check if HOST OS is up. | 
 | 192 |  | 
 | 193 |     Should Not Be Empty | 
 | 194 |     ...   ${OS_HOST}  msg=You must provide DNS name/IP of the OS host. | 
 | 195 |     Should Not Be Empty | 
 | 196 |     ...   ${OS_USERNAME}  msg=You must provide OS host user name. | 
 | 197 |     Should Not Be Empty | 
 | 198 |     ...   ${OS_PASSWORD}  msg=You must provide OS host user password. | 
 | 199 |  | 
| Sweta Potthuri | b2c50f1 | 2017-06-28 03:53:30 -0500 | [diff] [blame] | 200 |     # Boot to OS. | 
| George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 201 |     Redfish Power On | 
 | 202 |  | 
 | 203 |     Redfish.Login | 
 | 204 |     Redfish Purge Event Log | 
| Sweta Potthuri | b2c50f1 | 2017-06-28 03:53:30 -0500 | [diff] [blame] | 205 |  | 
| Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 206 |     Login To OS Host  ${OS_HOST}  ${OS_USERNAME}  ${OS_PASSWORD} | 
 | 207 |     Open Connection And Log In | 
| Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 208 |  | 
| Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 209 |  | 
| Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 210 | Check IPMI OEMpartialadd Accept | 
| Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 211 |     [Documentation]  Check if IPMI accepts the OEM partial add command. | 
| Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 212 |     [Arguments]    ${args} | 
 | 213 |     Login To OS Host  ${OS_HOST}  ${OS_USERNAME}  ${OS_PASSWORD} | 
 | 214 |     ${stdout}  ${stderr}  ${output_3}=  Execute Command  ipmitool raw ${args} | 
 | 215 |     ...         return_stdout=True  return_stderr=True  return_rc=True | 
 | 216 |     Should Be Equal  ${output_3}  ${0}  msg=${stderr} | 
| Steven Sombar | a3f0439 | 2018-10-01 15:38:21 -0500 | [diff] [blame] | 217 |     [Return]  ${stderr} | 
| George Keishing | 6716d6a | 2019-06-03 10:18:20 -0500 | [diff] [blame] | 218 |  | 
 | 219 |  | 
 | 220 | Event Log Should Exist | 
 | 221 |     [Documentation]  Event log entries should exist. | 
 | 222 |  | 
 | 223 |     ${elogs}=  Get Event Logs | 
 | 224 |     Should Not Be Empty  ${elogs}  msg=System event log entry is not empty. |