blob: 6a5e3ed8a744e636d9512ea1ed1a6ec962e8c76b [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
George Keishingad5817a2017-06-28 10:19:03 -050010... Boot Host
11Test Setup Clear Existing Error Logs
12
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
Sweta Potthurie27b4392017-05-11 07:27:04 -050016***Variables***
17${target_device_path} /sys/devices/platform/fsi-master/slave@00:00
18
Chris Austenb29d2e82016-06-07 12:25:35 -050019*** Test Cases ***
20
George Keishingf58c4862017-03-28 13:01:03 -050021Create Test Error Callout And Verify
22 [Documentation] Create error log callout and verify via REST.
23 [Tags] Create_Test_Error_Callout_And_Verify
Chris Austenb29d2e82016-06-07 12:25:35 -050024
George Keishingf58c4862017-03-28 13:01:03 -050025 Create Test Error With Callout
26 Verify Test Error Log And Callout
Chris Austenb29d2e82016-06-07 12:25:35 -050027
George Keishingad5817a2017-06-28 10:19:03 -050028
Sweta Potthurie27b4392017-05-11 07:27:04 -050029Create Test Error Callout And Verify AdditionalData
30 [Documentation] Create Test Error Callout And Verify AdditionalData.
31 [Tags] Create_Test_Error_Callout_And_Verify_AdditionalData
32
33 # Test error log entry example:
34 # "/xyz/openbmc_project/logging/entry/1": {
35 # "AdditionalData": [
36 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
37 # "CALLOUT_ERRNO_TEST=0",
38 # "DEV_ADDR=0x0DEADEAD"
39 # ]
40
41 Create Test Error With Callout
George Keishingad5817a2017-06-28 10:19:03 -050042 ${elog_entry}= Get Elog URL List
43 ${resp}= OpenBMC Get Request ${elog_entry[0]}
Sweta Potthurie27b4392017-05-11 07:27:04 -050044 ${jsondata}= To JSON ${resp.content}
45 Should Contain ${jsondata}["data"]["AdditionalData"]} ${target_device_path}
46 Should Contain ${jsondata}["data"]["AdditionalData"]} 0x0DEADEAD
47
George Keishingad5817a2017-06-28 10:19:03 -050048
Sweta Potthurie27b4392017-05-11 07:27:04 -050049Create Test Error Callout And Delete
50 [Documentation] Create Test Error Callout And Delete.
51 [Tags] Create_Test_Error_Callout_And_Delete
52
53 # Test error log entry example:
54 # "/xyz/openbmc_project/logging/entry/1": {
55 # "AdditionalData": [
56 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
57 # "CALLOUT_ERRNO_TEST=0",
58 # "DEV_ADDR=0x0DEADEAD"
59 # ],
60 # "Id": 1,
61 # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout",
62 # "Resolved": 0,
63 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
64 # "Timestamp": 1487747332528,
65 # "associations": [
66 # [
67 # "callout",
68 # "fault",
69 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
70 # ]
71 # ]
72 # },
73 # "/xyz/openbmc_project/logging/entry/1/callout": {
74 # "endpoints": [
75 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
76 # ]
77 # },
78
79 Create Test Error With Callout
George Keishingad5817a2017-06-28 10:19:03 -050080 ${elog_entry}= Get Elog URL List
81 Delete Error Log Entry ${elog_entry[0]}
82 ${resp}= OpenBMC Get Request ${elog_entry[0]}/callout
Sweta Potthurie27b4392017-05-11 07:27:04 -050083 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
84
George Keishingad5817a2017-06-28 10:19:03 -050085
Sweta Potthurie27b4392017-05-11 07:27:04 -050086Create Two Test Error Callout And Delete
87 [Documentation] Create Two Test Error Callout And Delete.
88 [Tags] Create_Two_Test_Error_Callout_And_Delete
89
90 # Test error log entry example:
91 # "/xyz/openbmc_project/logging/entry/1": {
92 # "AdditionalData": [
93 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
94 # "CALLOUT_ERRNO_TEST=0",
95 # "DEV_ADDR=0x0DEADEAD"
96 # ],
97 # "Id": 1,
98 # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout",
99 # "Resolved": 0,
100 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
101 # "Timestamp": 1487747332528,
102 # "associations": [
103 # [
104 # "callout",
105 # "fault",
106 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
107 # ]
108 # ]
109 # },
110 # "/xyz/openbmc_project/logging/entry/1/callout": {
111 # "endpoints": [
112 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
113 # ]
114 # },
115 # "/xyz/openbmc_project/logging/entry/2": {
116 # "AdditionalData": [
117 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
118 # "CALLOUT_ERRNO_TEST=0",
119 # "DEV_ADDR=0x0DEADEAD"
120 # ],
121 # "Id": 2,
122 # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout",
123 # "Resolved": 0,
124 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
125 # "Timestamp": 1487747332528,
126 # "associations": [
127 # [
128 # "callout",
129 # "fault",
130 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
131 # ]
132 # ]
133 # },
134 # "/xyz/openbmc_project/logging/entry/2/callout": {
135 # "endpoints": [
136 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
137 # ]
138 # },
139
140 # Create two error logs.
141 Create Test Error With Callout
142 Create Test Error With Callout
143
144 # Delete entry/2 elog entry.
George Keishingad5817a2017-06-28 10:19:03 -0500145 ${elog_entry}= Get Elog URL List
146 Delete Error Log Entry ${elog_entry[1]}
Sweta Potthurie27b4392017-05-11 07:27:04 -0500147
148 # Verify if entry/1 exist and entry/2 is deleted.
George Keishingad5817a2017-06-28 10:19:03 -0500149 ${resp}= OpenBMC Get Request ${elog_entry[0]}
150 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
151 ${resp}= OpenBMC Get Request ${elog_entry[1]}
152 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
Chris Austenb29d2e82016-06-07 12:25:35 -0500153
Rahul Maheshwari43be6932017-05-01 02:37:06 -0500154Create Test Error Callout And Verify LED
155 [Documentation] Create an error log callout and verify respective
156 ... LED state.
157 [Tags] Create_Test_Error_Callout_And_Verify_LED
158
159 Create Test Error With Callout
160
161 ${resp}= Get LED State XYZ cpu0_fault
162 Should Be Equal ${resp} ${1}
163
164
Chris Austenb29d2e82016-06-07 12:25:35 -0500165*** Keywords ***
166
George Keishingf58c4862017-03-28 13:01:03 -0500167Verify callout-test
168 [Documentation] Verify existence of prerequisite callout-test.
Chris Austenb29d2e82016-06-07 12:25:35 -0500169
George Keishingd434c512016-10-07 06:46:29 -0500170 Open Connection And Log In
George Keishingf58c4862017-03-28 13:01:03 -0500171 ${out} ${stderr}= Execute Command which callout-test return_stderr=True
172 Should Be Empty ${stderr}
173 Should Contain ${out} callout-test
174
175Clear Existing Error Logs
176 [Documentation] If error log isn't empty, restart the logging service on
177 ... the BMC
178
Rahul Maheshwari43be6932017-05-01 02:37:06 -0500179 Open Connection And Log In
George Keishingad5817a2017-06-28 10:19:03 -0500180 Delete Error Logs
181 ${resp}= OpenBMC Get Request /xyz/openbmc_project/logging/entry/
George Keishingf58c4862017-03-28 13:01:03 -0500182 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
183
George Keishingf58c4862017-03-28 13:01:03 -0500184Create Test Error With Callout
185 [Documentation] Generate test error log with callout for CPU0.
186
187 # Test error log entry example:
188 # "/xyz/openbmc_project/logging/entry/4": {
189 # "AdditionalData": [
190 # "CALLOUT_DEVICE_PATH_TEST=/sys/devices/platform/fsi-master/slave@00:00",
191 # "CALLOUT_ERRNO_TEST=0",
192 # "DEV_ADDR=0x0DEADEAD"
193 # ],
194 # "Id": 4,
195 # "Message": "example.xyz.openbmc_project.Example.Elog.TestCallout",
196 # "Resolved": 0,
197 # "Severity": "xyz.openbmc_project.Logging.Entry.Level.Error",
198 # "Timestamp": 1487747332528,
199 # "associations": [
200 # [
201 # "callout",
202 # "fault",
203 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
204 # ]
205 # ]
206 # },
207 # "/xyz/openbmc_project/logging/entry/4/callout": {
208 # "endpoints": [
209 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0"
210 # ]
211 # },
212
213 Execute Command On BMC
214 ... callout-test /sys/devices/platform/fsi-master/slave@00:00
215
216Verify Test Error Log And Callout
217 [Documentation] Verify test error log entries.
George Keishingad5817a2017-06-28 10:19:03 -0500218 ${elog_entry}= Get Elog URL List
219 ${resp}= OpenBMC Get Request ${elog_entry[0]}
220 ${json}= To JSON ${resp.content}
221
222 Should Be Equal ${json["data"]["Message"]}
George Keishingf58c4862017-03-28 13:01:03 -0500223 ... example.xyz.openbmc_project.Example.Elog.TestCallout
George Keishingad5817a2017-06-28 10:19:03 -0500224
225 Should Be Equal ${json["data"]["Severity"]}
George Keishingf58c4862017-03-28 13:01:03 -0500226 ... xyz.openbmc_project.Logging.Entry.Level.Error
George Keishingad5817a2017-06-28 10:19:03 -0500227
228 ${content}= Read Attribute ${elog_entry[0]}/callout endpoints
George Keishingf58c4862017-03-28 13:01:03 -0500229 Should Be Equal ${content[0]}
230 ... /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
231
232Boot 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