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 |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 8 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 9 | Suite Setup Run Keywords Verify callout-test AND |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 10 | ... Boot Host |
| 11 | Test Setup Clear Existing Error Logs |
| 12 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 13 | Test Teardown Close All Connections |
| 14 | Suite Teardown Clear Existing Error Logs |
George Keishing | d434c51 | 2016-10-07 06:46:29 -0500 | [diff] [blame] | 15 | |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 16 | ***Variables*** |
George Keishing | f2fe745 | 2017-08-24 09:40:46 -0500 | [diff] [blame] | 17 | ${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] | 18 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 19 | *** Test Cases *** |
| 20 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 21 | Create Test Error Callout And Verify |
| 22 | [Documentation] Create error log callout and verify via REST. |
| 23 | [Tags] Create_Test_Error_Callout_And_Verify |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 24 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 25 | Create Test Error With Callout |
| 26 | Verify Test Error Log And Callout |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 27 | |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 28 | |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 29 | Create Test Error Callout And Verify AdditionalData |
| 30 | [Documentation] Create Test Error Callout And Verify AdditionalData. |
| 31 | [Tags] Create_Test_Error_Callout_And_Verify_AdditionalData |
| 32 | |
| 33 | # Test error log entry example: |
| 34 | # "/xyz/openbmc_project/logging/entry/1": { |
| 35 | # "AdditionalData": [ |
| 36 | # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00", |
| 37 | # "CALLOUT_ERRNO_TEST=0", |
| 38 | # "DEV_ADDR=0x0DEADEAD" |
| 39 | # ] |
| 40 | |
| 41 | Create Test Error With Callout |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 42 | ${elog_entry}= Get Elog URL List |
| 43 | ${resp}= OpenBMC Get Request ${elog_entry[0]} |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 44 | ${jsondata}= To JSON ${resp.content} |
| 45 | Should Contain ${jsondata}["data"]["AdditionalData"]} ${target_device_path} |
| 46 | Should Contain ${jsondata}["data"]["AdditionalData"]} 0x0DEADEAD |
| 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} |
| 66 | List Should Contain Value ${jsondata}["data"]["associations"]} callout |
| 67 | List Should Contain Value ${jsondata}["data"]["associations"]} fault |
| 68 | List Should Contain Value |
| 69 | ... ${jsondata}["data"]["associations"]} |
| 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 | |
| 192 | Delete Error logs |
| 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} |
| 197 | Should Contain ${jsondata}["data"]["AdditionalData"] callout |
| 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 | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 210 | Verify callout-test |
| 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 | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 214 | ${out} ${stderr}= Execute Command which callout-test return_stderr=True |
| 215 | Should Be Empty ${stderr} |
| 216 | Should Contain ${out} callout-test |
| 217 | |
| 218 | Clear Existing Error Logs |
| 219 | [Documentation] If error log isn't empty, restart the logging service on |
| 220 | ... the BMC |
| 221 | |
Rahul Maheshwari | 43be693 | 2017-05-01 02:37:06 -0500 | [diff] [blame] | 222 | Open Connection And Log In |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 223 | Delete Error Logs |
| 224 | ${resp}= OpenBMC Get Request /xyz/openbmc_project/logging/entry/ |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 225 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 226 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 227 | Create Test Error With Callout |
| 228 | [Documentation] Generate test error log with callout for CPU0. |
| 229 | |
| 230 | # Test error log entry example: |
| 231 | # "/xyz/openbmc_project/logging/entry/4": { |
| 232 | # "AdditionalData": [ |
| 233 | # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00", |
| 234 | # "CALLOUT_ERRNO_TEST=0", |
| 235 | # "DEV_ADDR=0x0DEADEAD" |
| 236 | # ], |
| 237 | # "Id": 4, |
| 238 | # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout", |
| 239 | # "Resolved": 0, |
| 240 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 241 | # "Timestamp": 1487747332528, |
| 242 | # "associations": [ |
| 243 | # [ |
| 244 | # "callout", |
| 245 | # "fault", |
| 246 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 247 | # ] |
| 248 | # ] |
| 249 | # }, |
| 250 | # "/xyz/openbmc_project/logging/entry/4/callout": { |
| 251 | # "endpoints": [ |
| 252 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 253 | # ] |
| 254 | # }, |
| 255 | |
| 256 | Execute Command On BMC |
George Keishing | f2fe745 | 2017-08-24 09:40:46 -0500 | [diff] [blame] | 257 | ... callout-test ${target_device_path} |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 258 | |
| 259 | Verify Test Error Log And Callout |
| 260 | [Documentation] Verify test error log entries. |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 261 | ${elog_entry}= Get Elog URL List |
| 262 | ${resp}= OpenBMC Get Request ${elog_entry[0]} |
| 263 | ${json}= To JSON ${resp.content} |
| 264 | |
| 265 | Should Be Equal ${json["data"]["Message"]} |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 266 | ... example.xyz.openbmc_project.Example.Elog.TestCallout |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 267 | |
| 268 | Should Be Equal ${json["data"]["Severity"]} |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 269 | ... xyz.openbmc_project.Logging.Entry.Level.Error |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 270 | |
| 271 | ${content}= Read Attribute ${elog_entry[0]}/callout endpoints |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 272 | Should Be Equal ${content[0]} |
| 273 | ... /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0 |
| 274 | |
| 275 | Boot Host |
| 276 | [Documentation] Boot the host if current state is "Off". |
| 277 | ${current_state}= Get Host State |
| 278 | Run Keyword If '${current_state}' == 'Off' |
| 279 | ... Initiate Host Boot |