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 |
| 10 | ... Boot Host AND |
| 11 | ... Clear Existing Error Logs |
Rahul Maheshwari | 43be693 | 2017-05-01 02:37:06 -0500 | [diff] [blame] | 12 | Test Setup Pre Test Case Execution |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 13 | Test Setup Open Connection And Log In AND |
| 14 | ... Delete Error logs |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 15 | Test Teardown Close All Connections |
| 16 | Suite Teardown Clear Existing Error Logs |
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*** |
| 19 | ${target_device_path} /sys/devices/platform/fsi-master/slave@00:00 |
| 20 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 21 | *** Test Cases *** |
| 22 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 23 | Create Test Error Callout And Verify |
| 24 | [Documentation] Create error log callout and verify via REST. |
| 25 | [Tags] Create_Test_Error_Callout_And_Verify |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 26 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 27 | Create Test Error With Callout |
| 28 | Verify Test Error Log And Callout |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 29 | |
Sweta Potthuri | e27b439 | 2017-05-11 07:27:04 -0500 | [diff] [blame] | 30 | Create Test Error Callout And Verify AdditionalData |
| 31 | [Documentation] Create Test Error Callout And Verify AdditionalData. |
| 32 | [Tags] Create_Test_Error_Callout_And_Verify_AdditionalData |
| 33 | |
| 34 | # Test error log entry example: |
| 35 | # "/xyz/openbmc_project/logging/entry/1": { |
| 36 | # "AdditionalData": [ |
| 37 | # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00", |
| 38 | # "CALLOUT_ERRNO_TEST=0", |
| 39 | # "DEV_ADDR=0x0DEADEAD" |
| 40 | # ] |
| 41 | |
| 42 | Create Test Error With Callout |
| 43 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1} |
| 44 | ${jsondata}= To JSON ${resp.content} |
| 45 | Should Contain ${jsondata}["data"]["AdditionalData"]} ${target_device_path} |
| 46 | Should Contain ${jsondata}["data"]["AdditionalData"]} 0x0DEADEAD |
| 47 | |
| 48 | Create Test Error Callout And Delete |
| 49 | [Documentation] Create Test Error Callout And Delete. |
| 50 | [Tags] Create_Test_Error_Callout_And_Delete |
| 51 | |
| 52 | # Test error log entry example: |
| 53 | # "/xyz/openbmc_project/logging/entry/1": { |
| 54 | # "AdditionalData": [ |
| 55 | # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00", |
| 56 | # "CALLOUT_ERRNO_TEST=0", |
| 57 | # "DEV_ADDR=0x0DEADEAD" |
| 58 | # ], |
| 59 | # "Id": 1, |
| 60 | # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout", |
| 61 | # "Resolved": 0, |
| 62 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 63 | # "Timestamp": 1487747332528, |
| 64 | # "associations": [ |
| 65 | # [ |
| 66 | # "callout", |
| 67 | # "fault", |
| 68 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 69 | # ] |
| 70 | # ] |
| 71 | # }, |
| 72 | # "/xyz/openbmc_project/logging/entry/1/callout": { |
| 73 | # "endpoints": [ |
| 74 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 75 | # ] |
| 76 | # }, |
| 77 | |
| 78 | Create Test Error With Callout |
| 79 | Delete Error Log Entry ${BMC_LOGGING_ENTRY}${1} |
| 80 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1}/callout |
| 81 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 82 | |
| 83 | Create Two Test Error Callout And Delete |
| 84 | [Documentation] Create Two Test Error Callout And Delete. |
| 85 | [Tags] Create_Two_Test_Error_Callout_And_Delete |
| 86 | |
| 87 | # Test error log entry example: |
| 88 | # "/xyz/openbmc_project/logging/entry/1": { |
| 89 | # "AdditionalData": [ |
| 90 | # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00", |
| 91 | # "CALLOUT_ERRNO_TEST=0", |
| 92 | # "DEV_ADDR=0x0DEADEAD" |
| 93 | # ], |
| 94 | # "Id": 1, |
| 95 | # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout", |
| 96 | # "Resolved": 0, |
| 97 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 98 | # "Timestamp": 1487747332528, |
| 99 | # "associations": [ |
| 100 | # [ |
| 101 | # "callout", |
| 102 | # "fault", |
| 103 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 104 | # ] |
| 105 | # ] |
| 106 | # }, |
| 107 | # "/xyz/openbmc_project/logging/entry/1/callout": { |
| 108 | # "endpoints": [ |
| 109 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 110 | # ] |
| 111 | # }, |
| 112 | # "/xyz/openbmc_project/logging/entry/2": { |
| 113 | # "AdditionalData": [ |
| 114 | # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00", |
| 115 | # "CALLOUT_ERRNO_TEST=0", |
| 116 | # "DEV_ADDR=0x0DEADEAD" |
| 117 | # ], |
| 118 | # "Id": 2, |
| 119 | # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout", |
| 120 | # "Resolved": 0, |
| 121 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 122 | # "Timestamp": 1487747332528, |
| 123 | # "associations": [ |
| 124 | # [ |
| 125 | # "callout", |
| 126 | # "fault", |
| 127 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 128 | # ] |
| 129 | # ] |
| 130 | # }, |
| 131 | # "/xyz/openbmc_project/logging/entry/2/callout": { |
| 132 | # "endpoints": [ |
| 133 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 134 | # ] |
| 135 | # }, |
| 136 | |
| 137 | # Create two error logs. |
| 138 | Create Test Error With Callout |
| 139 | Create Test Error With Callout |
| 140 | |
| 141 | # Delete entry/2 elog entry. |
| 142 | Delete Error Log Entry ${BMC_LOGGING_ENTRY}${2} |
| 143 | |
| 144 | # Verify if entry/1 exist and entry/2 is deleted. |
| 145 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}/list |
| 146 | ${jsondata}= To JSON ${resp.content} |
| 147 | Should Contain ${jsondata["data"]} ${BMC_LOGGING_ENTRY}${1} |
| 148 | Should Not Contain ${jsondata["data"]} ${BMC_LOGGING_ENTRY}${2} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 149 | |
Rahul Maheshwari | 43be693 | 2017-05-01 02:37:06 -0500 | [diff] [blame] | 150 | Create Test Error Callout And Verify LED |
| 151 | [Documentation] Create an error log callout and verify respective |
| 152 | ... LED state. |
| 153 | [Tags] Create_Test_Error_Callout_And_Verify_LED |
| 154 | |
| 155 | Create Test Error With Callout |
| 156 | |
| 157 | ${resp}= Get LED State XYZ cpu0_fault |
| 158 | Should Be Equal ${resp} ${1} |
| 159 | |
| 160 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 161 | *** Keywords *** |
| 162 | |
Rahul Maheshwari | 43be693 | 2017-05-01 02:37:06 -0500 | [diff] [blame] | 163 | Pre Test Case Execution |
| 164 | [Documentation] Do the initial test setup. |
| 165 | |
| 166 | Open Connection And Log In |
| 167 | Delete Error logs |
| 168 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 169 | Verify callout-test |
| 170 | [Documentation] Verify existence of prerequisite callout-test. |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 171 | |
George Keishing | d434c51 | 2016-10-07 06:46:29 -0500 | [diff] [blame] | 172 | Open Connection And Log In |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 173 | ${out} ${stderr}= Execute Command which callout-test return_stderr=True |
| 174 | Should Be Empty ${stderr} |
| 175 | Should Contain ${out} callout-test |
| 176 | |
| 177 | Clear Existing Error Logs |
| 178 | [Documentation] If error log isn't empty, restart the logging service on |
| 179 | ... the BMC |
| 180 | |
Rahul Maheshwari | 43be693 | 2017-05-01 02:37:06 -0500 | [diff] [blame] | 181 | Open Connection And Log In |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 182 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1} |
| 183 | Return From Keyword If ${resp.status_code} == ${HTTP_NOT_FOUND} |
| 184 | Execute Command On BMC |
| 185 | ... systemctl restart xyz.openbmc_project.Logging.service |
| 186 | Sleep 10s reason=Wait for logging service to restart properly. |
| 187 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1} |
| 188 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 189 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 190 | Create Test Error With Callout |
| 191 | [Documentation] Generate test error log with callout for CPU0. |
| 192 | |
| 193 | # Test error log entry example: |
| 194 | # "/xyz/openbmc_project/logging/entry/4": { |
| 195 | # "AdditionalData": [ |
| 196 | # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00", |
| 197 | # "CALLOUT_ERRNO_TEST=0", |
| 198 | # "DEV_ADDR=0x0DEADEAD" |
| 199 | # ], |
| 200 | # "Id": 4, |
| 201 | # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout", |
| 202 | # "Resolved": 0, |
| 203 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 204 | # "Timestamp": 1487747332528, |
| 205 | # "associations": [ |
| 206 | # [ |
| 207 | # "callout", |
| 208 | # "fault", |
| 209 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 210 | # ] |
| 211 | # ] |
| 212 | # }, |
| 213 | # "/xyz/openbmc_project/logging/entry/4/callout": { |
| 214 | # "endpoints": [ |
| 215 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 216 | # ] |
| 217 | # }, |
| 218 | |
| 219 | Execute Command On BMC |
| 220 | ... callout-test /sys/devices/platform/fsi-master/slave@00:00 |
| 221 | |
| 222 | Verify Test Error Log And Callout |
| 223 | [Documentation] Verify test error log entries. |
| 224 | ${content}= Read Attribute ${BMC_LOGGING_ENTRY}${1} Message |
| 225 | Should Be Equal ${content} |
| 226 | ... example.xyz.openbmc_project.Example.Elog.TestCallout |
| 227 | ${content}= Read Attribute ${BMC_LOGGING_ENTRY}${1} Severity |
| 228 | Should Be Equal ${content} |
| 229 | ... xyz.openbmc_project.Logging.Entry.Level.Error |
| 230 | ${content}= Read Attribute ${BMC_LOGGING_ENTRY}${1}/callout endpoints |
| 231 | Should Be Equal ${content[0]} |
| 232 | ... /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0 |
| 233 | |
| 234 | Boot Host |
| 235 | [Documentation] Boot the host if current state is "Off". |
| 236 | ${current_state}= Get Host State |
| 237 | Run Keyword If '${current_state}' == 'Off' |
| 238 | ... Initiate Host Boot |
| 239 | |
| 240 | Wait Until Keyword Succeeds |
| 241 | ... 10 min 10 sec Is OS Starting |