blob: 8ee6102fc3038e6f7f6d29a1a4733149ed201b66 [file] [log] [blame]
Sridevi Ramesh1d85af02019-02-22 04:08:15 -06001*** Settings ***
2Documentation Utility for RAS test scenarios through HOST & BMC.
3Resource ../../lib/utils.robot
Sridevi Ramesh1d85af02019-02-22 04:08:15 -06004Resource ../../lib/ras/host_utils.robot
5Resource ../../lib/resource.robot
6Resource ../../lib/state_manager.robot
7Resource ../../lib/boot_utils.robot
8Variables ../../lib/ras/variables.py
9Variables ../../data/variables.py
10Resource ../../lib/dump_utils.robot
11
12Library DateTime
13Library OperatingSystem
14Library random
15Library Collections
16
17*** Variables ***
18${stack_mode} normal
19
20*** Keywords ***
21
22Verify And Clear Gard Records On HOST
23 [Documentation] Verify And Clear gard records on HOST.
24
25 ${output}= Gard Operations On OS list
26 Should Not Contain ${output} No GARD
27 Gard Operations On OS clear all
28
29Verify Error Log Entry
30 [Documentation] Verify error log entry & signature description.
31 [Arguments] ${signature_desc} ${log_prefix}
32 # Description of argument(s):
33 # signature_desc Error log signature description.
34 # log_prefix Log path prefix.
35
Sridevi Ramesh1d85af02019-02-22 04:08:15 -060036
37 Error Logs Should Exist
38
39 Collect eSEL Log ${log_prefix}
40 ${error_log_file_path}= Catenate ${log_prefix}esel.txt
41 ${rc} ${output}= Run and Return RC and Output
42 ... grep -i ${signature_desc} ${error_log_file_path}
43 Should Be Equal ${rc} ${0}
44 Should Not Be Empty ${output}
45
46Inject Recoverable Error With Threshold Limit
47 [Documentation] Inject and verify recoverable error on processor through
Sridevi Ramesh9c6ec282019-03-25 03:35:46 -050048 ... BMC/HOST.
Sridevi Ramesh1d85af02019-02-22 04:08:15 -060049 ... Test sequence:
Sridevi Ramesh9c6ec282019-03-25 03:35:46 -050050 ... 1. Inject recoverable error on a given target
Sridevi Ramesh3e2a3bd2019-05-09 05:30:53 -050051 ... (e.g: Processor core, CAPP, MCA) through BMC/HOST.
Sridevi Ramesh9c6ec282019-03-25 03:35:46 -050052 ... 2. Check If HOST is running.
53 ... 3. Verify error log entry & signature description.
Sridevi Ramesh1d85af02019-02-22 04:08:15 -060054 ... 4. Verify & clear gard records.
Sridevi Ramesh9617ebd2019-11-25 10:57:21 -060055 [Arguments] ${interface_type} ${fir_address} ${value} ${threshold_limit}
Sridevi Ramesh1d85af02019-02-22 04:08:15 -060056 ... ${signature_desc} ${log_prefix}
57 # Description of argument(s):
58 # interface_type Inject error through 'BMC' or 'HOST'.
Sridevi Ramesh9617ebd2019-11-25 10:57:21 -060059 # fir_address FIR (Fault isolation register) value (e.g. 2011400).
60 # value (e.g 2000000000000000).
Sridevi Ramesh1d85af02019-02-22 04:08:15 -060061 # threshold_limit Threshold limit (e.g 1, 5, 32).
62 # signature_desc Error log signature description.
63 # log_prefix Log path prefix.
64
Sridevi Rameshf6e08862019-11-11 08:37:08 -060065 Run Keyword Inject Error Through ${interface_type}
Sridevi Ramesh9617ebd2019-11-25 10:57:21 -060066 ... ${fir_address} ${value} ${threshold_limit} ${master_proc_chip}
Sridevi Ramesh1d85af02019-02-22 04:08:15 -060067
68 Is Host Running
69 ${output}= Gard Operations On OS list
70 Should Contain ${output} No GARD
71 Verify Error Log Entry ${signature_desc} ${log_prefix}
Sridevi Ramesh1d85af02019-02-22 04:08:15 -060072
73
Sridevi Ramesh9c6ec282019-03-25 03:35:46 -050074Inject Unrecoverable Error
75 [Documentation] Inject and verify unrecoverable error on processor through
76 ... BMC/HOST.
Sridevi Ramesh1d85af02019-02-22 04:08:15 -060077 ... Test sequence:
Sridevi Ramesh9c6ec282019-03-25 03:35:46 -050078 ... 1. Inject unrecoverable error on a given target
Sridevi Ramesh3e2a3bd2019-05-09 05:30:53 -050079 ... (e.g: Processor core, CAPP, MCA) through BMC/HOST.
Sridevi Ramesh9c6ec282019-03-25 03:35:46 -050080 ... 2. Check If HOST is rebooted.
81 ... 3. Verify & clear gard records.
82 ... 4. Verify error log entry & signature description.
83 ... 5. Verify & clear dump entry.
Sridevi Ramesh9617ebd2019-11-25 10:57:21 -060084 [Arguments] ${interface_type} ${fir_address} ${value} ${threshold_limit}
Sridevi Rameshf6e08862019-11-11 08:37:08 -060085 ... ${signature_desc} ${log_prefix} ${bmc_reboot}=${0}
Sridevi Ramesh1d85af02019-02-22 04:08:15 -060086 # Description of argument(s):
Sridevi Ramesh9c6ec282019-03-25 03:35:46 -050087 # interface_type Inject error through 'BMC' or 'HOST'.
Sridevi Ramesh9617ebd2019-11-25 10:57:21 -060088 # fir_address FIR (Fault isolation register) value (e.g. 2011400).
89 # value (e.g 2000000000000000).
Sridevi Ramesh1d85af02019-02-22 04:08:15 -060090 # threshold_limit Threshold limit (e.g 1, 5, 32).
91 # signature_desc Error Log signature description.
92 # (e.g 'mcs(n0p0c0) (MCFIR[0]) mc internal recoverable')
93 # log_prefix Log path prefix.
Sridevi Rameshf6e08862019-11-11 08:37:08 -060094 # bmc_reboot Do bmc reboot If bmc_reboot is set.
Sridevi Ramesh1d85af02019-02-22 04:08:15 -060095
Sridevi Rameshf6e08862019-11-11 08:37:08 -060096 Run Keyword Inject Error Through ${interface_type}
Sridevi Ramesh9617ebd2019-11-25 10:57:21 -060097 ... ${fir_address} ${value} ${threshold_limit} ${master_proc_chip}
Sridevi Rameshf6e08862019-11-11 08:37:08 -060098
99 # Do BMC Reboot after error injection.
100 Run Keyword If ${bmc_reboot} Run Keywords
101 ... Initiate BMC Reboot
102 ... Wait For BMC Ready
103 ... Initiate Host PowerOff
104 ... Initiate Host Boot
Sridevi Ramesh9c6ec282019-03-25 03:35:46 -0500105 ... ELSE
Sridevi Rameshf6e08862019-11-11 08:37:08 -0600106 ... Wait Until Keyword Succeeds 500 sec 20 sec Is Host Rebooted
Sridevi Ramesh9c6ec282019-03-25 03:35:46 -0500107
Sridevi Ramesh1d85af02019-02-22 04:08:15 -0600108 Wait for OS
109 Verify Error Log Entry ${signature_desc} ${log_prefix}
Rahul Maheshwaria89ff9e2020-09-25 05:04:33 -0500110
George Keishingb78bca22021-06-29 11:11:19 -0500111 ${dump_service_status} ${stderr} ${rc}= BMC Execute Command
112 ... systemctl status xyz.openbmc_project.Dump.Manager.service
Rahul Maheshwaria89ff9e2020-09-25 05:04:33 -0500113 Should Contain ${dump_service_status} Active: active (running)
114
115 ${resp}= OpenBMC Get Request ${DUMP_URI}
116 Run Keyword If '${resp.status_code}' == '${HTTP_NOT_FOUND}'
117 ... Set Test Variable ${DUMP_ENTRY_URI} /xyz/openbmc_project/dump/entry/
118
Sridevi Rameshf6e08862019-11-11 08:37:08 -0600119 Read Properties ${DUMP_ENTRY_URI}list
Sridevi Ramesh1d85af02019-02-22 04:08:15 -0600120 Delete All BMC Dump
121 Verify And Clear Gard Records On HOST
122
Rahul Maheshwaria89ff9e2020-09-25 05:04:33 -0500123
Sridevi Ramesh1d85af02019-02-22 04:08:15 -0600124Fetch FIR Address Translation Value
125 [Documentation] Fetch FIR address translation value through HOST.
Sridevi Ramesh9617ebd2019-11-25 10:57:21 -0600126 [Arguments] ${fir_address} ${target_type}
Sridevi Ramesh1d85af02019-02-22 04:08:15 -0600127 # Description of argument(s):
Sridevi Ramesh9617ebd2019-11-25 10:57:21 -0600128 # fir_address FIR (Fault isolation register) value (e.g. '2011400').
Sridevi Ramesh1d85af02019-02-22 04:08:15 -0600129 # core_id Core ID (e.g. '9').
130 # target_type Target type (e.g. 'EX', 'EQ', 'C').
131
132 Login To OS Host
133 Copy Address Translation Utils To HOST OS
134
135 # Fetch processor chip IDs.
136 ${proc_chip_id}= Get ProcChipId From OS Processor ${master_proc_chip}
137 # Example output:
138 # 00000000
139
140 ${core_ids}= Get Core IDs From OS ${proc_chip_id[-1]}
141 # Example output:
142 #./probe_cpus.sh | grep 'CHIP ID: 0' | cut -c21-22
143 # ['14', '15', '16', '17']
144
145 # Ignoring master core ID.
146 ${output}= Get Slice From List ${core_ids} 1
147 # Feth random non-master core ID.
148 ${core_ids_sub_list}= Evaluate random.sample(${core_ids}, 1) random
149 ${core_id}= Get From List ${core_ids_sub_list} 0
150 ${translated_fir_addr}= FIR Address Translation Through HOST
Sridevi Ramesh9617ebd2019-11-25 10:57:21 -0600151 ... ${fir_address} ${core_id} ${target_type}
Sridevi Ramesh1d85af02019-02-22 04:08:15 -0600152
153 [Return] ${translated_fir_addr}
154
155RAS Test SetUp
156 [Documentation] Validates input parameters.
157
158 Should Not Be Empty
159 ... ${OS_HOST} msg=You must provide DNS name/IP of the OS host.
160 Should Not Be Empty
161 ... ${OS_USERNAME} msg=You must provide OS host user name.
162 Should Not Be Empty
163 ... ${OS_PASSWORD} msg=You must provide OS host user password.
164
Sridevi Rameshf6e08862019-11-11 08:37:08 -0600165 Smart Power Off
166
Sridevi Ramesh1d85af02019-02-22 04:08:15 -0600167 # Boot to OS.
Sridevi Rameshf6e08862019-11-11 08:37:08 -0600168 REST Power On quiet=${1}
Sridevi Ramesh1d85af02019-02-22 04:08:15 -0600169 # Adding delay after host bring up.
170 Sleep 60s
171
172RAS Suite Setup
173 [Documentation] Create RAS log directory to store all RAS test logs.
174
175 ${RAS_LOG_DIR_PATH}= Catenate ${EXECDIR}/RAS_logs/
176 Set Suite Variable ${RAS_LOG_DIR_PATH}
177 Set Suite Variable ${master_proc_chip} False
178
179 Create Directory ${RAS_LOG_DIR_PATH}
180 OperatingSystem.Directory Should Exist ${RAS_LOG_DIR_PATH}
181 Empty Directory ${RAS_LOG_DIR_PATH}
182
183 Should Not Be Empty ${ESEL_BIN_PATH}
184 Set Environment Variable PATH %{PATH}:${ESEL_BIN_PATH}
185
186 # Boot to Os.
Sridevi Rameshf6e08862019-11-11 08:37:08 -0600187 REST Power On quiet=${1}
Sridevi Ramesh1d85af02019-02-22 04:08:15 -0600188
189 # Check Opal-PRD service enabled on host.
190 ${opal_prd_state}= Is Opal-PRD Service Enabled
191 Run Keyword If '${opal_prd_state}' == 'disabled'
192 ... Enable Opal-PRD Service On HOST
193
194RAS Suite Cleanup
195 [Documentation] Perform RAS suite cleanup and verify that host
196 ... boots after test suite run.
197
198 # Boot to OS.
Michael Walsh9fbc1f02019-10-22 13:39:44 -0500199 REST Power On
Sridevi Ramesh1d85af02019-02-22 04:08:15 -0600200 Delete Error Logs
201 Gard Operations On OS clear all
Sridevi Ramesh3e2a3bd2019-05-09 05:30:53 -0500202
203
204Inject Error At HOST Boot Path
205
206 [Documentation] Inject and verify recoverable error on processor through
207 ... BMC using pdbg tool at HOST Boot path.
208 ... Test sequence:
209 ... 1. Inject error on a given target
210 ... (e.g: Processor core, CAPP, MCA) through BMC using
211 ... pdbg tool at HOST Boot path.
212 ... 2. Check If HOST is rebooted and running.
213 ... 3. Verify error log entry & signature description.
214 ... 4. Verify & clear gard records.
Sridevi Ramesh9617ebd2019-11-25 10:57:21 -0600215 [Arguments] ${fir_address} ${value} ${signature_desc} ${log_prefix}
Sridevi Ramesh3e2a3bd2019-05-09 05:30:53 -0500216 # Description of argument(s):
Sridevi Ramesh9617ebd2019-11-25 10:57:21 -0600217 # fir_address FIR (Fault isolation register) value (e.g. 2011400).
218 # value (e.g 2000000000000000).
Sridevi Ramesh3e2a3bd2019-05-09 05:30:53 -0500219 # signature_desc Error log signature description.
220 # log_prefix Log path prefix.
221
Sridevi Ramesh9617ebd2019-11-25 10:57:21 -0600222 Inject Error Through BMC At HOST Boot ${fir_address} ${value}
Sridevi Ramesh3e2a3bd2019-05-09 05:30:53 -0500223
224 Wait Until Keyword Succeeds 500 sec 20 sec Is Host Rebooted
225 Wait for OS
226 Verify Error Log Entry ${signature_desc} ${log_prefix}
227 Verify And Clear Gard Records On HOST