George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Trigger code update to a target BMC. |
| 3 | ... Execution Method : |
| 4 | ... python -m robot -v OPENBMC_HOST:<hostname> |
| 5 | ... -v FILE_PATH:<path/*all.tar> update_bmc.robot |
| 6 | ... |
| 7 | ... Code update method BMC using REST |
| 8 | ... Update work flow sequence: |
| 9 | ... - User input BMC File existence check |
| 10 | ... - Ping Test and REST authentication |
George Keishing | 8db0e1b | 2016-10-20 13:46:54 -0500 | [diff] [blame] | 11 | ... - Set Host Power host setting Policy to RESTORE_LAST_STATE |
| 12 | ... On reboot this policy would ensure the BMC comes |
| 13 | ... online and stays at HOST_POWERED_OFF state. |
George Keishing | dc5aa58e9 | 2016-09-27 01:35:11 -0500 | [diff] [blame] | 14 | ... - Issue poweroff |
George Keishing | 0bd59f1 | 2016-12-14 10:39:21 -0600 | [diff] [blame] | 15 | ... - Prune archived journal logs |
George Keishing | dc5aa58e9 | 2016-09-27 01:35:11 -0500 | [diff] [blame] | 16 | ... - Prepare for Update |
George Keishing | dc5aa58e9 | 2016-09-27 01:35:11 -0500 | [diff] [blame] | 17 | ... - Wait for BMC to come online clean |
George Keishing | 1b15020 | 2016-09-29 08:51:58 -0500 | [diff] [blame] | 18 | ... - Wait for BMC_READY state |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 19 | ... - Apply preserve BMC Network setting |
| 20 | ... - SCP image to BMC |
| 21 | ... - Activate the flash image |
| 22 | ... - Warm Reset BMC to activate code |
| 23 | ... - Wait for BMC to come online time out 30 minutes |
| 24 | ... - Version check post update |
| 25 | |
| 26 | Resource code_update_utils.robot |
George Keishing | 43a021f | 2017-01-30 11:10:13 -0600 | [diff] [blame] | 27 | Resource ../../lib/state_manager.robot |
George Keishing | 80dd5af | 2017-02-08 07:01:25 -0600 | [diff] [blame] | 28 | Resource ../../lib/utils.robot |
Sweta Potthuri | 3a8ae26 | 2017-03-10 00:02:09 -0600 | [diff] [blame] | 29 | Resource ../../lib/openbmc_ffdc.robot |
| 30 | |
| 31 | Test Teardown FFDC On Test Case Fail |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 32 | |
| 33 | *** Variables *** |
| 34 | |
George Keishing | 80dd5af | 2017-02-08 07:01:25 -0600 | [diff] [blame] | 35 | ${FILE_PATH} ${EMPTY} |
George Keishing | 5e78582 | 2017-04-04 10:15:50 -0500 | [diff] [blame] | 36 | ${FORCE_UPDATE} ${0} |
George Keishing | 80dd5af | 2017-02-08 07:01:25 -0600 | [diff] [blame] | 37 | |
| 38 | # There are two reboots issued by code update. |
| 39 | ${MAX_BOOT_COUNT} ${2} |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 40 | |
Gunnar Mills | 7c8923f | 2016-12-12 21:19:52 -0600 | [diff] [blame] | 41 | *** Test Cases *** |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 42 | |
Sivas SRR | aca5571 | 2016-12-21 04:32:35 -0600 | [diff] [blame] | 43 | Test Basic BMC Performance Before Code Update |
| 44 | [Documentation] Check performance of memory, CPU & file system of BMC. |
| 45 | [Tags] Test_Basic_BMC_Performance_Before_Code_Update |
| 46 | Open Connection And Log In |
| 47 | Check BMC CPU Performance |
| 48 | Check BMC Mem Performance |
| 49 | Check BMC File System Performance |
| 50 | |
Sivas SRR | 01262bd | 2017-03-19 10:00:23 -0500 | [diff] [blame] | 51 | Check Core Dump Exist Before Code Update |
| 52 | [Documentation] Check core dump existence on BMC before code update. |
| 53 | [Tags] Check_Core_Dump_Exist_Before_Code_Update |
| 54 | Check For Core Dumps |
| 55 | |
Sivas SRR | aca5571 | 2016-12-21 04:32:35 -0600 | [diff] [blame] | 56 | Initiate Code Update BMC |
George Keishing | 43a021f | 2017-01-30 11:10:13 -0600 | [diff] [blame] | 57 | [Documentation] BMC code update process initiation |
| 58 | [Setup] Set State Interface Version |
Sivas SRR | aca5571 | 2016-12-21 04:32:35 -0600 | [diff] [blame] | 59 | [Tags] Initiate_Code_Update_BMC |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 60 | |
George Keishing | 43a021f | 2017-01-30 11:10:13 -0600 | [diff] [blame] | 61 | Check If File Exist ${FILE_PATH} |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 62 | System Readiness Test |
George Keishing | 50787fc | 2016-09-21 03:44:26 -0500 | [diff] [blame] | 63 | |
George Keishing | fb10f49 | 2017-03-07 21:34:18 -0600 | [diff] [blame] | 64 | # TODO: Disabling version check until new logic are in place. |
| 65 | # ${status}= Run Keyword and Return Status |
| 66 | # ... Validate BMC Version before |
| 67 | |
| 68 | # Run Keyword if '${status}' == '${False}' |
| 69 | # ... Pass Execution Same Driver version installed |
George Keishing | 50787fc | 2016-09-21 03:44:26 -0500 | [diff] [blame] | 70 | |
George Keishing | 5e78582 | 2017-04-04 10:15:50 -0500 | [diff] [blame] | 71 | # Enable user to bypass prerequisite operations. |
| 72 | # Use cases for if BMC is not in working state. |
| 73 | Run Keyword If ${FORCE_UPDATE} == ${0} |
| 74 | ... Prepare BMC For Update |
George Keishing | 2582bee | 2016-11-17 21:41:49 -0600 | [diff] [blame] | 75 | |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 76 | Preserve BMC Network Setting |
| 77 | SCP Tar Image File to BMC ${FILE_PATH} |
| 78 | |
| 79 | Activate BMC flash image |
| 80 | |
George Keishing | b370081 | 2016-08-31 03:03:30 -0500 | [diff] [blame] | 81 | Run Keyword And Ignore Error Trigger Warm Reset |
George Keishing | f68c9eb | 2016-12-01 08:09:58 -0600 | [diff] [blame] | 82 | # Warm reset adds 3 seconds delay before forcing reboot |
| 83 | # To minimize race conditions, we wait for 7 seconds |
| 84 | Sleep 7s |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 85 | ${session_active}= Check If warmReset is Initiated |
| 86 | Run Keyword If '${session_active}' == '${True}' |
| 87 | ... Trigger Warm Reset via Reboot |
| 88 | |
George Keishing | c4d3dc0 | 2016-09-19 03:45:55 -0500 | [diff] [blame] | 89 | Check If BMC is Up 30 min 10 sec |
George Keishing | 80dd5af | 2017-02-08 07:01:25 -0600 | [diff] [blame] | 90 | Check Boot Count And Time |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 91 | Sleep 1 min |
George Keishing | fb10f49 | 2017-03-07 21:34:18 -0600 | [diff] [blame] | 92 | # Validate BMC Version |
George Keishing | 43a021f | 2017-01-30 11:10:13 -0600 | [diff] [blame] | 93 | |
| 94 | # Now that the code update is completed, make sure we use the correct |
| 95 | # interface while checking for BMC ready state. |
| 96 | Set State Interface Version |
| 97 | Wait For BMC Ready |
George Keishing | 80dd5af | 2017-02-08 07:01:25 -0600 | [diff] [blame] | 98 | Check Boot Count And Time |
| 99 | Run Keyword If ${BOOT_COUNT} == ${1} |
| 100 | ... Log Boot Time not Updated by Kernel!!! level=WARN |
Sivas SRR | ea85d1f | 2016-11-13 22:44:28 -0600 | [diff] [blame] | 101 | |
Sivas SRR | aca5571 | 2016-12-21 04:32:35 -0600 | [diff] [blame] | 102 | Test Basic BMC Performance At Ready State |
| 103 | [Documentation] Check performance of memory, CPU & file system of BMC. |
| 104 | [Tags] Test_Basic_BMC_Performance_At_Ready_State |
George Keishing | 128643a | 2016-12-15 11:36:46 -0600 | [diff] [blame] | 105 | Open Connection And Log In |
Sivas SRR | ea85d1f | 2016-11-13 22:44:28 -0600 | [diff] [blame] | 106 | Check BMC CPU Performance |
| 107 | Check BMC Mem Performance |
Sivas SRR | aca5571 | 2016-12-21 04:32:35 -0600 | [diff] [blame] | 108 | Check BMC File System Performance |
| 109 | |
Sivas SRR | 01262bd | 2017-03-19 10:00:23 -0500 | [diff] [blame] | 110 | Check Core Dump Exist After Code Update |
| 111 | [Documentation] Check core dump existence on BMC after code update. |
| 112 | [Tags] Check_Core_Dump_Exist_After_Code_Update |
| 113 | Check For Core Dumps |
| 114 | |
| 115 | Enable Core Dump File Size To Be Unlimited |
| 116 | [Documentation] Set core dump file size to unlimited. |
| 117 | [Tags] Enable_Core_Dump_File_size_To_Be_unlimited |
| 118 | Set Core Dump File Size Unlimited |
| 119 | |
George Keishing | 80dd5af | 2017-02-08 07:01:25 -0600 | [diff] [blame] | 120 | *** Keywords *** |
| 121 | |
George Keishing | 5e78582 | 2017-04-04 10:15:50 -0500 | [diff] [blame] | 122 | Prepare BMC For Update |
| 123 | [Documentation] Prerequisite operation before code update. |
| 124 | Check Boot Count And Time |
| 125 | Prune Journal Log |
| 126 | Power Off Request |
| 127 | Set Policy Setting RESTORE_LAST_STATE |
| 128 | Prepare For Update |
| 129 | Check If BMC is Up 20 min 10 sec |
| 130 | Check Boot Count And Time |
| 131 | |
| 132 | # Temporary fix for lab migration for driver which is booted with |
| 133 | # BMC state "/xyz/openbmc_project/state/BMC0/". |
| 134 | ${status}= Run Keyword And Return Status Temp BMC URI Check |
| 135 | Run Keyword If '${status}' == '${False}' |
| 136 | ... Wait For BMC Ready |
| 137 | ... ELSE Wait For Temp BMC Ready |
| 138 | |
| 139 | # TODO: openbmc/openbmc#815 |
| 140 | Sleep 1 min |
| 141 | |
| 142 | |
George Keishing | 80dd5af | 2017-02-08 07:01:25 -0600 | [diff] [blame] | 143 | Check Boot Count And Time |
| 144 | [Documentation] Check for unexpected reboots. |
| 145 | Set BMC Reset Reference Time |
| 146 | Log To Console \n Boot Count: ${BOOT_COUNT} |
| 147 | Log To Console \n Boot Time: ${BOOT_TIME} |
| 148 | Run Keyword If ${BOOT_COUNT} > ${MAX_BOOT_COUNT} |
| 149 | ... Log Phantom Reboot!!! Unexpected reboot detected level=WARN |
| 150 | |
George Keishing | 3cb1ade | 2017-03-23 09:03:06 -0500 | [diff] [blame] | 151 | Temp BMC URI Check |
| 152 | [Documentation] Check for transient "BMC0" interface. |
| 153 | ${resp}= Openbmc Get Request /xyz/openbmc_project/state/BMC0/ |
| 154 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 155 | |
| 156 | Check Temp BMC State |
| 157 | [Documentation] BMC state should be "Ready". |
| 158 | # quiet - Suppress REST output logging to console. |
| 159 | ${state}= |
| 160 | ... Read Attribute /xyz/openbmc_project/state/BMC0/ CurrentBMCState |
| 161 | Should Be Equal Ready ${state.rsplit('.', 1)[1]} |
| 162 | |
| 163 | Wait For Temp BMC Ready |
| 164 | [Documentation] Check for BMC "Ready" until timedout. |
| 165 | Wait Until Keyword Succeeds |
| 166 | ... 10 min 10 sec Check Temp BMC State |
| 167 | |