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 |
| 12 | Test Setup Open Connection And Log In |
| 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 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 16 | *** Test Cases *** |
| 17 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 18 | Create Test Error Callout And Verify |
| 19 | [Documentation] Create error log callout and verify via REST. |
| 20 | [Tags] Create_Test_Error_Callout_And_Verify |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 21 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 22 | Create Test Error With Callout |
| 23 | Verify Test Error Log And Callout |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 24 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 25 | |
| 26 | *** Keywords *** |
| 27 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 28 | Verify callout-test |
| 29 | [Documentation] Verify existence of prerequisite callout-test. |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 30 | |
George Keishing | d434c51 | 2016-10-07 06:46:29 -0500 | [diff] [blame] | 31 | Open Connection And Log In |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 32 | ${out} ${stderr}= Execute Command which callout-test return_stderr=True |
| 33 | Should Be Empty ${stderr} |
| 34 | Should Contain ${out} callout-test |
| 35 | |
| 36 | Clear Existing Error Logs |
| 37 | [Documentation] If error log isn't empty, restart the logging service on |
| 38 | ... the BMC |
| 39 | |
| 40 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1} |
| 41 | Return From Keyword If ${resp.status_code} == ${HTTP_NOT_FOUND} |
| 42 | Execute Command On BMC |
| 43 | ... systemctl restart xyz.openbmc_project.Logging.service |
| 44 | Sleep 10s reason=Wait for logging service to restart properly. |
| 45 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1} |
| 46 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 47 | |
| 48 | |
| 49 | Create Test Error With Callout |
| 50 | [Documentation] Generate test error log with callout for CPU0. |
| 51 | |
| 52 | # Test error log entry example: |
| 53 | # "/xyz/openbmc_project/logging/entry/4": { |
| 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": 4, |
| 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/4/callout": { |
| 73 | # "endpoints": [ |
| 74 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 75 | # ] |
| 76 | # }, |
| 77 | |
| 78 | Execute Command On BMC |
| 79 | ... callout-test /sys/devices/platform/fsi-master/slave@00:00 |
| 80 | |
| 81 | Verify Test Error Log And Callout |
| 82 | [Documentation] Verify test error log entries. |
| 83 | ${content}= Read Attribute ${BMC_LOGGING_ENTRY}${1} Message |
| 84 | Should Be Equal ${content} |
| 85 | ... example.xyz.openbmc_project.Example.Elog.TestCallout |
| 86 | ${content}= Read Attribute ${BMC_LOGGING_ENTRY}${1} Severity |
| 87 | Should Be Equal ${content} |
| 88 | ... xyz.openbmc_project.Logging.Entry.Level.Error |
| 89 | ${content}= Read Attribute ${BMC_LOGGING_ENTRY}${1}/callout endpoints |
| 90 | Should Be Equal ${content[0]} |
| 91 | ... /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0 |
| 92 | |
| 93 | Boot Host |
| 94 | [Documentation] Boot the host if current state is "Off". |
| 95 | ${current_state}= Get Host State |
| 96 | Run Keyword If '${current_state}' == 'Off' |
| 97 | ... Initiate Host Boot |
| 98 | |
| 99 | Wait Until Keyword Succeeds |
| 100 | ... 10 min 10 sec Is OS Starting |