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