blob: 89d0ef6d24b83cb88c9dedc1476ecf0753285ded [file] [log] [blame]
Sweta Potthuri39255032018-03-28 10:12:14 -05001*** Settings ***
2Documentation Secure boot related test cases.
3
Sweta Potthurid3c03432018-04-19 11:30:27 -05004# Test Parameters:
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -06005# SEL to PEL conversion:
6# https://github.com/openbmc/openbmc-test-automation/blob/master/docs/
7# openbmc_test_tools.md#converting-sels-to-readable-format
devindia54b13932019-03-20 04:38:08 -05008#
9# Definition of each partition acronyms
10# HBB: Hostboot Base
11# HBI: Hostboot Extended Image
12# HBRT: Hostboot Runtime
13# HBD: Hostboot Data
14# HBBL: Bostboot Base loader
15# SBE: Self Boot Engine
16# OCC: On Chip Controller
Lakshminarayana R. Kammath2c0f28e2019-04-12 12:59:34 -050017# PAYLOAD : OPAL Partition
18# HCODE : Hardware Code
19# BOOTKERNEL : OPAL Boot Kernel
20# WOFDATA : Workload Optimized Frequency Data
21# MEMD : Memory VPD
Sweta Potthurid3c03432018-04-19 11:30:27 -050022
Lakshminarayana R. Kammathf023c952019-11-05 11:56:26 -060023Resource ../../lib/resource.robot
George Keishinga8b25492018-06-07 01:15:37 -050024Resource ../../lib/utils.robot
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -060025Resource ../../lib/state_manager.robot
George Keishinga8b25492018-06-07 01:15:37 -050026Resource ../../lib/boot_utils.robot
Lakshminarayana R. Kammatheca4dce2019-03-27 12:28:06 -050027Resource ../../lib/secureboot/secureboot.robot
George Keishinga8b25492018-06-07 01:15:37 -050028Resource ../../lib/open_power_utils.robot
29Resource ../../lib/logging_utils.robot
30Resource ../../lib/openbmc_ffdc_methods.robot
Lakshminarayana R. Kammathf023c952019-11-05 11:56:26 -060031Resource ../../lib/openbmc_ffdc.robot
32Resource ../../lib/openbmc_ffdc_utils.robot
Sweta Potthuri39255032018-03-28 10:12:14 -050033
George Keishinga8b25492018-06-07 01:15:37 -050034Library ../../lib/gen_misc.py
Lakshminarayana R. Kammatheca4dce2019-03-27 12:28:06 -050035Library ../../lib/secureboot/secureboot.py
Sweta Potthurid3c03432018-04-19 11:30:27 -050036
37Suite Setup Suite Setup Execution
Sweta Potthuri39255032018-03-28 10:12:14 -050038Test Setup Test Setup Execution
39Test Teardown Test Teardown Execution
40
41*** Variables ***
42
43${security_access_bit_mask} ${0xC000000000000000}
Lakshminarayana R. Kammathf023c952019-11-05 11:56:26 -060044${pnor_corruption_rc} 1E07
Lakshminarayana R. Kammath2c0f28e2019-04-12 12:59:34 -050045${bootkernel_corruption_rc} log=0xffffffffffff8160
Sweta Potthurid3c03432018-04-19 11:30:27 -050046${bmc_image_dir_path} /usr/local/share/pnor
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -060047${bmc_guard_part_path} /var/lib/phosphor-software-manager/pnor/prsv/GUARD
devindia54b13932019-03-20 04:38:08 -050048${HB_PART_LIST} [HBB, HBD, HBI, HBRT, HBBL]
Lakshminarayana R. Kammath2c0f28e2019-04-12 12:59:34 -050049${NON_HB_PART_LIST} [SBE, OCC, HCODE, WOFDATA, MEMD, PAYLOAD]
50${MIXED_PART_LIST} [SBE, HBD, OCC, HBRT, HBBL, HCODE, WOFDATA, MEMD, PAYLOAD]
Sweta Potthuri39255032018-03-28 10:12:14 -050051
52*** Test Cases ***
53
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -060054# All the test cases requires by default jumpers to be positioned
55# between 1 & 2. If this is not met test cases would fail
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -060056Validate Secure Cold Boot With TPM Policy Disabled
57 [Documentation] Validate secure cold boot with TPM policy disabled.
58 [Tags] Validate_Secure_Cold_Boot_With_TPM_Policy_Disabled
Sweta Potthuri39255032018-03-28 10:12:14 -050059
60 Validate Secure Boot With TPM Policy Enabled Or Disabled ${0}
61
62
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -060063Validate Secure Cold Boot With TPM Policy Enabled
64 [Documentation] Validate secure cold boot with TPM policy enabled.
65 [Tags] Validate_Secure_Cold_Boot_With_TPM_Policy_Enabled
Sweta Potthuri39255032018-03-28 10:12:14 -050066
67 Validate Secure Boot With TPM Policy Enabled Or Disabled ${1}
68
69
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -060070Secure Boot Violation Using Corrupt SBE Image On Cold Boot
71 [Documentation] Secure boot violation using corrupt SBE image on cold boot.
72 [Tags] Secure_Boot_Violation_Using_Corrupt_SBE_Image_On_Cold_Boot
Sweta Potthurid3c03432018-04-19 11:30:27 -050073
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -060074 Violate Secure Boot Using Corrupt Image
75 ... SBE ${pnor_corruption_rc} ${bmc_image_dir_path}
Sweta Potthurid3c03432018-04-19 11:30:27 -050076
77
devindia54b13932019-03-20 04:38:08 -050078Secure Boot Violation Using Corrupt HBD Image On Cold Boot
79 [Documentation] Secure boot violation using corrupt HBD image on cold boot.
80 [Tags] Secure_Boot_Violation_Using_Corrupt_HBD_Image_On_Cold_Boot
81
82 Violate Secure Boot Using Corrupt Image
83 ... HBD ${pnor_corruption_rc} ${bmc_image_dir_path}
84
85Secure Boot Violation Using Corrupt HBB Image On Cold Boot
86 [Documentation] Secure boot violation using corrupt HBB image on cold boot.
87 [Tags] Secure_Boot_Violation_Using_Corrupt_HBB_Image_On_Cold_Boot
88
89 Violate Secure Boot Using Corrupt Image
90 ... HBB ${pnor_corruption_rc} ${bmc_image_dir_path}
91
Lakshminarayana R. Kammath2c0f28e2019-04-12 12:59:34 -050092
devindia54b13932019-03-20 04:38:08 -050093Secure Boot Violation Using Corrupt HBBL Image On Cold Boot
94 [Documentation] Secure boot violation using corrupt HBBL image on cold boot.
95 [Tags] Secure_Boot_Violation_Using_Corrupt_HBBL_Image_On_Cold_Boot
96
97 Violate Secure Boot Using Corrupt Image
98 ... HBBL ${pnor_corruption_rc} ${bmc_image_dir_path}
99
100
101Secure Boot Violation Using Corrupt HBI Image On Cold Boot
102 [Documentation] Secure boot violation using corrupt HBI image on cold boot.
103 [Tags] Secure_Boot_Violation_Using_Corrupt_HBI_Image_On_Cold_Boot
104
105 Violate Secure Boot Using Corrupt Image
106 ... HBI ${pnor_corruption_rc} ${bmc_image_dir_path}
107
108
109Secure Boot Violation Using Corrupt HBRT Image On Cold Boot
110 [Documentation] Secure boot violation using corrupt HBRT image on cold boot.
111 [Tags] Secure_Boot_Violation_Using_Corrupt_HBRT_Image_On_Cold_Boot
112
113 Violate Secure Boot Using Corrupt Image
114 ... HBRT ${pnor_corruption_rc} ${bmc_image_dir_path}
115
116
117Secure Boot Violation Using Corrupt OCC Image On Cold Boot
118 [Documentation] Secure boot violation using corrupt OCC image on cold boot.
119 [Tags] Secure_Boot_Violation_Using_Corrupt_OCC_Image_On_Cold_Boot
120
121 Violate Secure Boot Using Corrupt Image
122 ... OCC ${pnor_corruption_rc} ${bmc_image_dir_path}
123
Lakshminarayana R. Kammath2c0f28e2019-04-12 12:59:34 -0500124
125Secure Boot Violation Using Corrupt HCODE Image On Cold Boot
126 [Documentation] Secure boot violation using corrupt HCODE image on cold boot.
127 [Tags] Secure_Boot_Violation_Using_Corrupt_HCODE_Image_On_Cold_Boot
128
129 Violate Secure Boot Using Corrupt Image
130 ... HCODE ${pnor_corruption_rc} ${bmc_image_dir_path}
131
132
133Secure Boot Violation Using Corrupt WOFDATA Image On Cold Boot
134 [Documentation] Secure boot violation using corrupt HCODE image on cold boot.
135 [Tags] Secure_Boot_Violation_Using_Corrupt_WOFDATA_Image_On_Cold_Boot
136
137 Violate Secure Boot Using Corrupt Image
138 ... WOFDATA ${pnor_corruption_rc} ${bmc_image_dir_path}
139
140
141Secure Boot Violation Using Corrupt BOOTKERNEL Image On Cold Boot
142 [Documentation] Secure boot violation using corrupt BOOTKERNEL image on cold boot.
143 [Tags] Secure_Boot_Violation_Using_Corrupt_BOOTKERNEL_Image_On_Cold_Boot
144
145 Violate Secure Boot Using Corrupt Image
146 ... BOOTKERNEL ${bootkernel_corruption_rc} ${bmc_image_dir_path}
147
148
149Secure Boot Violation Using Corrupt MEMD Image On Cold Boot
150 [Documentation] Secure boot violation using corrupt MEMD image on cold boot.
151 [Tags] Secure_Boot_Violation_Using_Corrupt_MEMD_Image_On_Cold_Boot
152
153 Violate Secure Boot Using Corrupt Image
154 ... MEMD ${pnor_corruption_rc} ${bmc_image_dir_path}
155
156
157Secure Boot Violation Using Corrupt PAYLOAD Image On Cold Boot
158 [Documentation] Secure boot violation using corrupt PAYLOAD image on cold boot.
159 [Tags] Secure_Boot_Violation_Using_Corrupt_PAYLOAD_Image_On_Cold_Boot
160
161 Violate Secure Boot Using Corrupt Image
162 ... PAYLOAD ${pnor_corruption_rc} ${bmc_image_dir_path}
163
164
Sweta Potthuri39255032018-03-28 10:12:14 -0500165*** Keywords ***
166
Lakshminarayana R. Kammatheca4dce2019-03-27 12:28:06 -0500167Validate Secure Boot Setup
168 [Documentation] Validates setup to make sure it's secureboot run capable.
169
170 # Check the jumper position and Security settings before moving ahead.
171 ${num_procs} ${secureboot_state} ${jumper_state}= Get Secure Boot Info
172
173 Rprint Vars secureboot_state jumper_state
174
175 Should Be True ${secureboot_state} == True and ${jumper_state} == False
Lakshminarayana R. Kammath0d7b6a62019-04-02 00:46:58 -0500176 ... msg=Jumper is on while secureboot is disabled. Put the jumpers between pins 2 and 3.
Lakshminarayana R. Kammatheca4dce2019-03-27 12:28:06 -0500177
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600178Violate Secure Boot Using Corrupt Image
179 [Documentation] Cause secure boot violation during cold boot
180 ... with corrupted image.
181 [Arguments] ${partition} ${error_rc} ${bmc_image_dir_path}
Sweta Potthurid3c03432018-04-19 11:30:27 -0500182
Gunnar Mills7732c7e2018-08-14 11:54:24 -0500183 # Description of argument(s):
Sweta Potthurid3c03432018-04-19 11:30:27 -0500184 # partition The partition which is to be corrupted
185 # (e.g. "SBE", "HBI", "HBB", "HBRT", "HBBL", "OCC").
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600186 # error_rc The RC that is expected as a
Sweta Potthurid3c03432018-04-19 11:30:27 -0500187 # result of the secure boot violation
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600188 # (e.g. "SECUREBOOT::RC_ROM_VERIFY").
Sweta Potthurid3c03432018-04-19 11:30:27 -0500189 # bmc_image_dir_path BMC image path.
190
191 Set And Verify TPM Policy ${1}
192
193 # Descipiton:
194 # Cause a secure boot violation by copying an BMC image file to the
195 # target BMC and then starting a power on.
196 # This action should result in:
197 # 1) an error log entry
198 # 2) the system going to "Quiesced" state.
199
200 # Load corrupted image to /usr/local/share/pnor.
201 Open Connection For SCP
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600202
Lakshminarayana R. Kammath2c0f28e2019-04-12 12:59:34 -0500203 # Some times it is observed that bigger size files doesn't get copied.
204 # Our intention here is to test bad image. Even if it is truncated/partial,
205 # that should be fine
206 Run Keyword And Ignore Error scp.Put File
devindia54b13932019-03-20 04:38:08 -0500207 ... ${ENV_SB_CORRUPTED_BIN_PATH}/${partition} ${bmc_image_dir_path}
Sweta Potthurid3c03432018-04-19 11:30:27 -0500208
Lakshminarayana R. Kammathf023c952019-11-05 11:56:26 -0600209 ${error_log_path}= Catenate ${SB_LOG_DIR_PATH}
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600210 Create Directory ${error_log_path}
Sweta Potthurid3c03432018-04-19 11:30:27 -0500211
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600212 Set Global Variable ${error_log_path}
213 Log ${error_log_path}
214
215 # Starting a power on.
Lakshminarayana R. Kammath4f858df2019-07-15 02:18:03 -0500216 BMC Execute Command /usr/bin/obmcutil poweron
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600217 Wait Until Keyword Succeeds 15 min 15 sec Error Logs Should Exist
218
Lakshminarayana R. Kammathf023c952019-11-05 11:56:26 -0600219 # Check for eSEL.
devindia54b13932019-03-20 04:38:08 -0500220 # Expected behavior is that the error occurs early in the boot process,
221 # therefore, no entry in the error log and nothing to decode.
222 # The 1E07 error is written to PNOR & then goes into Quiesced state.
223 # On the next valid boot, the error log will be sent to BMC &
Lakshminarayana R. Kammathf023c952019-11-05 11:56:26 -0600224 # seen on SOL console.
225 # We won't see any ESEL's for HBB, HBD, HBI or BOOTKERNEL because
226 # Hostboot has no mechanism to send an eSEL when it is dying.
227 Run Keyword If '${partition}' not in ['HBB', 'HBD', 'HBI', 'BOOTKERNEL']
228 ... Wait Until Keyword Succeeds 5 min 5 sec
229 ... Collect Error Logs and Verify SRC ${error_rc} ${error_log_path}
Sweta Potthurid3c03432018-04-19 11:30:27 -0500230
231 # Remove the file from /usr/local/share/pnor/.
232 BMC Execute Command rm -rf ${bmc_image_dir_path}*
233
234 # Check if system reaches quiesce state.
devindia54b13932019-03-20 04:38:08 -0500235 # Default system state will be power off at the end of the verification.
Sweta Potthurid3c03432018-04-19 11:30:27 -0500236 Run Keywords
237 ... Wait Until Keyword Succeeds 3 min 5 sec Is Host Quiesced AND
238 ... Recover Quiesced Host
239
devindia54b13932019-03-20 04:38:08 -0500240 # We will retry boot with corrupted partition removed
241 # SOL console should show previous boot fail message (1E07) on current boot
Lakshminarayana R. Kammathf023c952019-11-05 11:56:26 -0600242 # HBB, HBD or HBI corruption will never get far enough to log into PNOR.
devindia54b13932019-03-20 04:38:08 -0500243 # so, it should be removed from consideration for this check
Lakshminarayana R. Kammathf023c952019-11-05 11:56:26 -0600244 Run Keyword If '${partition}' in ['HBB', 'HBD', 'HBI']
devindia54b13932019-03-20 04:38:08 -0500245 ... Log To Console No more action on ${partition} corruption required.
Lakshminarayana R. Kammathf023c952019-11-05 11:56:26 -0600246 ... ELSE IF '${partition}' in ['HBRT']
devindia54b13932019-03-20 04:38:08 -0500247 ... Run Keywords
248 ... REST Power On stack_mode=skip quiet=1 AND
249 ... Wait Until Keyword Succeeds 5 min 5 sec Error Logs Should Exist AND
250 ... Get And Verify Partition Corruption ${partition} ${sol_log_file_path} AND
251 ... REST Power Off stack_mode=skip quiet=1
Sweta Potthurid3c03432018-04-19 11:30:27 -0500252
253Collect Error Logs and Verify SRC
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600254 [Documentation] Verify error log entry & signature description.
255 [Arguments] ${error_rc} ${log_prefix}
Sweta Potthurid3c03432018-04-19 11:30:27 -0500256
257 # Description of argument(s):
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600258 # error_rc Error log signature description.
259 # log_prefix Log path prefix.
Sweta Potthurid3c03432018-04-19 11:30:27 -0500260
Lakshminarayana R. Kammathf023c952019-11-05 11:56:26 -0600261 Error Logs Should Exist
Sweta Potthurid3c03432018-04-19 11:30:27 -0500262
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600263 Collect eSEL Log ${log_prefix}
264 ${error_log_file_path}= Catenate ${log_prefix}esel.txt
265 ${rc} ${output}= Run and Return RC and Output
266 ... grep -i ${error_rc} ${error_log_file_path}
Sweta Potthurid3c03432018-04-19 11:30:27 -0500267 Should Be Equal ${rc} ${0}
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600268 Should Not Be Empty ${output}
Sweta Potthurid3c03432018-04-19 11:30:27 -0500269
Sweta Potthuri39255032018-03-28 10:12:14 -0500270Get And Verify Security Access Bit
271 [Documentation] Get and verify security access bit.
272 [Arguments] ${sol_log_file_path}
273
274 # Description of argument(s):
275 # sol_log_file_path The path to the file containing SOL data
276 # which was collected during a REST Power On.
277
278 # Sample output:
279 # 19.68481|SECURE|Security Access Bit> 0xC000000000000000
280
281 ${cmd}= Catenate
282 ... grep "Security Access Bit" ${sol_log_file_path} | awk '{ print $4 }'
283 ${rc} ${security_access_bit_str}= Run and Return RC and Output ${cmd}
284 Should Be Equal ${rc} ${0}
285 ... msg=Return code from ${cmd} not zero.
286
287 # Verify the value of "Security Access Bit".
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600288 # If fails, probable issue is Jumper position.
Sweta Potthuri39255032018-03-28 10:12:14 -0500289
290 ${security_access_bit}= Convert to Integer ${security_access_bit_str}
291 ${result}= Evaluate ${security_access_bit_mask} & ${security_access_bit}
292 Should Be Equal ${result} ${security_access_bit_mask}
293 ... msg=System is not booted in secure mode. values=False
294
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600295Get And Verify Partition Corruption
296 [Documentation] Get and verify partition corruption.
devindia54b13932019-03-20 04:38:08 -0500297 [Arguments] ${partition} ${sol_log_file_path}
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600298
299 # Description of argument(s):
devindia54b13932019-03-20 04:38:08 -0500300 # partition The partition which is to be corrupted
301 # (e.g. "SBE", "HBI", "HBB", "HBRT", "HBBL", "OCC").
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600302 # sol_log_file_path The path to the file containing SOL data
303 # which was collected during a REST Power On.
304
305 # Sample output:
306 # 44.47498|secure|Secureboot Failure plid = 0x90000007, rc = 0x1E07
devindia54b13932019-03-20 04:38:08 -0500307 # OR
308 # 14.94315|Error reported by secure (0x1E00) PLID 0x90000002
309 # 14.99659| ROM_verify() Call Failed
310 # 14.99659| ModuleId 0x03 SECUREBOOT::MOD_SECURE_ROM_VERIFY
311 # 14.99660| ReasonCode 0x1e07 SECUREBOOT::RC_ROM_VERIFY
Lakshminarayana R. Kammath2c0f28e2019-04-12 12:59:34 -0500312 # OR
313 # 113.150162849,0] STB: BOOTKERNEL verification FAILED. log=0xffffffffffff8160
314 #
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600315
devindia54b13932019-03-20 04:38:08 -0500316 ${cmd}= Run Keyword If '${partition}' in '${MIXED_PART_LIST}'
317 ... Catenate
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600318 ... grep -i "Secureboot Failure" ${sol_log_file_path} | awk '{ print $8 }'
devindia54b13932019-03-20 04:38:08 -0500319 ... ELSE IF '${partition}' == 'HBI'
320 ... Catenate
321 ... grep -i "ReasonCode" ${sol_log_file_path} | awk '{ print $3 }'
Lakshminarayana R. Kammath2c0f28e2019-04-12 12:59:34 -0500322 ... ELSE IF '{$partition}' == 'BOOTKERNEL'
323 ... Catenate
324 ... grep -i "STB: BOOTKERNEL verification FAILED" ${sol_log_file_path} | awk '{ print $7}'
devindia54b13932019-03-20 04:38:08 -0500325
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600326 ${rc} ${corruption_rc_str}= Run and Return RC and Output ${cmd}
327 Should Be Equal ${rc} ${0}
328 ... msg=Return code from ${cmd} not zero.
329
330 # Verify the RC 0x1E07 from sol output".
devindia54b13932019-03-20 04:38:08 -0500331 Should Be Equal As Strings
Lakshminarayana R. Kammathf023c952019-11-05 11:56:26 -0600332 ... ${corruption_rc_str} 0x${pnor_corruption_rc} ignore_case=True
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600333 ... msg=SB violation due to PNOR partition corruption not reported. values=False
334
Sweta Potthuri39255032018-03-28 10:12:14 -0500335
336Validate Secure Boot With TPM Policy Enabled Or Disabled
337 [Documentation] Validate secure boot with TPM policy enabled or disabled.
338 [Arguments] ${tpm_policy}
339
340 # Description of argument(s):
341 # tpm_policy Enable-0 or Disable-1.
342
343 Set And Verify TPM Policy ${tpm_policy}
344 REST Power On quiet=1
345 Validate Secure Boot ${sol_log_file_path}
346
347
348Validate Secure Boot
349 [Documentation] Validate secure boot.
350 [Arguments] ${sol_log_file_path}
351
352 # Description of argument(s):
353 # sol_log_file_path The path to the file containing SOL data
354 # which was collected during a REST Power On.
355
356 Get And Verify Security Access Bit ${sol_log_file_path}
357 Error Logs Should Not Exist
358 REST Verify No Gard Records
359
360
Sweta Potthurid3c03432018-04-19 11:30:27 -0500361Suite Setup Execution
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600362 [Documentation] Suite Setup Execution.
Sweta Potthurid3c03432018-04-19 11:30:27 -0500363
Sweta Potthurid3c03432018-04-19 11:30:27 -0500364 ${bmc_image_dir_path}= Add Trailing Slash ${bmc_image_dir_path}
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600365
366 ${SB_LOG_DIR_PATH}= Catenate ${EXECDIR}/SB_logs/
367 Set Suite Variable ${SB_LOG_DIR_PATH}
368
369 Create Directory ${SB_LOG_DIR_PATH}
370 Empty Directory ${SB_LOG_DIR_PATH}
Lakshminarayana R. Kammath077fbf92019-02-20 11:15:18 -0600371
Sweta Potthurid3c03432018-04-19 11:30:27 -0500372 Set Global Variable ${bmc_image_dir_path}
373 Log ${bmc_image_dir_path}
374 BMC Execute Command rm -rf ${bmc_image_dir_path}*
375
Lakshminarayana R. Kammath6c918292019-02-22 05:05:22 -0600376 Set Global Variable ${bmc_guard_part_path}
377 Log ${bmc_guard_part_path}
378 BMC Execute Command rm -rf ${bmc_guard_part_path}
Lakshminarayana R. Kammath077fbf92019-02-20 11:15:18 -0600379
devindia54b13932019-03-20 04:38:08 -0500380 # All the corrupted binaries will go in here
381 # Run this as input param
Lakshminarayana R. Kammathf023c952019-11-05 11:56:26 -0600382 Valid Path ENV_SB_CORRUPTED_BIN_PATH
383 Valid Path ESEL_BIN_PATH
384 Set Environment Variable PATH %{PATH}:${ENV_SB_CORRUPTED_BIN_PATH}:${ESEL_BIN_PATH}
devindia54b13932019-03-20 04:38:08 -0500385
Sweta Potthurid3c03432018-04-19 11:30:27 -0500386
Sweta Potthuri39255032018-03-28 10:12:14 -0500387Test Setup Execution
388 [Documentation] Test setup execution.
389
390 ${timestamp}= Get Current Date result_format=%Y%m%d%H%M%S
391 ${sol_log_file_path}= Catenate ${EXECDIR}/Secure_SOL${timestamp}
392 Start SOL Console Logging ${sol_log_file_path}
393 Set Suite Variable ${sol_log_file_path}
394
Lakshminarayana R. Kammatheca4dce2019-03-27 12:28:06 -0500395 REST Power On stack_mode=skip quiet=1
396
397 # Validate the secureboot setup. If not met with required state then, fail.
398 Validate Secure Boot Setup
399
Sweta Potthuri39255032018-03-28 10:12:14 -0500400 REST Power Off stack_mode=skip quiet=1
401 Delete Error Logs And Verify
Lakshminarayana R. Kammath077fbf92019-02-20 11:15:18 -0600402
Sweta Potthuri39255032018-03-28 10:12:14 -0500403
Sweta Potthuri39255032018-03-28 10:12:14 -0500404Test Teardown Execution
405 [Documentation] Test teardown execution.
406
407 Stop SOL Console Logging
408 Run rm -rf ${sol_log_file_path}
Sweta Potthurid3c03432018-04-19 11:30:27 -0500409
devindia54b13932019-03-20 04:38:08 -0500410 # Collect FFDC on failure
411 FFDC On Test Case Fail
412
Sweta Potthurid3c03432018-04-19 11:30:27 -0500413 # Removing the corrupted file from BMC.
414 BMC Execute Command rm -rf ${bmc_image_dir_path}*