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