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 | |
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 | |
Rahul Maheshwari | 43be693 | 2017-05-01 02:37:06 -0500 | [diff] [blame] | 26 | Create Test Error Callout And Verify LED |
| 27 | [Documentation] Create an error log callout and verify respective |
| 28 | ... LED state. |
| 29 | [Tags] Create_Test_Error_Callout_And_Verify_LED |
| 30 | |
| 31 | Create Test Error With Callout |
| 32 | |
| 33 | ${resp}= Get LED State XYZ cpu0_fault |
| 34 | Should Be Equal ${resp} ${1} |
| 35 | |
| 36 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 37 | *** Keywords *** |
| 38 | |
Rahul Maheshwari | 43be693 | 2017-05-01 02:37:06 -0500 | [diff] [blame] | 39 | Pre Test Case Execution |
| 40 | [Documentation] Do the initial test setup. |
| 41 | |
| 42 | Open Connection And Log In |
| 43 | Delete Error logs |
| 44 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 45 | Verify callout-test |
| 46 | [Documentation] Verify existence of prerequisite callout-test. |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 47 | |
George Keishing | d434c51 | 2016-10-07 06:46:29 -0500 | [diff] [blame] | 48 | Open Connection And Log In |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 49 | ${out} ${stderr}= Execute Command which callout-test return_stderr=True |
| 50 | Should Be Empty ${stderr} |
| 51 | Should Contain ${out} callout-test |
| 52 | |
| 53 | Clear Existing Error Logs |
| 54 | [Documentation] If error log isn't empty, restart the logging service on |
| 55 | ... the BMC |
| 56 | |
Rahul Maheshwari | 43be693 | 2017-05-01 02:37:06 -0500 | [diff] [blame] | 57 | Open Connection And Log In |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 58 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1} |
| 59 | Return From Keyword If ${resp.status_code} == ${HTTP_NOT_FOUND} |
| 60 | Execute Command On BMC |
| 61 | ... systemctl restart xyz.openbmc_project.Logging.service |
| 62 | Sleep 10s reason=Wait for logging service to restart properly. |
| 63 | ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1} |
| 64 | Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND} |
| 65 | |
George Keishing | f58c486 | 2017-03-28 13:01:03 -0500 | [diff] [blame] | 66 | Create Test Error With Callout |
| 67 | [Documentation] Generate test error log with callout for CPU0. |
| 68 | |
| 69 | # Test error log entry example: |
| 70 | # "/xyz/openbmc_project/logging/entry/4": { |
| 71 | # "AdditionalData": [ |
| 72 | # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00", |
| 73 | # "CALLOUT_ERRNO_TEST=0", |
| 74 | # "DEV_ADDR=0x0DEADEAD" |
| 75 | # ], |
| 76 | # "Id": 4, |
| 77 | # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout", |
| 78 | # "Resolved": 0, |
| 79 | # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error", |
| 80 | # "Timestamp": 1487747332528, |
| 81 | # "associations": [ |
| 82 | # [ |
| 83 | # "callout", |
| 84 | # "fault", |
| 85 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 86 | # ] |
| 87 | # ] |
| 88 | # }, |
| 89 | # "/xyz/openbmc_project/logging/entry/4/callout": { |
| 90 | # "endpoints": [ |
| 91 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0" |
| 92 | # ] |
| 93 | # }, |
| 94 | |
| 95 | Execute Command On BMC |
| 96 | ... callout-test /sys/devices/platform/fsi-master/slave@00:00 |
| 97 | |
| 98 | Verify Test Error Log And Callout |
| 99 | [Documentation] Verify test error log entries. |
| 100 | ${content}= Read Attribute ${BMC_LOGGING_ENTRY}${1} Message |
| 101 | Should Be Equal ${content} |
| 102 | ... example.xyz.openbmc_project.Example.Elog.TestCallout |
| 103 | ${content}= Read Attribute ${BMC_LOGGING_ENTRY}${1} Severity |
| 104 | Should Be Equal ${content} |
| 105 | ... xyz.openbmc_project.Logging.Entry.Level.Error |
| 106 | ${content}= Read Attribute ${BMC_LOGGING_ENTRY}${1}/callout endpoints |
| 107 | Should Be Equal ${content[0]} |
| 108 | ... /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0 |
| 109 | |
| 110 | Boot Host |
| 111 | [Documentation] Boot the host if current state is "Off". |
| 112 | ${current_state}= Get Host State |
| 113 | Run Keyword If '${current_state}' == 'Off' |
| 114 | ... Initiate Host Boot |
| 115 | |
| 116 | Wait Until Keyword Succeeds |
| 117 | ... 10 min 10 sec Is OS Starting |