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 |
Sweta Potthuri | b2c50f1 | 2017-06-28 03:53:30 -0500 | [diff] [blame] | 9 | Resource ../lib/boot_utils.robot |
Steven Sombar | a3f0439 | 2018-10-01 15:38:21 -0500 | [diff] [blame] | 10 | Resource ../lib/esel_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 | |
| 23 | ${LOGGING_SERVICE} xyz.openbmc_project.Logging.service |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 24 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 25 | ${ESEL_DATA} ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00 |
| 26 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 27 | *** Test Cases *** |
| 28 | |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 29 | Verify eSEL Using REST |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 30 | [Documentation] Generate eSEL log and verify using REST. |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 31 | [Tags] Verify_eSEL_Using_REST |
| 32 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 33 | Create eSEL |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 34 | # New eSEL log should exist |
Steven Sombar | a8800da | 2018-12-18 16:19:05 -0600 | [diff] [blame] | 35 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}list |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 36 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 37 | |
Steven Sombar | 31b6bd0 | 2019-03-06 10:58:07 -0600 | [diff] [blame] | 38 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 39 | Verify eSEL Entries Using REST |
| 40 | [Documentation] Verify that eSEL entries have data. |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 41 | [Tags] Verify_eSEL_Entries_Using_REST |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 42 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 43 | Create eSEL |
| 44 | Verify eSEL Entries |
| 45 | |
Steven Sombar | 31b6bd0 | 2019-03-06 10:58:07 -0600 | [diff] [blame] | 46 | |
George Keishing | 146da7e | 2018-04-20 10:35:55 -0500 | [diff] [blame] | 47 | Verify eSEL Description And EntryID Using REST |
| 48 | [Documentation] Create eSEL log and verify "Description" and "EntryID" |
| 49 | ... are not empty via REST. |
| 50 | [Tags] Verify_eSEL_Description_And_EntryID_Using_REST |
| 51 | |
| 52 | # { |
| 53 | # "AdditionalData": [ |
| 54 | # "CALLOUT_INVENTORY_PATH=", |
| 55 | # "ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00", |
| 56 | # "_PID=1175" |
| 57 | # ], |
| 58 | # "Description": "An error was detected with the base platform, |
| 59 | # but was not able to be deciphered. Contact your next level of support.", |
| 60 | # "EventID": "FQPSPAA0011M", |
| 61 | # "Id": 1, |
| 62 | # "Message": "org.open_power.Host.Error.Event", |
| 63 | # "Resolved": 0, |
| 64 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 65 | # "Timestamp": 1524233022072, |
| 66 | # "associations": [ |
| 67 | # [ |
| 68 | # "callout", |
| 69 | # "fault", |
| 70 | # "" |
| 71 | # ] |
| 72 | # ] |
| 73 | |
| 74 | Create eSEL |
| 75 | |
| 76 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 77 | ${desc}= Read Attribute ${elog_entry[0]} Description |
| 78 | Should Not Be Empty ${desc} msg=${desc} is not populated. |
| 79 | |
| 80 | ${event_id}= Read Attribute ${elog_entry[0]} EventID |
| 81 | Should Not Be Equal ${event_id} ${None} |
| 82 | ... msg=${event_id} is populated default "None". |
| 83 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 84 | |
| 85 | Verify Multiple eSEL Using REST |
George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 86 | [Documentation] Generate multiple eSEL log and verify using REST. |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 87 | [Tags] Verify_Multiple_eSEL_Using_REST |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 88 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 89 | Create eSEL |
| 90 | Create eSEL |
| 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 | |
George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 101 | Create eSEL |
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} |
| 105 | ${jsondata}= To JSON ${resp.content} |
| 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 | # } |
| 113 | Should Not Be Empty ${jsondata["data"]["AdditionalData"]} |
| 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 |
| 128 | ... 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] | 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 |
| 143 | ... 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] | 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 |
| 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 | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 167 | ${output_1}= Execute Command /tmp/ipmitool -I dbus raw ${args} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 168 | [Return] ${output_1} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 169 | |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 170 | |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 171 | Check IPMI OEMpartialadd Reject |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 172 | [Documentation] Check if IPMI rejects the OEM partial add command. |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 173 | [Arguments] ${args} |
| 174 | Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD} |
| 175 | ${stdout} ${stderr} ${output_2}= Execute Command ipmitool raw ${args} |
| 176 | ... return_stdout=True return_stderr=True return_rc=True |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 177 | [Return] ${stderr} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 178 | |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 179 | |
Steven Sombar | fac31e9 | 2017-12-15 09:40:34 -0600 | [diff] [blame] | 180 | Suite Setup Execution |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 181 | [Documentation] Validates input parameters & check if HOST OS is up. |
| 182 | |
| 183 | Should Not Be Empty |
| 184 | ... ${OS_HOST} msg=You must provide DNS name/IP of the OS host. |
| 185 | Should Not Be Empty |
| 186 | ... ${OS_USERNAME} msg=You must provide OS host user name. |
| 187 | Should Not Be Empty |
| 188 | ... ${OS_PASSWORD} msg=You must provide OS host user password. |
| 189 | |
Sweta Potthuri | b2c50f1 | 2017-06-28 03:53:30 -0500 | [diff] [blame] | 190 | # Boot to OS. |
| 191 | REST Power On |
| 192 | |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 193 | Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD} |
| 194 | Open Connection And Log In |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 195 | |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 196 | |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 197 | Check IPMI OEMpartialadd Accept |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 198 | [Documentation] Check if IPMI accepts the OEM partial add command. |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 199 | [Arguments] ${args} |
| 200 | Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD} |
| 201 | ${stdout} ${stderr} ${output_3}= Execute Command ipmitool raw ${args} |
| 202 | ... return_stdout=True return_stderr=True return_rc=True |
| 203 | Should Be Equal ${output_3} ${0} msg=${stderr} |
Steven Sombar | a3f0439 | 2018-10-01 15:38:21 -0500 | [diff] [blame] | 204 | [Return] ${stderr} |