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 | |
Michael Walsh | 5ce9805 | 2017-04-12 16:40:31 -0500 | [diff] [blame] | 26 | Library ../../lib/gen_robot_keyword.py |
| 27 | Library String |
Sweta Potthuri | 3a8ae26 | 2017-03-10 00:02:09 -0600 | [diff] [blame] | 28 | |
Michael Walsh | 5ce9805 | 2017-04-12 16:40:31 -0500 | [diff] [blame] | 29 | Resource code_update_utils.robot |
| 30 | Resource ../../lib/boot/boot_resource_master.robot |
| 31 | Resource ../../lib/state_manager.robot |
| 32 | Resource ../../lib/utils.robot |
| 33 | Resource ../../lib/openbmc_ffdc.robot |
| 34 | Resource ../../extended/obmc_boot_test_resource.robot |
| 35 | |
| 36 | Test Teardown Run Key FFDC On Test Case Fail |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 37 | |
| 38 | *** Variables *** |
| 39 | |
Michael Walsh | 5ce9805 | 2017-04-12 16:40:31 -0500 | [diff] [blame] | 40 | ${QUIET} ${1} |
| 41 | # Boot failures are not acceptable so we set the threshold to 0. |
| 42 | ${boot_fail_threshold} ${0} |
| 43 | |
| 44 | ${FILE_PATH} ${EMPTY} |
| 45 | ${FORCE_UPDATE} ${0} |
George Keishing | 80dd5af | 2017-02-08 07:01:25 -0600 | [diff] [blame] | 46 | |
| 47 | # There are two reboots issued by code update. |
Michael Walsh | 5ce9805 | 2017-04-12 16:40:31 -0500 | [diff] [blame] | 48 | ${MAX_BOOT_COUNT} ${2} |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 49 | |
Gunnar Mills | 7c8923f | 2016-12-12 21:19:52 -0600 | [diff] [blame] | 50 | *** Test Cases *** |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 51 | |
Sivas SRR | aca5571 | 2016-12-21 04:32:35 -0600 | [diff] [blame] | 52 | Test Basic BMC Performance Before Code Update |
| 53 | [Documentation] Check performance of memory, CPU & file system of BMC. |
| 54 | [Tags] Test_Basic_BMC_Performance_Before_Code_Update |
| 55 | Open Connection And Log In |
| 56 | Check BMC CPU Performance |
| 57 | Check BMC Mem Performance |
| 58 | Check BMC File System Performance |
| 59 | |
Sivas SRR | 01262bd | 2017-03-19 10:00:23 -0500 | [diff] [blame] | 60 | Check Core Dump Exist Before Code Update |
| 61 | [Documentation] Check core dump existence on BMC before code update. |
| 62 | [Tags] Check_Core_Dump_Exist_Before_Code_Update |
| 63 | Check For Core Dumps |
| 64 | |
Sivas SRR | aca5571 | 2016-12-21 04:32:35 -0600 | [diff] [blame] | 65 | Initiate Code Update BMC |
Michael Walsh | 5ce9805 | 2017-04-12 16:40:31 -0500 | [diff] [blame] | 66 | [Documentation] Initiate a code update on the BMC. |
Sivas SRR | aca5571 | 2016-12-21 04:32:35 -0600 | [diff] [blame] | 67 | [Tags] Initiate_Code_Update_BMC |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 68 | |
George Keishing | fb10f49 | 2017-03-07 21:34:18 -0600 | [diff] [blame] | 69 | # TODO: Disabling version check until new logic are in place. |
| 70 | # ${status}= Run Keyword and Return Status |
| 71 | # ... Validate BMC Version before |
| 72 | |
| 73 | # Run Keyword if '${status}' == '${False}' |
| 74 | # ... Pass Execution Same Driver version installed |
George Keishing | 50787fc | 2016-09-21 03:44:26 -0500 | [diff] [blame] | 75 | |
George Keishing | 5e78582 | 2017-04-04 10:15:50 -0500 | [diff] [blame] | 76 | # Enable user to bypass prerequisite operations. |
| 77 | # Use cases for if BMC is not in working state. |
| 78 | Run Keyword If ${FORCE_UPDATE} == ${0} |
| 79 | ... Prepare BMC For Update |
George Keishing | 2582bee | 2016-11-17 21:41:49 -0600 | [diff] [blame] | 80 | |
Michael Walsh | 5ce9805 | 2017-04-12 16:40:31 -0500 | [diff] [blame] | 81 | Run Key U Preserve BMC Network Setting |
| 82 | Run Key SCP Tar Image File To BMC \ ${FILE_PATH} |
| 83 | Run Key Activate BMC Flash Image |
| 84 | Run Key U OBMC Boot Test \ OBMC Reboot (off) |
| 85 | Run Key U Check Boot Count And Time |
George Keishing | 80dd5af | 2017-02-08 07:01:25 -0600 | [diff] [blame] | 86 | Run Keyword If ${BOOT_COUNT} == ${1} |
Michael Walsh | 5ce9805 | 2017-04-12 16:40:31 -0500 | [diff] [blame] | 87 | ... Log Boot time not updated by kernel. level=WARN |
Sivas SRR | ea85d1f | 2016-11-13 22:44:28 -0600 | [diff] [blame] | 88 | |
George Keishing | a126e21 | 2017-03-24 08:07:17 -0500 | [diff] [blame] | 89 | |
| 90 | Install BMC Debug Tarball |
| 91 | [Documentation] Install the downloaded debug tarball on BMC. |
| 92 | [Tags] Install_BMC_Debug_Tarball |
| 93 | Run Keyword If '${DEBUG_TARBALL_PATH}' != '${EMPTY}' |
| 94 | ... Install Debug Tarball On BMC ${DEBUG_TARBALL_PATH} |
| 95 | |
| 96 | |
Sivas SRR | aca5571 | 2016-12-21 04:32:35 -0600 | [diff] [blame] | 97 | Test Basic BMC Performance At Ready State |
| 98 | [Documentation] Check performance of memory, CPU & file system of BMC. |
| 99 | [Tags] Test_Basic_BMC_Performance_At_Ready_State |
George Keishing | 128643a | 2016-12-15 11:36:46 -0600 | [diff] [blame] | 100 | Open Connection And Log In |
Sivas SRR | ea85d1f | 2016-11-13 22:44:28 -0600 | [diff] [blame] | 101 | Check BMC CPU Performance |
| 102 | Check BMC Mem Performance |
Sivas SRR | aca5571 | 2016-12-21 04:32:35 -0600 | [diff] [blame] | 103 | Check BMC File System Performance |
| 104 | |
Sivas SRR | 01262bd | 2017-03-19 10:00:23 -0500 | [diff] [blame] | 105 | Check Core Dump Exist After Code Update |
| 106 | [Documentation] Check core dump existence on BMC after code update. |
| 107 | [Tags] Check_Core_Dump_Exist_After_Code_Update |
| 108 | Check For Core Dumps |
| 109 | |
| 110 | Enable Core Dump File Size To Be Unlimited |
| 111 | [Documentation] Set core dump file size to unlimited. |
| 112 | [Tags] Enable_Core_Dump_File_size_To_Be_unlimited |
| 113 | Set Core Dump File Size Unlimited |
| 114 | |
George Keishing | 80dd5af | 2017-02-08 07:01:25 -0600 | [diff] [blame] | 115 | *** Keywords *** |
| 116 | |
George Keishing | 5e78582 | 2017-04-04 10:15:50 -0500 | [diff] [blame] | 117 | Prepare BMC For Update |
| 118 | [Documentation] Prerequisite operation before code update. |
| 119 | Check Boot Count And Time |
| 120 | Prune Journal Log |
| 121 | Power Off Request |
| 122 | Set Policy Setting RESTORE_LAST_STATE |
| 123 | Prepare For Update |
| 124 | Check If BMC is Up 20 min 10 sec |
| 125 | Check Boot Count And Time |
| 126 | |
| 127 | # Temporary fix for lab migration for driver which is booted with |
| 128 | # BMC state "/xyz/openbmc_project/state/BMC0/". |
| 129 | ${status}= Run Keyword And Return Status Temp BMC URI Check |
| 130 | Run Keyword If '${status}' == '${False}' |
| 131 | ... Wait For BMC Ready |
| 132 | ... ELSE Wait For Temp BMC Ready |
| 133 | |
| 134 | # TODO: openbmc/openbmc#815 |
| 135 | Sleep 1 min |
| 136 | |
| 137 | |
George Keishing | 80dd5af | 2017-02-08 07:01:25 -0600 | [diff] [blame] | 138 | Check Boot Count And Time |
| 139 | [Documentation] Check for unexpected reboots. |
| 140 | Set BMC Reset Reference Time |
| 141 | Log To Console \n Boot Count: ${BOOT_COUNT} |
| 142 | Log To Console \n Boot Time: ${BOOT_TIME} |
| 143 | Run Keyword If ${BOOT_COUNT} > ${MAX_BOOT_COUNT} |
| 144 | ... Log Phantom Reboot!!! Unexpected reboot detected level=WARN |
| 145 | |
George Keishing | 3cb1ade | 2017-03-23 09:03:06 -0500 | [diff] [blame] | 146 | Temp BMC URI Check |
| 147 | [Documentation] Check for transient "BMC0" interface. |
| 148 | ${resp}= Openbmc Get Request /xyz/openbmc_project/state/BMC0/ |
| 149 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 150 | |
| 151 | Check Temp BMC State |
| 152 | [Documentation] BMC state should be "Ready". |
| 153 | # quiet - Suppress REST output logging to console. |
| 154 | ${state}= |
| 155 | ... Read Attribute /xyz/openbmc_project/state/BMC0/ CurrentBMCState |
| 156 | Should Be Equal Ready ${state.rsplit('.', 1)[1]} |
| 157 | |
| 158 | Wait For Temp BMC Ready |
| 159 | [Documentation] Check for BMC "Ready" until timedout. |
| 160 | Wait Until Keyword Succeeds |
| 161 | ... 10 min 10 sec Check Temp BMC State |
| 162 | |