blob: 52b7011ec83661a5f4166105417cfa33039aaa81 [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
George Keishingf58c4862017-03-28 13:01:03 -05002Documentation Test Error callout association.
Chris Austenb29d2e82016-06-07 12:25:35 -05003
George Keishingf58c4862017-03-28 13:01:03 -05004Resource ../lib/connection_client.robot
5Resource ../lib/openbmc_ffdc.robot
6Resource ../lib/utils.robot
7Resource ../lib/state_manager.robot
Chris Austenb29d2e82016-06-07 12:25:35 -05008
George Keishingf58c4862017-03-28 13:01:03 -05009Suite Setup Run Keywords Verify callout-test AND
10... Boot Host AND
11... Clear Existing Error Logs
Rahul Maheshwari43be6932017-05-01 02:37:06 -050012Test Setup Pre Test Case Execution
George Keishingf58c4862017-03-28 13:01:03 -050013Test Teardown Close All Connections
14Suite Teardown Clear Existing Error Logs
George Keishingd434c512016-10-07 06:46:29 -050015
Chris Austenb29d2e82016-06-07 12:25:35 -050016*** Test Cases ***
17
George Keishingf58c4862017-03-28 13:01:03 -050018Create Test Error Callout And Verify
19 [Documentation] Create error log callout and verify via REST.
20 [Tags] Create_Test_Error_Callout_And_Verify
Chris Austenb29d2e82016-06-07 12:25:35 -050021
George Keishingf58c4862017-03-28 13:01:03 -050022 Create Test Error With Callout
23 Verify Test Error Log And Callout
Chris Austenb29d2e82016-06-07 12:25:35 -050024
Chris Austenb29d2e82016-06-07 12:25:35 -050025
Rahul Maheshwari43be6932017-05-01 02:37:06 -050026Create 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 Austenb29d2e82016-06-07 12:25:35 -050037*** Keywords ***
38
Rahul Maheshwari43be6932017-05-01 02:37:06 -050039Pre Test Case Execution
40 [Documentation] Do the initial test setup.
41
42 Open Connection And Log In
43 Delete Error logs
44
George Keishingf58c4862017-03-28 13:01:03 -050045Verify callout-test
46 [Documentation] Verify existence of prerequisite callout-test.
Chris Austenb29d2e82016-06-07 12:25:35 -050047
George Keishingd434c512016-10-07 06:46:29 -050048 Open Connection And Log In
George Keishingf58c4862017-03-28 13:01:03 -050049 ${out} ${stderr}= Execute Command which callout-test return_stderr=True
50 Should Be Empty ${stderr}
51 Should Contain ${out} callout-test
52
53Clear Existing Error Logs
54 [Documentation] If error log isn't empty, restart the logging service on
55 ... the BMC
56
Rahul Maheshwari43be6932017-05-01 02:37:06 -050057 Open Connection And Log In
George Keishingf58c4862017-03-28 13:01:03 -050058 ${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 Keishingf58c4862017-03-28 13:01:03 -050066Create 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
98Verify 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
110Boot 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