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*** |
| 17 | ${target_device_path} /sys/devices/platform/fsi-master/slave@00:00 |
| 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 | |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 49 | Create Test Error Callout And Delete |
| 50 | [Documentation] Create Test Error Callout And Delete. |
| 51 | [Tags] Create_Test_Error_Callout_And_Delete |
| 52 | |
| 53 | # Test error log entry example: |
| 54 | # "/xyz/openbmc_project/logging/entry/1": { |
| 55 | # "AdditionalData": [ |
| 56 | # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00", |
| 57 | # "CALLOUT_ERRNO_TEST=0", |
| 58 | # "DEV_ADDR=0x0DEADEAD" |
| 59 | # ], |
| 60 | # "Id": 1, |
| 61 | # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout", |
| 62 | # "Resolved": 0, |
| 63 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 64 | # "Timestamp": 1487747332528, |
| 65 | # "associations": [ |
| 66 | # [ |
| 67 | # "callout", |
| 68 | # "fault", |
| 69 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 70 | # ] |
| 71 | # ] |
| 72 | # }, |
| 73 | # "/xyz/openbmc_project/logging/entry/1/callout": { |
| 74 | # "endpoints": [ |
| 75 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 76 | # ] |
| 77 | # }, |
| 78 | |
| 79 | Create Test Error With Callout |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 80 | ${elog_entry}= Get Elog URL List |
| 81 | Delete Error Log Entry ${elog_entry[0]} |
| 82 | ${resp}= OpenBMC Get Request ${elog_entry[0]}/callout |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 83 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 84 | |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 85 | |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 86 | Create Two Test Error Callout And Delete |
| 87 | [Documentation] Create Two Test Error Callout And Delete. |
| 88 | [Tags] Create_Two_Test_Error_Callout_And_Delete |
| 89 | |
| 90 | # Test error log entry example: |
| 91 | # "/xyz/openbmc_project/logging/entry/1": { |
| 92 | # "AdditionalData": [ |
| 93 | # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00", |
| 94 | # "CALLOUT_ERRNO_TEST=0", |
| 95 | # "DEV_ADDR=0x0DEADEAD" |
| 96 | # ], |
| 97 | # "Id": 1, |
| 98 | # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout", |
| 99 | # "Resolved": 0, |
| 100 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 101 | # "Timestamp": 1487747332528, |
| 102 | # "associations": [ |
| 103 | # [ |
| 104 | # "callout", |
| 105 | # "fault", |
| 106 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 107 | # ] |
| 108 | # ] |
| 109 | # }, |
| 110 | # "/xyz/openbmc_project/logging/entry/1/callout": { |
| 111 | # "endpoints": [ |
| 112 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 113 | # ] |
| 114 | # }, |
| 115 | # "/xyz/openbmc_project/logging/entry/2": { |
| 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": 2, |
| 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/2/callout": { |
| 135 | # "endpoints": [ |
| 136 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 137 | # ] |
| 138 | # }, |
| 139 | |
| 140 | # Create two error logs. |
| 141 | Create Test Error With Callout |
| 142 | Create Test Error With Callout |
| 143 | |
| 144 | # Delete entry/2 elog entry. |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 145 | ${elog_entry}= Get Elog URL List |
| 146 | Delete Error Log Entry ${elog_entry[1]} |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 147 | |
| 148 | # Verify if entry/1 exist and entry/2 is deleted. |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 149 | ${resp}= OpenBMC Get Request ${elog_entry[0]} |
| 150 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 151 | ${resp}= OpenBMC Get Request ${elog_entry[1]} |
| 152 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 153 | |
Rahul Maheshwari | 43be693 | 2017-05-01 02:37:06 -0500 | [diff] [blame] | 154 | Create Test Error Callout And Verify LED |
| 155 | [Documentation] Create an error log callout and verify respective |
| 156 | ... LED state. |
| 157 | [Tags] Create_Test_Error_Callout_And_Verify_LED |
| 158 | |
| 159 | Create Test Error With Callout |
| 160 | |
| 161 | ${resp}= Get LED State XYZ cpu0_fault |
| 162 | Should Be Equal ${resp} ${1} |
| 163 | |
Sweta Potthuri | ab73f9a | 2017-07-07 05:33:42 -0500 | [diff] [blame] | 164 | Set Resolved Field And Verify Callout Deletion |
| 165 | [Documentation] Set the "Resolved" error log and verify callout is deleted |
| 166 | [Tags] Set_Resolved_Field_And_Verify_Callout_Deletion |
| 167 | |
| 168 | Delete Error logs |
| 169 | Create Test Error With Callout |
| 170 | ${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY} |
| 171 | ${resp}= OpenBMC Get Request ${elog_entry[0]} |
| 172 | ${jsondata}= To JSON ${resp.content} |
| 173 | Should Contain ${jsondata}["data"]["AdditionalData"] callout |
| 174 | |
| 175 | # Set the error log field "Resolved". |
| 176 | # By doing so, the callout object should get deleted automatically. |
| 177 | ${valueDict}= Create Dictionary data=${1} |
| 178 | OpenBMC Put Request ${elog_entry[0]}/attr/Resolved data=${valueDict} |
| 179 | |
| 180 | # Verify if the callout entry is deleted. |
| 181 | ${resp}= OpenBMC Get Request ${elog_entry[0]}/callout |
| 182 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
Rahul Maheshwari | 43be693 | 2017-05-01 02:37:06 -0500 | [diff] [blame] | 183 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 184 | *** Keywords *** |
| 185 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 186 | Verify callout-test |
| 187 | [Documentation] Verify existence of prerequisite callout-test. |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 188 | |
George Keishing | d434c51 | 2016-10-07 06:46:29 -0500 | [diff] [blame] | 189 | Open Connection And Log In |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 190 | ${out} ${stderr}= Execute Command which callout-test return_stderr=True |
| 191 | Should Be Empty ${stderr} |
| 192 | Should Contain ${out} callout-test |
| 193 | |
| 194 | Clear Existing Error Logs |
| 195 | [Documentation] If error log isn't empty, restart the logging service on |
| 196 | ... the BMC |
| 197 | |
Rahul Maheshwari | 43be693 | 2017-05-01 02:37:06 -0500 | [diff] [blame] | 198 | Open Connection And Log In |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 199 | Delete Error Logs |
| 200 | ${resp}= OpenBMC Get Request /xyz/openbmc_project/logging/entry/ |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 201 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 202 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 203 | Create Test Error With Callout |
| 204 | [Documentation] Generate test error log with callout for CPU0. |
| 205 | |
| 206 | # Test error log entry example: |
| 207 | # "/xyz/openbmc_project/logging/entry/4": { |
| 208 | # "AdditionalData": [ |
| 209 | # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00", |
| 210 | # "CALLOUT_ERRNO_TEST=0", |
| 211 | # "DEV_ADDR=0x0DEADEAD" |
| 212 | # ], |
| 213 | # "Id": 4, |
| 214 | # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout", |
| 215 | # "Resolved": 0, |
| 216 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 217 | # "Timestamp": 1487747332528, |
| 218 | # "associations": [ |
| 219 | # [ |
| 220 | # "callout", |
| 221 | # "fault", |
| 222 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 223 | # ] |
| 224 | # ] |
| 225 | # }, |
| 226 | # "/xyz/openbmc_project/logging/entry/4/callout": { |
| 227 | # "endpoints": [ |
| 228 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 229 | # ] |
| 230 | # }, |
| 231 | |
| 232 | Execute Command On BMC |
| 233 | ... callout-test /sys/devices/platform/fsi-master/slave@00:00 |
| 234 | |
| 235 | Verify Test Error Log And Callout |
| 236 | [Documentation] Verify test error log entries. |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 237 | ${elog_entry}= Get Elog URL List |
| 238 | ${resp}= OpenBMC Get Request ${elog_entry[0]} |
| 239 | ${json}= To JSON ${resp.content} |
| 240 | |
| 241 | Should Be Equal ${json["data"]["Message"]} |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 242 | ... example.xyz.openbmc_project.Example.Elog.TestCallout |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 243 | |
| 244 | Should Be Equal ${json["data"]["Severity"]} |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 245 | ... xyz.openbmc_project.Logging.Entry.Level.Error |
George Keishing | ad5817a | 2017-06-28 10:19:03 -0500 | [diff] [blame] | 246 | |
| 247 | ${content}= Read Attribute ${elog_entry[0]}/callout endpoints |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 248 | Should Be Equal ${content[0]} |
| 249 | ... /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0 |
| 250 | |
| 251 | Boot Host |
| 252 | [Documentation] Boot the host if current state is "Off". |
| 253 | ${current_state}= Get Host State |
| 254 | Run Keyword If '${current_state}' == 'Off' |
| 255 | ... Initiate Host Boot |
| 256 | |
| 257 | Wait Until Keyword Succeeds |
| 258 | ... 10 min 10 sec Is OS Starting |