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