1*** Settings ***
2Documentation       This suite tests checkstop operations through HOST.
3
4Resource            ../../lib/openbmc_ffdc.robot
5Resource            ../../lib/openbmc_ffdc_utils.robot
6Resource            ../../lib/openbmc_ffdc_methods.robot
7Resource            ../../openpower/ras/ras_utils.robot
8Variables           ../../lib/ras/variables.py
9Variables           ../../data/variables.py
10
11Library             DateTime
12Library             OperatingSystem
13Library             random
14Library             Collections
15
16Suite Setup         RAS Suite Setup
17Test Setup          RAS Test Setup
18Test Teardown       FFDC On Test Case Fail
19Suite Teardown      RAS Suite Cleanup
20
21Force Tags          Host_RAS
22
23*** Variables ***
24${stack_mode}       normal
25
26*** Test Cases ***
27# Memory channel (MCACALIFIR) related error injection.
28
29Verify Recoverable Callout Handling For MCA With Threshold 1
30    [Documentation]  Verify recoverable callout handling for MCACALIFIR with
31    ...              threshold 1.
32    [Tags]  Verify_Recoverable_Callout_Handling_For_MCA_With_Threshold_1
33
34    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  MCACALIFIR_RECV1
35    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}mcacalfir_th1
36    Inject Recoverable Error With Threshold Limit
37    ...  HOST  ${value[0]}  ${value[1]}  1  ${value[2]}  ${err_log_path}
38
39Verify Recoverable Callout Handling For MCA With Threshold 32
40    [Documentation]  Verify recoverable callout handling for MCACALIFIR with
41    ...              threshold 32.
42    [Tags]  Verify_Recoverable_Callout_Handling_For_MCA_With_Threshold_32
43
44    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  MCACALIFIR_RECV32
45    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}mcacalfir_th32
46    Inject Recoverable Error With Threshold Limit
47    ...  HOST  ${value[0]}  ${value[1]}  32  ${value[2]}  ${err_log_path}
48
49Verify Unrecoverable Callout Handling For MCA
50    [Documentation]  Verify unrecoverable callout handling for MCACALIFIR.
51    [Tags]  Verify_Unrecoverable_Callout_Handling_For_MCA
52
53    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  MCACALIFIR_UE
54    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}mcacalfir
55    Inject Unrecoverable Error  HOST
56    ...  ${value[0]}  ${value[1]}  1  ${value[2]}  ${err_log_path}
57
58#  Memory buffer (MCIFIR) related error injection.
59
60Verify Recoverable Callout Handling For MCI With Threshold 1
61    [Documentation]  Verify recoverable callout handling for mci with
62    ...              threshold 1.
63    [Tags]  Verify_Recoverable_Callout_Handling_For_MCI_With_Threshold_1
64
65    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  MCI_RECV1
66    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}mcifir_th1
67    Inject Recoverable Error With Threshold Limit
68    ...  HOST  ${value[0]}  ${value[1]}  1  ${value[2]}  ${err_log_path}
69
70Verify Unrecoverable Callout Handling For MCI
71    [Documentation]  Verify unrecoverable callout handling for mci.
72    [Tags]  Verify_Unrecoverable_Callout_Handling_For_MCI
73
74    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  MCI_UE
75    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}mcifir
76    Inject Unrecoverable Error  HOST
77    ...  ${value[0]}  ${value[1]}  1  ${value[2]}  ${err_log_path}
78
79# CAPP accelerator (CXAFIR) related error injection.
80
81Verify Recoverable Callout Handling For CXA With Threshold 5
82    [Documentation]  Verify recoverable callout handling for  CXA with
83    ...              threshold 5.
84    [Tags]  Verify_Recoverable_Callout_Handling_For_CXA_With_Threshold_5
85
86    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  CXA_RECV5
87    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}cxafir_th5
88    Inject Recoverable Error With Threshold Limit
89    ...  HOST  ${value[0]}  ${value[1]}  5  ${value[2]}  ${err_log_path}
90
91Verify Recoverable Callout Handling For CXA With Threshold 32
92    [Documentation]  Verify recoverable callout handling for  CXA with
93    ...              threshold 32.
94    [Tags]  Verify_Recoverable_Callout_Handling_For_CXA_With_Threshold_32
95
96    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  CXA_RECV32
97    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}cxafir_th32
98    Inject Recoverable Error With Threshold Limit
99    ...  HOST  ${value[0]}  ${value[1]}  32  ${value[2]}  ${err_log_path}
100
101Verify Unrecoverable Callout Handling For CXA
102    [Documentation]  Verify unrecoverable callout handling for CXAFIR.
103    [Tags]  Verify_Unrecoverable_Callout_Handling_For_CXA
104
105    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  CXA_UE
106    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}cxafir_ue
107    Inject Unrecoverable Error  HOST
108    ...  ${value[0]}  ${value[1]}  1  ${value[2]}  ${err_log_path}
109
110
111#  OBUSFIR  related error injection.
112
113Verify Recoverable Callout Handling For OBUS With Threshold 32
114    [Documentation]  Verify recoverable callout handling for  OBUS with
115    ...              threshold 32.
116    [Tags]  Verify_Recoverable_Callout_Handling_For_OBUS_With_Threshold_32
117
118    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  OBUS_RECV32
119    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}obusfir_th32
120    Inject Recoverable Error With Threshold Limit
121    ...  HOST  ${value[0]}  ${value[1]}  32  ${value[2]}  ${err_log_path}
122
123# Nvidia graphics processing units (NPU0FIR) related error injection.
124
125Verify Recoverable Callout Handling For NPU0 With Threshold 32
126    [Documentation]  Verify recoverable callout handling for  NPU0 with
127    ...              threshold 32.
128    [Tags]  Verify_Recoverable_Callout_Handling_For_NPU0_With_Threshold_32
129
130    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  NPU0_RECV32
131    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}npu0fir_th32
132    Inject Recoverable Error With Threshold Limit
133    ...  HOST  ${value[0]}  ${value[1]}  32  ${value[2]}  ${err_log_path}
134
135#  Nest accelerator NXDMAENGFIR related error injection.
136
137Verify Recoverable Callout Handling For NXDMAENG With Threshold 1
138    [Documentation]  Verify recoverable callout handling for  NXDMAENG with
139    ...              threshold 1.
140    [Tags]  Verify_Recoverable_Callout_Handling_For_NXDMAENG_With_Threshold_1
141
142    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  NX_RECV1
143    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}nxfir_th1
144    Inject Recoverable Error With Threshold Limit
145    ...  HOST  ${value[0]}  ${value[1]}  1  ${value[2]}  ${err_log_path}
146
147
148Verify Recoverable Callout Handling For NXDMAENG With Threshold 32
149    [Documentation]  Verify recoverable callout handling for  NXDMAENG with
150    ...              threshold 32.
151    [Tags]  Verify_Recoverable_Callout_Handling_For_NXDMAENG_With_Threshold_32
152
153    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  NX_RECV32
154    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}nxfir_th32
155    Inject Recoverable Error With Threshold Limit
156    ...  HOST  ${value[0]}  ${value[1]}  32  ${value[2]}  ${err_log_path}
157
158#  L2FIR related error injection.
159
160Verify Recoverable Callout Handling For L2FIR With Threshold 1
161    [Documentation]  Verify recoverable callout handling for L2FIR with
162    ...              threshold 1.
163    [Tags]  Verify_Recoverable_Callout_Handling_For_L2FIR_With_Threshold_1
164
165    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  L2FIR_RECV1
166    ${translated_fir}=  Fetch FIR Address Translation Value  ${value[0]}  EX
167    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}l2fir_th1
168    Inject Recoverable Error With Threshold Limit
169    ...  HOST  ${translated_fir}  ${value[1]}  1  ${value[2]}  ${err_log_path}
170
171Verify Recoverable Callout Handling For L2FIR With Threshold 32
172    [Documentation]  Verify recoverable callout handling for L2FIR with
173    ...              threshold 32.
174    [Tags]  Verify_Recoverable_Callout_Handling_For_L2FIR_With_Threshold_32
175
176    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  L2FIR_RECV32
177    ${translated_fir}=  Fetch FIR Address Translation Value  ${value[0]}  EX
178    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}l2fir_th32
179    Inject Recoverable Error With Threshold Limit
180    ...  HOST  ${translated_fir}  ${value[1]}  32  ${value[2]}  ${err_log_path}
181
182Verify Unrecoverable Callout Handling For L2FIR
183    [Documentation]  Verify unrecoverable callout handling for L2FIR.
184    [Tags]  Verify_Unrecoverable_Callout_Handling_For_L2FIR
185
186    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  L2FIR_UE
187    ${translated_fir}=  Fetch FIR Address Translation Value  ${value[0]}  EX
188    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}l2fir_ue
189    Inject Unrecoverable Error  HOST
190    ...  ${translated_fir}  ${value[1]}  1  ${value[2]}  ${err_log_path}
191
192
193#  L3FIR related error injection.
194
195Verify Recoverable Callout Handling For L3FIR With Threshold 1
196    [Documentation]  Verify recoverable callout handling for L3FIR with
197    ...              threshold 1.
198    [Tags]  Verify_Recoverable_Callout_Handling_For_L3FIR_With_Threshold_1
199
200    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  L3FIR_RECV1
201    ${translated_fir}=  Fetch FIR Address Translation Value  ${value[0]}  EX
202    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}l3fir_th1
203    Inject Recoverable Error With Threshold Limit
204    ...  HOST  ${translated_fir}  ${value[1]}  1  ${value[2]}  ${err_log_path}
205
206Verify Recoverable Callout Handling For L3FIR With Threshold 32
207    [Documentation]  Verify recoverable callout handling for L3FIR with
208    ...              threshold 32.
209    [Tags]  Verify_Recoverable_Callout_Handling_For_L3FIR_With_Threshold_32
210
211    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  L3FIR_RECV32
212    ${translated_fir}=  Fetch FIR Address Translation Value  ${value[0]}  EX
213    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}l3fir_th32
214    Inject Recoverable Error With Threshold Limit
215    ...  HOST  ${translated_fir}  ${value[1]}  32  ${value[2]}  ${err_log_path}
216
217Verify Unrecoverable Callout Handling For L3FIR
218    [Documentation]  Verify unrecoverable callout handling for L3FIR.
219    [Tags]  Verify_Unrecoverable_Callout_Handling_For_L3FIR
220
221    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  L3FIR_UE
222    ${translated_fir}=  Fetch FIR Address Translation Value  ${value[0]}  EX
223    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}l3fir_ue
224    Inject Unrecoverable Error  HOST
225    ...  ${translated_fir}  ${value[1]}  1  ${value[2]}  ${err_log_path}
226
227
228# On chip controller (OCCFIR) related error injection.
229
230Verify Recoverable Callout Handling For OCC With Threshold 1
231    [Documentation]  Verify recoverable callout handling for OCCFIR with
232    ...              threshold 1.
233    [Tags]  Verify_Recoverable_Callout_Handling_For_OCC_With_Threshold_1
234
235    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  OCCFIR_RECV1
236    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}occfir_th1
237    Inject Recoverable Error With Threshold Limit
238    ...  HOST  ${value[0]}  ${value[1]}  1  ${value[2]}  ${err_log_path}
239
240# Core management engine (CMEFIR) related error injection.
241
242Verify Recoverable Callout Handling For CMEFIR With Threshold 1
243    [Documentation]  Verify recoverable callout handling for CMEFIR with
244    ...              threshold 1.
245    [Tags]  Verify_Recoverable_Callout_Handling_For_CMEFIR_With_Threshold_1
246
247    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  CMEFIR_RECV1
248    ${translated_fir}=  Fetch FIR Address Translation Value  ${value[0]}  EX
249    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}cmefir_th1
250    Inject Recoverable Error With Threshold Limit
251    ...  HOST  ${translated_fir}  ${value[1]}  1  ${value[2]}  ${err_log_path}
252
253# Nest control vunit (NCUFIR) related error injection.
254
255Verify Recoverable Callout Handling For NCUFIR With Threshold 1
256    [Documentation]  Verify recoverable callout handling for NCUFIR with
257    ...              threshold 1.
258    [Tags]  Verify_Recoverable_Callout_Handling_For_NCUFIR_With_Threshold_1
259
260    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  NCUFIR_RECV1
261    ${translated_fir}=  Fetch FIR Address Translation Value  ${value[0]}  EX
262    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}ncufir_th1
263    Inject Recoverable Error With Threshold Limit
264    ...  HOST  ${translated_fir}  ${value[1]}  1  ${value[2]}  ${err_log_path}
265
266Verify Unrecoverable Callout Handling For NCUFIR
267    [Documentation]  Verify unrecoverable callout handling for NCUFIR.
268    [Tags]  Verify_Unrecoverable_Callout_Handling_For_NCUFIR
269
270    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  NCUFIR_UE
271    ${translated_fir}=  Fetch FIR Address Translation Value  ${value[0]}  EX
272    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}ncufir_ue
273    Inject Unrecoverable Error  HOST
274    ...  ${translated_fir}  ${value[1]}  1  ${value[2]}  ${err_log_path}
275
276
277# Core FIR related error injection.
278
279Verify Recoverable Callout Handling For CoreFIR With Threshold 5
280    [Documentation]  Verify recoverable callout handling for CoreFIR with
281    ...              threshold 5.
282    [Tags]  Verify_Recoverable_Callout_Handling_For_CoreFIR_With_Threshold_5
283
284    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  COREFIR_RECV5
285    ${translated_fir}=  Fetch FIR Address Translation Value  ${value[0]}  EX
286    Disable CPU States Through HOST
287    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}corefir_th5
288    Inject Recoverable Error With Threshold Limit
289    ...  HOST  ${value[0]}  ${value[1]}  5  ${value[2]}  ${err_log_path}
290
291Verify Recoverable Callout Handling For CoreFIR With Threshold 1
292    [Documentation]  Verify recoverable callout handling for CoreFIR with
293    ...              threshold 1.
294    [Tags]  Verify_Recoverable_Callout_CoreFIR_Handling_For_With_Threshold_1
295
296    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  COREFIR_RECV1
297    ${translated_fir}=  Fetch FIR Address Translation Value  ${value[0]}  EX
298    Disable CPU States Through HOST
299    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}corefir_th1
300    Inject Recoverable Error With Threshold Limit
301    ...  HOST  ${value[0]}  ${value[1]}  1  ${value[2]}  ${err_log_path}
302
303Verify Unrecoverable Callout Handling For CoreFIR
304    [Documentation]  Verify unrecoverable callout handling for CoreFIR.
305    [Tags]  Verify_Unrecoverable_Callout_Handling_For_CoreFIR
306
307    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  COREFIR_UE
308    ${translated_fir}=  Fetch FIR Address Translation Value  ${value[0]}  EX
309    Disable CPU States Through HOST
310    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}corefir_ue
311    Inject Unrecoverable Error  HOST
312    ...  ${value[0]}  ${value[1]}  1  ${value[2]}  ${err_log_path}
313
314Verify Recoverable Callout Handling For EQFIR With Threshold 32
315    [Documentation]  Verify recoverable callout handling for L3FIR with
316    ...              threshold 32.
317    [Tags]  Verify_Recoverable_Callout_Handling_For_EQFIR_With_Threshold_32
318
319    ${value}=  Get From Dictionary  ${ERROR_INJECT_DICT}  EQFIR_RECV32
320    ${translated_fir}=  Fetch FIR Address Translation Value  ${value[0]}  EQ
321    ${err_log_path}=  Catenate  ${RAS_LOG_DIR_PATH}eqfir_th32
322    Inject Recoverable Error With Threshold Limit
323    ...  HOST  ${translated_fir}  ${value[1]}  32  ${value[2]}  ${err_log_path}
324