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