Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
George Keishing | aa09350 | 2019-07-24 23:32:37 -0500 | [diff] [blame] | 2 | Documentation REST test Error callout association. |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 3 | |
George Keishing | aa09350 | 2019-07-24 23:32:37 -0500 | [diff] [blame] | 4 | Resource ../../../lib/bmc_redfish_resource.robot |
| 5 | Resource ../../../lib/bmc_redfish_utils.robot |
| 6 | Resource ../../../lib/connection_client.robot |
| 7 | Resource ../../../lib/openbmc_ffdc.robot |
| 8 | Resource ../../../lib/utils.robot |
| 9 | Resource ../../../lib/state_manager.robot |
| 10 | Resource ../../../lib/boot_utils.robot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 11 | |
George Keishing | aa09350 | 2019-07-24 23:32:37 -0500 | [diff] [blame] | 12 | |
| 13 | Suite Setup Suite Setup Execution |
| 14 | Suite Teardown Suite Teardown Execution |
George Keishing | 95c371a | 2017-09-14 15:42:33 -0500 | [diff] [blame] | 15 | Test Setup Test Setup Execution |
George Keishing | 19b6455 | 2019-01-14 06:56:22 -0600 | [diff] [blame] | 16 | Test Teardown FFDC On Test Case Fail |
George Keishing | d434c51 | 2016-10-07 06:46:29 -0500 | [diff] [blame] | 17 | |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 18 | ***Variables*** |
George Keishing | f2fe745 | 2017-08-24 09:40:46 -0500 | [diff] [blame] | 19 | ${target_device_path} /sys/devices/platform/gpio-fsi/fsi0/slave@00:00/raw |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 20 | |
George Keishing | 95c371a | 2017-09-14 15:42:33 -0500 | [diff] [blame] | 21 | ${stack_mode} skip |
| 22 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 23 | *** Test Cases *** |
| 24 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 25 | Create Test Error Callout And Verify |
| 26 | [Documentation] Create error log callout and verify via REST. |
| 27 | [Tags] Create_Test_Error_Callout_And_Verify |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 28 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 29 | Create Test Error With Callout |
| 30 | Verify Test Error Log And Callout |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 31 | |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 32 | |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 33 | Create Test Error Callout And Verify AdditionalData |
| 34 | [Documentation] Create Test Error Callout And Verify AdditionalData. |
| 35 | [Tags] Create_Test_Error_Callout_And_Verify_AdditionalData |
| 36 | |
| 37 | # Test error log entry example: |
| 38 | # "/xyz/openbmc_project/logging/entry/1": { |
| 39 | # "AdditionalData": [ |
| 40 | # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00", |
| 41 | # "CALLOUT_ERRNO_TEST=0", |
| 42 | # "DEV_ADDR=0x0DEADEAD" |
| 43 | # ] |
| 44 | |
| 45 | Create Test Error With Callout |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 46 | ${elog_entry}= Get Elog URL List |
| 47 | ${resp}= OpenBMC Get Request ${elog_entry[0]} |
George Keishing | 04f9b8c | 2019-02-28 13:55:18 -0600 | [diff] [blame] | 48 | List Should Contain Value |
George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 49 | ... ${resp.json()["data"]["AdditionalData"]} CALLOUT_DEVICE_PATH_TEST=${target_device_path} |
| 50 | List Should Contain Value ${resp.json()["data"]["AdditionalData"]} DEV_ADDR=0x0DEADEAD |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 51 | |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 52 | |
George Keishing | c41eaa7 | 2017-07-27 04:04:32 -0500 | [diff] [blame] | 53 | Create Test Error Callout And Verify Associations |
George Keishing | 58520d0 | 2020-02-24 10:55:32 -0600 | [diff] [blame] | 54 | [Documentation] Create test error callout and verify Associations. |
George Keishing | c41eaa7 | 2017-07-27 04:04:32 -0500 | [diff] [blame] | 55 | [Tags] Create_Test_Error_Callout_And_Verify_Associations |
| 56 | |
| 57 | # Test error log association entry example: |
George Keishing | 58520d0 | 2020-02-24 10:55:32 -0600 | [diff] [blame] | 58 | # "Associations": [ |
George Keishing | c41eaa7 | 2017-07-27 04:04:32 -0500 | [diff] [blame] | 59 | # [ |
| 60 | # "callout", |
| 61 | # "fault", |
| 62 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 63 | # ] |
| 64 | # ] |
| 65 | |
| 66 | Create Test Error With Callout |
| 67 | ${elog_entry}= Get Elog URL List |
| 68 | ${resp}= OpenBMC Get Request ${elog_entry[0]} |
George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 69 | List Should Contain Value ${resp.json()["data"]["Associations"][0]} callout |
| 70 | List Should Contain Value ${resp.json()["data"]["Associations"][0]} fault |
George Keishing | c41eaa7 | 2017-07-27 04:04:32 -0500 | [diff] [blame] | 71 | List Should Contain Value |
George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 72 | ... ${resp.json()["data"]["Associations"][0]} |
George Keishing | c41eaa7 | 2017-07-27 04:04:32 -0500 | [diff] [blame] | 73 | ... /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0 |
| 74 | |
| 75 | |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 76 | Create Test Error Callout And Delete |
| 77 | [Documentation] Create Test Error Callout And Delete. |
| 78 | [Tags] Create_Test_Error_Callout_And_Delete |
| 79 | |
| 80 | # Test error log entry example: |
| 81 | # "/xyz/openbmc_project/logging/entry/1": { |
| 82 | # "AdditionalData": [ |
| 83 | # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00", |
| 84 | # "CALLOUT_ERRNO_TEST=0", |
| 85 | # "DEV_ADDR=0x0DEADEAD" |
| 86 | # ], |
| 87 | # "Id": 1, |
| 88 | # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout", |
| 89 | # "Resolved": 0, |
| 90 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 91 | # "Timestamp": 1487747332528, |
George Keishing | 58520d0 | 2020-02-24 10:55:32 -0600 | [diff] [blame] | 92 | # "Associations": [ |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 93 | # [ |
| 94 | # "callout", |
| 95 | # "fault", |
| 96 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 97 | # ] |
| 98 | # ] |
| 99 | # }, |
| 100 | # "/xyz/openbmc_project/logging/entry/1/callout": { |
| 101 | # "endpoints": [ |
| 102 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 103 | # ] |
| 104 | # }, |
| 105 | |
| 106 | Create Test Error With Callout |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 107 | ${elog_entry}= Get Elog URL List |
| 108 | Delete Error Log Entry ${elog_entry[0]} |
| 109 | ${resp}= OpenBMC Get Request ${elog_entry[0]}/callout |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 110 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 111 | |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 112 | |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 113 | Create Two Test Error Callout And Delete |
| 114 | [Documentation] Create Two Test Error Callout And Delete. |
| 115 | [Tags] Create_Two_Test_Error_Callout_And_Delete |
| 116 | |
| 117 | # Test error log entry example: |
| 118 | # "/xyz/openbmc_project/logging/entry/1": { |
| 119 | # "AdditionalData": [ |
| 120 | # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00", |
| 121 | # "CALLOUT_ERRNO_TEST=0", |
| 122 | # "DEV_ADDR=0x0DEADEAD" |
| 123 | # ], |
| 124 | # "Id": 1, |
| 125 | # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout", |
| 126 | # "Resolved": 0, |
| 127 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 128 | # "Timestamp": 1487747332528, |
George Keishing | 58520d0 | 2020-02-24 10:55:32 -0600 | [diff] [blame] | 129 | # "Associations": [ |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 130 | # [ |
| 131 | # "callout", |
| 132 | # "fault", |
| 133 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 134 | # ] |
| 135 | # ] |
| 136 | # }, |
| 137 | # "/xyz/openbmc_project/logging/entry/1/callout": { |
| 138 | # "endpoints": [ |
| 139 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 140 | # ] |
| 141 | # }, |
| 142 | # "/xyz/openbmc_project/logging/entry/2": { |
| 143 | # "AdditionalData": [ |
| 144 | # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00", |
| 145 | # "CALLOUT_ERRNO_TEST=0", |
| 146 | # "DEV_ADDR=0x0DEADEAD" |
| 147 | # ], |
| 148 | # "Id": 2, |
| 149 | # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout", |
| 150 | # "Resolved": 0, |
| 151 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 152 | # "Timestamp": 1487747332528, |
George Keishing | 58520d0 | 2020-02-24 10:55:32 -0600 | [diff] [blame] | 153 | # "Associations": [ |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 154 | # [ |
| 155 | # "callout", |
| 156 | # "fault", |
| 157 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 158 | # ] |
| 159 | # ] |
| 160 | # }, |
| 161 | # "/xyz/openbmc_project/logging/entry/2/callout": { |
| 162 | # "endpoints": [ |
| 163 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 164 | # ] |
| 165 | # }, |
| 166 | |
| 167 | # Create two error logs. |
| 168 | Create Test Error With Callout |
| 169 | Create Test Error With Callout |
| 170 | |
| 171 | # Delete entry/2 elog entry. |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 172 | ${elog_entry}= Get Elog URL List |
| 173 | Delete Error Log Entry ${elog_entry[1]} |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 174 | |
| 175 | # Verify if entry/1 exist and entry/2 is deleted. |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 176 | ${resp}= OpenBMC Get Request ${elog_entry[0]} |
| 177 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 178 | ${resp}= OpenBMC Get Request ${elog_entry[1]} |
| 179 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 180 | |
George Keishing | aa09350 | 2019-07-24 23:32:37 -0500 | [diff] [blame] | 181 | |
Rahul Maheshwari | 43be693 | 2017-05-01 02:37:06 -0500 | [diff] [blame] | 182 | Create Test Error Callout And Verify LED |
| 183 | [Documentation] Create an error log callout and verify respective |
| 184 | ... LED state. |
| 185 | [Tags] Create_Test_Error_Callout_And_Verify_LED |
| 186 | |
| 187 | Create Test Error With Callout |
| 188 | |
| 189 | ${resp}= Get LED State XYZ cpu0_fault |
| 190 | Should Be Equal ${resp} ${1} |
| 191 | |
George Keishing | aa09350 | 2019-07-24 23:32:37 -0500 | [diff] [blame] | 192 | |
Sweta Potthuri | ab73f9a | 2017-07-07 05:33:42 -0500 | [diff] [blame] | 193 | Set Resolved Field And Verify Callout Deletion |
| 194 | [Documentation] Set the "Resolved" error log and verify callout is deleted |
| 195 | [Tags] Set_Resolved_Field_And_Verify_Callout_Deletion |
| 196 | |
George Keishing | cc71c3c | 2017-09-20 09:38:03 -0500 | [diff] [blame] | 197 | Delete All Error Logs |
Sweta Potthuri | ab73f9a | 2017-07-07 05:33:42 -0500 | [diff] [blame] | 198 | Create Test Error With Callout |
| 199 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 200 | ${resp}= OpenBMC Get Request ${elog_entry[0]} |
George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 201 | Should Contain ${resp.json()["data"]["Associations"][0]} callout |
Sweta Potthuri | ab73f9a | 2017-07-07 05:33:42 -0500 | [diff] [blame] | 202 | |
| 203 | # Set the error log field "Resolved". |
| 204 | # By doing so, the callout object should get deleted automatically. |
| 205 | ${valueDict}= Create Dictionary data=${1} |
| 206 | OpenBMC Put Request ${elog_entry[0]}/attr/Resolved data=${valueDict} |
| 207 | |
| 208 | # Verify if the callout entry is deleted. |
| 209 | ${resp}= OpenBMC Get Request ${elog_entry[0]}/callout |
| 210 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
Rahul Maheshwari | 43be693 | 2017-05-01 02:37:06 -0500 | [diff] [blame] | 211 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 212 | *** Keywords *** |
| 213 | |
George Keishing | 95c371a | 2017-09-14 15:42:33 -0500 | [diff] [blame] | 214 | Callout Test Binary Exist |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 215 | [Documentation] Verify existence of prerequisite callout-test. |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 216 | |
George Keishing | d434c51 | 2016-10-07 06:46:29 -0500 | [diff] [blame] | 217 | Open Connection And Log In |
George Keishing | 95c371a | 2017-09-14 15:42:33 -0500 | [diff] [blame] | 218 | ${out} ${stderr}= Execute Command |
| 219 | ... which /tmp/tarball/bin/callout-test return_stderr=True |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 220 | Should Be Empty ${stderr} |
| 221 | Should Contain ${out} callout-test |
| 222 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 223 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 224 | Create Test Error With Callout |
| 225 | [Documentation] Generate test error log with callout for CPU0. |
| 226 | |
| 227 | # Test error log entry example: |
| 228 | # "/xyz/openbmc_project/logging/entry/4": { |
| 229 | # "AdditionalData": [ |
| 230 | # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00", |
| 231 | # "CALLOUT_ERRNO_TEST=0", |
| 232 | # "DEV_ADDR=0x0DEADEAD" |
| 233 | # ], |
| 234 | # "Id": 4, |
| 235 | # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout", |
| 236 | # "Resolved": 0, |
| 237 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 238 | # "Timestamp": 1487747332528, |
George Keishing | 58520d0 | 2020-02-24 10:55:32 -0600 | [diff] [blame] | 239 | # "Associations": [ |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 240 | # [ |
| 241 | # "callout", |
| 242 | # "fault", |
| 243 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 244 | # ] |
| 245 | # ] |
| 246 | # }, |
| 247 | # "/xyz/openbmc_project/logging/entry/4/callout": { |
| 248 | # "endpoints": [ |
| 249 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 250 | # ] |
| 251 | # }, |
| 252 | |
Joy Onyerikwu | 2ef965a | 2018-05-24 15:23:27 -0500 | [diff] [blame] | 253 | BMC Execute Command |
George Keishing | 95c371a | 2017-09-14 15:42:33 -0500 | [diff] [blame] | 254 | ... /tmp/tarball/bin/callout-test ${target_device_path} |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 255 | |
| 256 | Verify Test Error Log And Callout |
| 257 | [Documentation] Verify test error log entries. |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 258 | ${elog_entry}= Get Elog URL List |
| 259 | ${resp}= OpenBMC Get Request ${elog_entry[0]} |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 260 | |
George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 261 | Should Be Equal ${resp.json()["data"]["Message"]} |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 262 | ... example.xyz.openbmc_project.Example.Elog.TestCallout |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 263 | |
George Keishing | fbd6700 | 2022-08-01 11:24:03 -0500 | [diff] [blame] | 264 | Should Be Equal ${resp.json()["data"]["Severity"]} |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 265 | ... xyz.openbmc_project.Logging.Entry.Level.Error |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 266 | |
| 267 | ${content}= Read Attribute ${elog_entry[0]}/callout endpoints |
George Keishing | aa09350 | 2019-07-24 23:32:37 -0500 | [diff] [blame] | 268 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 269 | Should Be Equal ${content[0]} |
| 270 | ... /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0 |
| 271 | |
George Keishing | 95c371a | 2017-09-14 15:42:33 -0500 | [diff] [blame] | 272 | |
| 273 | Test Setup Execution |
Sweta Potthuri | 04c68d7 | 2017-07-19 06:06:50 -0500 | [diff] [blame] | 274 | [Documentation] Do test case setup tasks. |
George Keishing | 95c371a | 2017-09-14 15:42:33 -0500 | [diff] [blame] | 275 | |
Sweta Potthuri | 04c68d7 | 2017-07-19 06:06:50 -0500 | [diff] [blame] | 276 | ${status}= Run Keyword And Return Status Callout Test Binary Exist |
| 277 | Run Keyword If ${status} == ${False} Install Tarball |
| 278 | Delete All Error Logs |
George Keishing | 95c371a | 2017-09-14 15:42:33 -0500 | [diff] [blame] | 279 | |
| 280 | |
| 281 | Install Tarball |
| 282 | [Documentation] Install tarball on BMC. |
| 283 | |
| 284 | Run Keyword If '${DEBUG_TARBALL_PATH}' == '${EMPTY}' Return from Keyword |
| 285 | BMC Execute Command rm -rf /tmp/tarball |
| 286 | Install Debug Tarball On BMC ${DEBUG_TARBALL_PATH} |
George Keishing | aa09350 | 2019-07-24 23:32:37 -0500 | [diff] [blame] | 287 | |
| 288 | |
| 289 | Suite Setup Execution |
| 290 | [Documentation] Do test case setup tasks. |
| 291 | |
| 292 | Redfish.Login |
| 293 | |
| 294 | Redfish Purge Event Log |
| 295 | |
| 296 | Redfish Power On stack_mode=skip quiet=1 |
| 297 | |
| 298 | ${status}= Run Keyword And Return Status Logging Test Binary Exist |
| 299 | Run Keyword If ${status} == ${False} Install Tarball |
| 300 | |
| 301 | |
| 302 | Suite Teardown Execution |
| 303 | [Documentation] Do the post suite teardown. |
| 304 | |
| 305 | Redfish.Logout |