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