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 | |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 12 | Suite Setup eSEL Test SetUp |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 13 | Suite Teardown Test Cleanup On Exit |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 14 | Test Teardown FFDC On Test Case Fail |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 15 | Test Setup Delete Error logs |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 16 | |
| 17 | Force Tags eSEL_Logging |
| 18 | |
| 19 | *** Variables *** |
| 20 | |
| 21 | ${RESERVE_ID} raw 0x0a 0x42 |
| 22 | ${RAW_PREFIX} raw 0x32 0xf0 0x |
| 23 | |
| 24 | ${RAW_SUFFIX} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00 |
| 25 | ... 0xdf 0x00 0x00 0x00 0x00 0x20 0x00 0x04 0x12 0x35 0x6f 0xaa 0x00 0x00 |
| 26 | |
| 27 | ${RAW_SEL_COMMIT} raw 0x0a 0x44 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x20 |
| 28 | ... 0x00 0x04 0x12 0x35 0x6f 0x02 0x00 0x01 |
| 29 | |
| 30 | ${LOGGING_SERVICE} xyz.openbmc_project.Logging.service |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 31 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 32 | ${ESEL_DATA} ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00 |
| 33 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 34 | *** Test Cases *** |
| 35 | |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 36 | Verify eSEL Using REST |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 37 | [Documentation] Generate eSEL log and verify using REST. |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 38 | [Tags] Verify_eSEL_Using_REST |
| 39 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 40 | Create eSEL |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 41 | # New eSEL log should exist |
Sweta Potthuri | 85c36c1 | 2017-07-03 05:30:44 -0500 | [diff] [blame] | 42 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}/list |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 43 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 44 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 45 | Verify eSEL Entries Using REST |
| 46 | [Documentation] Verify that eSEL entries have data. |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 47 | [Tags] Verify_eSEL_Entries_Using_REST |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 48 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 49 | Create eSEL |
| 50 | Verify eSEL Entries |
| 51 | |
| 52 | |
| 53 | Verify Multiple eSEL Using REST |
George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 54 | [Documentation] Generate multiple eSEL log and verify using REST. |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 55 | [Tags] Verify_Multiple_eSEL_Using_REST |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 56 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 57 | Create eSEL |
| 58 | Create eSEL |
| 59 | ${entries}= Count eSEL Entries |
| 60 | Should Be Equal As Integers ${entries} ${2} |
| 61 | |
George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 62 | Check eSEL AdditionalData |
| 63 | [Documentation] Generate eSEL log and verify AdditionalData is |
| 64 | ... not empty. |
George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 65 | [Tags] Check_eSEL_AdditionalData |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 66 | |
George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 67 | Create eSEL |
Sweta Potthuri | 85c36c1 | 2017-07-03 05:30:44 -0500 | [diff] [blame] | 68 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 69 | ${resp}= OpenBMC Get Request ${elog_entry[0]} |
George Keishing | 3d14cfa | 2017-03-06 02:49:49 -0600 | [diff] [blame] | 70 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 71 | ${jsondata}= To JSON ${resp.content} |
| 72 | # "/xyz/openbmc_project/logging/entry/1": { |
| 73 | # "Timestamp": 1487743771812, |
| 74 | # "AdditionalData": [], |
| 75 | # "Message": "org.open_power.Error.Host.Event.Event", |
| 76 | # "Id": 1, |
| 77 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Emergency" |
| 78 | # } |
| 79 | Should Not Be Empty ${jsondata["data"]["AdditionalData"]} |
| 80 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 81 | Test Wrong Reservation_ID |
George Keishing | cac24c7 | 2016-09-23 04:44:19 -0500 | [diff] [blame] | 82 | [Documentation] This testcase is to test BMC can handle multi-requestor's |
| 83 | ... oem partial add command with incorrect reservation id. |
| 84 | ... It simulates sending partial add command with fake content |
| 85 | ... and wrong Reservation ID. This command will be rejected. |
| 86 | [Tags] Test_Wrong_Reservation_ID |
Gunnar Mills | 56b3289 | 2016-11-14 13:56:17 -0600 | [diff] [blame] | 87 | |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 88 | ${rev_id_1}= Run Inband IPMI Raw Command 0x0a 0x42 |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 89 | ${rev_id_ls}= Get Substring ${rev_id_1} 1 3 |
| 90 | ${rev_id_ms}= Get Substring ${rev_id_1} -2 |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 91 | Run Inband IPMI Raw Command 0x0a 0x42 |
| 92 | ${output}= Check IPMI OEMpartialadd Reject 0x32 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] | 93 | Should Contain ${output} Reservation cancelled |
| 94 | |
| 95 | Test Correct Reservation_ID |
George Keishing | cac24c7 | 2016-09-23 04:44:19 -0500 | [diff] [blame] | 96 | [Documentation] This testcase is to test BMC can handle multi-requestor's |
| 97 | ... oem partial add command with correct reservation id. It |
| 98 | ... simulates sending partial add command with fake content |
| 99 | ... and correct Reservation ID. This command will be accepted. |
| 100 | [Tags] Test_Correct_Reservation_ID |
Gunnar Mills | 56b3289 | 2016-11-14 13:56:17 -0600 | [diff] [blame] | 101 | |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 102 | Run Inband IPMI Raw Command 0x0a 0x42 |
| 103 | ${rev_id_2}= Run Inband IPMI Raw Command 0x0a 0x42 |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 104 | ${rev_id_ls}= Get Substring ${rev_id_2} 1 3 |
| 105 | ${rev_id_ms}= Get Substring ${rev_id_2} -2 |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 106 | ${output}= Check IPMI OEMpartialadd Accept 0x32 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] | 107 | Should Be Empty ${output} |
| 108 | |
| 109 | Clear Test File |
| 110 | [Documentation] Clear /tmp/esel |
Sridevi Ramesh | 83f5c59 | 2017-01-20 04:35:13 -0600 | [diff] [blame] | 111 | [Tags] Clear_Test_File |
Gunnar Mills | 56b3289 | 2016-11-14 13:56:17 -0600 | [diff] [blame] | 112 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 113 | Execute Command rm /tmp/esel |
| 114 | Execute Command sync |
| 115 | |
| 116 | *** Keywords *** |
| 117 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 118 | Create eSEL |
| 119 | [Documentation] Create an eSEL. |
| 120 | Open Connection And Log In |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 121 | ${Resv_id}= Run Inband IPMI Standard Command ${RESERVE_ID} |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 122 | ${cmd}= Catenate |
| 123 | ... ${RAW_PREFIX}${Resv_id.strip().rsplit(' ', 1)[0]} ${RAW_SUFFIX} |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 124 | Run Inband IPMI Standard Command ${cmd} |
| 125 | Run Inband IPMI Standard Command ${RAW_SEL_COMMIT} |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 126 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 127 | Count eSEL Entries |
| 128 | [Documentation] Count eSEL entries logged. |
| 129 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY} |
| 130 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 131 | ${jsondata}= To JSON ${resp.content} |
| 132 | ${count}= Get Length ${jsondata["data"]} |
| 133 | [Return] ${count} |
| 134 | |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 135 | Verify eSEL Entries |
| 136 | [Documentation] Verify eSEL entries logged. |
Sweta Potthuri | 85c36c1 | 2017-07-03 05:30:44 -0500 | [diff] [blame] | 137 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 138 | ${resp}= OpenBMC Get Request ${elog_entry[0]} |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 139 | # "data": { |
| 140 | # "AdditionalData": [ |
| 141 | # "ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00 " |
| 142 | # ], |
| 143 | # "Id": 1, |
| 144 | # "Message": "org.open_power.Error.Host.Event.Event", |
| 145 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Emergency", |
| 146 | # "Timestamp": 1485904869061 |
| 147 | # } |
Sweta Potthuri | 85c36c1 | 2017-07-03 05:30:44 -0500 | [diff] [blame] | 148 | ${entry_id}= Read Attribute ${elog_entry[0]} message |
| 149 | Should Be Equal ${entry_id} |
| 150 | ... org.open_power.Error.Host.Event.Event |
| 151 | ${entry_id}= Read Attribute ${elog_entry[0]} Severity |
| 152 | Should Be Equal ${entry_id} |
| 153 | ... xyz.openbmc_project.Logging.Entry.Level.Error |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 154 | |
| 155 | Test Cleanup On Exit |
| 156 | [Documentation] Cleanup test logs and connection. |
George Keishing | 616c278 | 2017-02-23 13:04:04 -0600 | [diff] [blame] | 157 | Close All Connections |
| 158 | |
| 159 | |
George Keishing | 505d5b4 | 2017-02-21 11:01:54 -0600 | [diff] [blame] | 160 | Restart Logging Service |
| 161 | [Documentation] Restart Logging to clear eSEL log. |
| 162 | ${MainPID} ${stderr}= Execute Command |
| 163 | ... systemctl restart ${LOGGING_SERVICE} return_stderr=True |
| 164 | Should Be Empty ${stderr} |
| 165 | |
| 166 | Sleep 10s reason=Wait for service to restart properly. |
| 167 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 168 | Run IPMI Command Returned |
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 | |
Sweta Potthuri | fc9cfd7 | 2017-05-10 11:58:13 -0500 | [diff] [blame] | 173 | Check IPMI OEMpartialadd Reject |
| 174 | [Arguments] ${args} |
| 175 | Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD} |
| 176 | ${stdout} ${stderr} ${output_2}= Execute Command ipmitool raw ${args} |
| 177 | ... return_stdout=True return_stderr=True return_rc=True |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 178 | [Return] ${stderr} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 179 | |
Sridevi Ramesh | 87be064 | 2017-05-19 01:20:50 -0500 | [diff] [blame] | 180 | eSEL Test SetUp |
| 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 | |
| 196 | Check IPMI OEMpartialadd Accept |
| 197 | [Arguments] ${args} |
| 198 | Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD} |
| 199 | ${stdout} ${stderr} ${output_3}= Execute Command ipmitool raw ${args} |
| 200 | ... return_stdout=True return_stderr=True return_rc=True |
| 201 | Should Be Equal ${output_3} ${0} msg=${stderr} |
| 202 | [Return] ${stderr} |
| 203 | |