Sweta Potthuri | 3925503 | 2018-03-28 10:12:14 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Secure boot related test cases. |
| 3 | |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 4 | # Test Parameters: |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 5 | # 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 |
devindia | 54b1393 | 2019-03-20 04:38:08 -0500 | [diff] [blame] | 8 | # |
| 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 |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 17 | |
George Keishing | a8b2549 | 2018-06-07 01:15:37 -0500 | [diff] [blame] | 18 | Resource ../../lib/utils.robot |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 19 | Resource ../../lib/state_manager.robot |
George Keishing | a8b2549 | 2018-06-07 01:15:37 -0500 | [diff] [blame] | 20 | Resource ../../lib/boot_utils.robot |
Lakshminarayana R. Kammath | eca4dce | 2019-03-27 12:28:06 -0500 | [diff] [blame] | 21 | Resource ../../lib/secureboot/secureboot.robot |
George Keishing | a8b2549 | 2018-06-07 01:15:37 -0500 | [diff] [blame] | 22 | Resource ../../lib/open_power_utils.robot |
| 23 | Resource ../../lib/logging_utils.robot |
| 24 | Resource ../../lib/openbmc_ffdc_methods.robot |
Sweta Potthuri | 3925503 | 2018-03-28 10:12:14 -0500 | [diff] [blame] | 25 | |
George Keishing | a8b2549 | 2018-06-07 01:15:37 -0500 | [diff] [blame] | 26 | Library ../../lib/gen_misc.py |
Lakshminarayana R. Kammath | eca4dce | 2019-03-27 12:28:06 -0500 | [diff] [blame] | 27 | Library ../../lib/secureboot/secureboot.py |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 28 | |
| 29 | Suite Setup Suite Setup Execution |
Sweta Potthuri | 3925503 | 2018-03-28 10:12:14 -0500 | [diff] [blame] | 30 | Test Setup Test Setup Execution |
| 31 | Test Teardown Test Teardown Execution |
| 32 | |
| 33 | *** Variables *** |
| 34 | |
| 35 | ${security_access_bit_mask} ${0xC000000000000000} |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 36 | # TODO: will enable this in next commit |
| 37 | #${pnor_corruption_rc} SECUREBOOT::RC_ROM_VERIFY |
| 38 | ${pnor_corruption_rc} 0x1E07 |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 39 | ${bmc_image_dir_path} /usr/local/share/pnor |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 40 | ${bmc_guard_part_path} /var/lib/phosphor-software-manager/pnor/prsv/GUARD |
devindia | 54b1393 | 2019-03-20 04:38:08 -0500 | [diff] [blame] | 41 | ${HB_PART_LIST} [HBB, HBD, HBI, HBRT, HBBL] |
| 42 | ${NON_HB_PART_LIST} [SBE, OCC] |
| 43 | ${MIXED_PART_LIST} [SBE, HBD, OCC, HBRT, HBBL] |
Sweta Potthuri | 3925503 | 2018-03-28 10:12:14 -0500 | [diff] [blame] | 44 | |
| 45 | *** Test Cases *** |
| 46 | |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 47 | # All the test cases requires by default jumpers to be positioned |
| 48 | # between 1 & 2. If this is not met test cases would fail |
| 49 | # TODO:https://github.com/openbmc/openbmc-test-automation/issues/1644 |
| 50 | Validate Secure Cold Boot With TPM Policy Disabled |
| 51 | [Documentation] Validate secure cold boot with TPM policy disabled. |
| 52 | [Tags] Validate_Secure_Cold_Boot_With_TPM_Policy_Disabled |
Sweta Potthuri | 3925503 | 2018-03-28 10:12:14 -0500 | [diff] [blame] | 53 | |
| 54 | Validate Secure Boot With TPM Policy Enabled Or Disabled ${0} |
| 55 | |
| 56 | |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 57 | Validate Secure Cold Boot With TPM Policy Enabled |
| 58 | [Documentation] Validate secure cold boot with TPM policy enabled. |
| 59 | [Tags] Validate_Secure_Cold_Boot_With_TPM_Policy_Enabled |
Sweta Potthuri | 3925503 | 2018-03-28 10:12:14 -0500 | [diff] [blame] | 60 | |
| 61 | Validate Secure Boot With TPM Policy Enabled Or Disabled ${1} |
| 62 | |
| 63 | |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 64 | Secure Boot Violation Using Corrupt SBE Image On Cold Boot |
| 65 | [Documentation] Secure boot violation using corrupt SBE image on cold boot. |
| 66 | [Tags] Secure_Boot_Violation_Using_Corrupt_SBE_Image_On_Cold_Boot |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 67 | |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 68 | Violate Secure Boot Using Corrupt Image |
| 69 | ... SBE ${pnor_corruption_rc} ${bmc_image_dir_path} |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 70 | |
| 71 | |
devindia | 54b1393 | 2019-03-20 04:38:08 -0500 | [diff] [blame] | 72 | Secure Boot Violation Using Corrupt HBD Image On Cold Boot |
| 73 | [Documentation] Secure boot violation using corrupt HBD image on cold boot. |
| 74 | [Tags] Secure_Boot_Violation_Using_Corrupt_HBD_Image_On_Cold_Boot |
| 75 | |
| 76 | Violate Secure Boot Using Corrupt Image |
| 77 | ... HBD ${pnor_corruption_rc} ${bmc_image_dir_path} |
| 78 | |
| 79 | Secure Boot Violation Using Corrupt HBB Image On Cold Boot |
| 80 | [Documentation] Secure boot violation using corrupt HBB image on cold boot. |
| 81 | [Tags] Secure_Boot_Violation_Using_Corrupt_HBB_Image_On_Cold_Boot |
| 82 | |
| 83 | Violate Secure Boot Using Corrupt Image |
| 84 | ... HBB ${pnor_corruption_rc} ${bmc_image_dir_path} |
| 85 | |
| 86 | Secure Boot Violation Using Corrupt HBBL Image On Cold Boot |
| 87 | [Documentation] Secure boot violation using corrupt HBBL image on cold boot. |
| 88 | [Tags] Secure_Boot_Violation_Using_Corrupt_HBBL_Image_On_Cold_Boot |
| 89 | |
| 90 | Violate Secure Boot Using Corrupt Image |
| 91 | ... HBBL ${pnor_corruption_rc} ${bmc_image_dir_path} |
| 92 | |
| 93 | |
| 94 | Secure Boot Violation Using Corrupt HBI Image On Cold Boot |
| 95 | [Documentation] Secure boot violation using corrupt HBI image on cold boot. |
| 96 | [Tags] Secure_Boot_Violation_Using_Corrupt_HBI_Image_On_Cold_Boot |
| 97 | |
| 98 | Violate Secure Boot Using Corrupt Image |
| 99 | ... HBI ${pnor_corruption_rc} ${bmc_image_dir_path} |
| 100 | |
| 101 | |
| 102 | Secure Boot Violation Using Corrupt HBRT Image On Cold Boot |
| 103 | [Documentation] Secure boot violation using corrupt HBRT image on cold boot. |
| 104 | [Tags] Secure_Boot_Violation_Using_Corrupt_HBRT_Image_On_Cold_Boot |
| 105 | |
| 106 | Violate Secure Boot Using Corrupt Image |
| 107 | ... HBRT ${pnor_corruption_rc} ${bmc_image_dir_path} |
| 108 | |
| 109 | |
| 110 | Secure Boot Violation Using Corrupt OCC Image On Cold Boot |
| 111 | [Documentation] Secure boot violation using corrupt OCC image on cold boot. |
| 112 | [Tags] Secure_Boot_Violation_Using_Corrupt_OCC_Image_On_Cold_Boot |
| 113 | |
| 114 | Violate Secure Boot Using Corrupt Image |
| 115 | ... OCC ${pnor_corruption_rc} ${bmc_image_dir_path} |
| 116 | |
Sweta Potthuri | 3925503 | 2018-03-28 10:12:14 -0500 | [diff] [blame] | 117 | *** Keywords *** |
| 118 | |
Lakshminarayana R. Kammath | eca4dce | 2019-03-27 12:28:06 -0500 | [diff] [blame] | 119 | Validate Secure Boot Setup |
| 120 | [Documentation] Validates setup to make sure it's secureboot run capable. |
| 121 | |
| 122 | # Check the jumper position and Security settings before moving ahead. |
| 123 | ${num_procs} ${secureboot_state} ${jumper_state}= Get Secure Boot Info |
| 124 | |
| 125 | Rprint Vars secureboot_state jumper_state |
| 126 | |
| 127 | Should Be True ${secureboot_state} == True and ${jumper_state} == False |
Lakshminarayana R. Kammath | 0d7b6a6 | 2019-04-02 00:46:58 -0500 | [diff] [blame] | 128 | ... msg=Jumper is on while secureboot is disabled. Put the jumpers between pins 2 and 3. |
Lakshminarayana R. Kammath | eca4dce | 2019-03-27 12:28:06 -0500 | [diff] [blame] | 129 | |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 130 | Violate Secure Boot Using Corrupt Image |
| 131 | [Documentation] Cause secure boot violation during cold boot |
| 132 | ... with corrupted image. |
| 133 | [Arguments] ${partition} ${error_rc} ${bmc_image_dir_path} |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 134 | |
Gunnar Mills | 7732c7e | 2018-08-14 11:54:24 -0500 | [diff] [blame] | 135 | # Description of argument(s): |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 136 | # partition The partition which is to be corrupted |
| 137 | # (e.g. "SBE", "HBI", "HBB", "HBRT", "HBBL", "OCC"). |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 138 | # error_rc The RC that is expected as a |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 139 | # result of the secure boot violation |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 140 | # (e.g. "SECUREBOOT::RC_ROM_VERIFY"). |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 141 | # bmc_image_dir_path BMC image path. |
| 142 | |
| 143 | Set And Verify TPM Policy ${1} |
| 144 | |
| 145 | # Descipiton: |
| 146 | # Cause a secure boot violation by copying an BMC image file to the |
| 147 | # target BMC and then starting a power on. |
| 148 | # This action should result in: |
| 149 | # 1) an error log entry |
| 150 | # 2) the system going to "Quiesced" state. |
| 151 | |
| 152 | # Load corrupted image to /usr/local/share/pnor. |
| 153 | Open Connection For SCP |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 154 | |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 155 | scp.Put File |
devindia | 54b1393 | 2019-03-20 04:38:08 -0500 | [diff] [blame] | 156 | ... ${ENV_SB_CORRUPTED_BIN_PATH}/${partition} ${bmc_image_dir_path} |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 157 | |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 158 | ${error_log_path}= Catenate ${SB_LOG_DIR_PATH}/partition-corruption |
| 159 | Create Directory ${error_log_path} |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 160 | |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 161 | Set Global Variable ${error_log_path} |
| 162 | Log ${error_log_path} |
| 163 | |
| 164 | # Starting a power on. |
| 165 | # TODO: Need to move to REST Power On. Needs more testing. |
| 166 | BMC Execute Command /usr/sbin/obmcutil poweron |
| 167 | Wait Until Keyword Succeeds 15 min 15 sec Error Logs Should Exist |
| 168 | |
devindia | 54b1393 | 2019-03-20 04:38:08 -0500 | [diff] [blame] | 169 | #TODO: This will be enabled little later as more tesing required |
| 170 | #Wait Until Keyword Succeeds 5 min 5 sec |
| 171 | #... Collect Error Logs and Verify SRC ${error_rc} ${error_log_path} |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 172 | |
devindia | 54b1393 | 2019-03-20 04:38:08 -0500 | [diff] [blame] | 173 | # Expected behavior is that the error occurs early in the boot process, |
| 174 | # therefore, no entry in the error log and nothing to decode. |
| 175 | # The 1E07 error is written to PNOR & then goes into Quiesced state. |
| 176 | # On the next valid boot, the error log will be sent to BMC & |
| 177 | # seen on SOL console |
| 178 | Run Keyword If '${partition}' in '${NON_HB_PART_LIST}' |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 179 | # Verify the RC 0x1E07 in the SOL logs. |
devindia | 54b1393 | 2019-03-20 04:38:08 -0500 | [diff] [blame] | 180 | ... Get And Verify Partition Corruption ${partition} ${sol_log_file_path} |
| 181 | ... ELSE IF '${partition}' in '${HB_PART_LIST}' |
| 182 | ... Log To Console ${partition} corrupted, Going to quiesced state. |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 183 | |
| 184 | # Remove the file from /usr/local/share/pnor/. |
| 185 | BMC Execute Command rm -rf ${bmc_image_dir_path}* |
| 186 | |
| 187 | # Check if system reaches quiesce state. |
devindia | 54b1393 | 2019-03-20 04:38:08 -0500 | [diff] [blame] | 188 | # Default system state will be power off at the end of the verification. |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 189 | Run Keywords |
| 190 | ... Wait Until Keyword Succeeds 3 min 5 sec Is Host Quiesced AND |
| 191 | ... Recover Quiesced Host |
| 192 | |
devindia | 54b1393 | 2019-03-20 04:38:08 -0500 | [diff] [blame] | 193 | # We will retry boot with corrupted partition removed |
| 194 | # SOL console should show previous boot fail message (1E07) on current boot |
| 195 | # HBB corruption will never get far enough to log into PNOR. |
| 196 | # so, it should be removed from consideration for this check |
| 197 | Run Keyword If '${partition}' == 'HBB' |
| 198 | ... Log To Console No more action on ${partition} corruption required. |
| 199 | ... ELSE IF '${partition}' in '[HBD, HBI, HBRT, HBBL]' |
| 200 | ... Run Keywords |
| 201 | ... REST Power On stack_mode=skip quiet=1 AND |
| 202 | ... Wait Until Keyword Succeeds 5 min 5 sec Error Logs Should Exist AND |
| 203 | ... Get And Verify Partition Corruption ${partition} ${sol_log_file_path} AND |
| 204 | ... REST Power Off stack_mode=skip quiet=1 |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 205 | |
| 206 | Collect Error Logs and Verify SRC |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 207 | [Documentation] Verify error log entry & signature description. |
| 208 | [Arguments] ${error_rc} ${log_prefix} |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 209 | |
| 210 | # Description of argument(s): |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 211 | # error_rc Error log signature description. |
| 212 | # log_prefix Log path prefix. |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 213 | |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 214 | Error Logs Should Not Exist |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 215 | |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 216 | Collect eSEL Log ${log_prefix} |
| 217 | ${error_log_file_path}= Catenate ${log_prefix}esel.txt |
| 218 | ${rc} ${output}= Run and Return RC and Output |
| 219 | ... grep -i ${error_rc} ${error_log_file_path} |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 220 | Should Be Equal ${rc} ${0} |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 221 | Should Not Be Empty ${output} |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 222 | |
Sweta Potthuri | 3925503 | 2018-03-28 10:12:14 -0500 | [diff] [blame] | 223 | Get And Verify Security Access Bit |
| 224 | [Documentation] Get and verify security access bit. |
| 225 | [Arguments] ${sol_log_file_path} |
| 226 | |
| 227 | # Description of argument(s): |
| 228 | # sol_log_file_path The path to the file containing SOL data |
| 229 | # which was collected during a REST Power On. |
| 230 | |
| 231 | # Sample output: |
| 232 | # 19.68481|SECURE|Security Access Bit> 0xC000000000000000 |
| 233 | |
| 234 | ${cmd}= Catenate |
| 235 | ... grep "Security Access Bit" ${sol_log_file_path} | awk '{ print $4 }' |
| 236 | ${rc} ${security_access_bit_str}= Run and Return RC and Output ${cmd} |
| 237 | Should Be Equal ${rc} ${0} |
| 238 | ... msg=Return code from ${cmd} not zero. |
| 239 | |
| 240 | # Verify the value of "Security Access Bit". |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 241 | # If fails, probable issue is Jumper position. |
Sweta Potthuri | 3925503 | 2018-03-28 10:12:14 -0500 | [diff] [blame] | 242 | |
| 243 | ${security_access_bit}= Convert to Integer ${security_access_bit_str} |
| 244 | ${result}= Evaluate ${security_access_bit_mask} & ${security_access_bit} |
| 245 | Should Be Equal ${result} ${security_access_bit_mask} |
| 246 | ... msg=System is not booted in secure mode. values=False |
| 247 | |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 248 | Get And Verify Partition Corruption |
| 249 | [Documentation] Get and verify partition corruption. |
devindia | 54b1393 | 2019-03-20 04:38:08 -0500 | [diff] [blame] | 250 | [Arguments] ${partition} ${sol_log_file_path} |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 251 | |
| 252 | # Description of argument(s): |
devindia | 54b1393 | 2019-03-20 04:38:08 -0500 | [diff] [blame] | 253 | # partition The partition which is to be corrupted |
| 254 | # (e.g. "SBE", "HBI", "HBB", "HBRT", "HBBL", "OCC"). |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 255 | # sol_log_file_path The path to the file containing SOL data |
| 256 | # which was collected during a REST Power On. |
| 257 | |
| 258 | # Sample output: |
| 259 | # 44.47498|secure|Secureboot Failure plid = 0x90000007, rc = 0x1E07 |
devindia | 54b1393 | 2019-03-20 04:38:08 -0500 | [diff] [blame] | 260 | # OR |
| 261 | # 14.94315|Error reported by secure (0x1E00) PLID 0x90000002 |
| 262 | # 14.99659| ROM_verify() Call Failed |
| 263 | # 14.99659| ModuleId 0x03 SECUREBOOT::MOD_SECURE_ROM_VERIFY |
| 264 | # 14.99660| ReasonCode 0x1e07 SECUREBOOT::RC_ROM_VERIFY |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 265 | |
devindia | 54b1393 | 2019-03-20 04:38:08 -0500 | [diff] [blame] | 266 | ${cmd}= Run Keyword If '${partition}' in '${MIXED_PART_LIST}' |
| 267 | ... Catenate |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 268 | ... grep -i "Secureboot Failure" ${sol_log_file_path} | awk '{ print $8 }' |
devindia | 54b1393 | 2019-03-20 04:38:08 -0500 | [diff] [blame] | 269 | ... ELSE IF '${partition}' == 'HBI' |
| 270 | ... Catenate |
| 271 | ... grep -i "ReasonCode" ${sol_log_file_path} | awk '{ print $3 }' |
| 272 | |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 273 | ${rc} ${corruption_rc_str}= Run and Return RC and Output ${cmd} |
| 274 | Should Be Equal ${rc} ${0} |
| 275 | ... msg=Return code from ${cmd} not zero. |
| 276 | |
| 277 | # Verify the RC 0x1E07 from sol output". |
devindia | 54b1393 | 2019-03-20 04:38:08 -0500 | [diff] [blame] | 278 | Should Be Equal As Strings |
| 279 | ... ${corruption_rc_str} ${pnor_corruption_rc} ignore_case=True |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 280 | ... msg=SB violation due to PNOR partition corruption not reported. values=False |
| 281 | |
Sweta Potthuri | 3925503 | 2018-03-28 10:12:14 -0500 | [diff] [blame] | 282 | |
| 283 | Validate Secure Boot With TPM Policy Enabled Or Disabled |
| 284 | [Documentation] Validate secure boot with TPM policy enabled or disabled. |
| 285 | [Arguments] ${tpm_policy} |
| 286 | |
| 287 | # Description of argument(s): |
| 288 | # tpm_policy Enable-0 or Disable-1. |
| 289 | |
| 290 | Set And Verify TPM Policy ${tpm_policy} |
| 291 | REST Power On quiet=1 |
| 292 | Validate Secure Boot ${sol_log_file_path} |
| 293 | |
| 294 | |
| 295 | Validate Secure Boot |
| 296 | [Documentation] Validate secure boot. |
| 297 | [Arguments] ${sol_log_file_path} |
| 298 | |
| 299 | # Description of argument(s): |
| 300 | # sol_log_file_path The path to the file containing SOL data |
| 301 | # which was collected during a REST Power On. |
| 302 | |
| 303 | Get And Verify Security Access Bit ${sol_log_file_path} |
| 304 | Error Logs Should Not Exist |
| 305 | REST Verify No Gard Records |
| 306 | |
| 307 | |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 308 | Suite Setup Execution |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 309 | [Documentation] Suite Setup Execution. |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 310 | |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 311 | ${bmc_image_dir_path}= Add Trailing Slash ${bmc_image_dir_path} |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 312 | |
| 313 | ${SB_LOG_DIR_PATH}= Catenate ${EXECDIR}/SB_logs/ |
| 314 | Set Suite Variable ${SB_LOG_DIR_PATH} |
| 315 | |
| 316 | Create Directory ${SB_LOG_DIR_PATH} |
| 317 | Empty Directory ${SB_LOG_DIR_PATH} |
Lakshminarayana R. Kammath | 077fbf9 | 2019-02-20 11:15:18 -0600 | [diff] [blame] | 318 | |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 319 | Set Global Variable ${bmc_image_dir_path} |
| 320 | Log ${bmc_image_dir_path} |
| 321 | BMC Execute Command rm -rf ${bmc_image_dir_path}* |
| 322 | |
Lakshminarayana R. Kammath | 6c91829 | 2019-02-22 05:05:22 -0600 | [diff] [blame] | 323 | Set Global Variable ${bmc_guard_part_path} |
| 324 | Log ${bmc_guard_part_path} |
| 325 | BMC Execute Command rm -rf ${bmc_guard_part_path} |
Lakshminarayana R. Kammath | 077fbf9 | 2019-02-20 11:15:18 -0600 | [diff] [blame] | 326 | |
devindia | 54b1393 | 2019-03-20 04:38:08 -0500 | [diff] [blame] | 327 | # All the corrupted binaries will go in here |
| 328 | # Run this as input param |
| 329 | Should Not Be Empty ${ENV_SB_CORRUPTED_BIN_PATH} |
| 330 | Set Environment Variable PATH %{PATH}:${ENV_SB_CORRUPTED_BIN_PATH} |
| 331 | |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 332 | |
Sweta Potthuri | 3925503 | 2018-03-28 10:12:14 -0500 | [diff] [blame] | 333 | Test Setup Execution |
| 334 | [Documentation] Test setup execution. |
| 335 | |
| 336 | ${timestamp}= Get Current Date result_format=%Y%m%d%H%M%S |
| 337 | ${sol_log_file_path}= Catenate ${EXECDIR}/Secure_SOL${timestamp} |
| 338 | Start SOL Console Logging ${sol_log_file_path} |
| 339 | Set Suite Variable ${sol_log_file_path} |
| 340 | |
Lakshminarayana R. Kammath | eca4dce | 2019-03-27 12:28:06 -0500 | [diff] [blame] | 341 | REST Power On stack_mode=skip quiet=1 |
| 342 | |
| 343 | # Validate the secureboot setup. If not met with required state then, fail. |
| 344 | Validate Secure Boot Setup |
| 345 | |
Sweta Potthuri | 3925503 | 2018-03-28 10:12:14 -0500 | [diff] [blame] | 346 | REST Power Off stack_mode=skip quiet=1 |
| 347 | Delete Error Logs And Verify |
Lakshminarayana R. Kammath | 077fbf9 | 2019-02-20 11:15:18 -0600 | [diff] [blame] | 348 | |
Sweta Potthuri | 3925503 | 2018-03-28 10:12:14 -0500 | [diff] [blame] | 349 | |
Sweta Potthuri | 3925503 | 2018-03-28 10:12:14 -0500 | [diff] [blame] | 350 | Test Teardown Execution |
| 351 | [Documentation] Test teardown execution. |
| 352 | |
| 353 | Stop SOL Console Logging |
| 354 | Run rm -rf ${sol_log_file_path} |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 355 | |
devindia | 54b1393 | 2019-03-20 04:38:08 -0500 | [diff] [blame] | 356 | # Collect FFDC on failure |
| 357 | FFDC On Test Case Fail |
| 358 | |
Sweta Potthuri | d3c0343 | 2018-04-19 11:30:27 -0500 | [diff] [blame] | 359 | # Removing the corrupted file from BMC. |
| 360 | BMC Execute Command rm -rf ${bmc_image_dir_path}* |