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 | |
Sivas SRR | aca5571 | 2016-12-21 04:32:35 -0600 | [diff] [blame] | 89 | Test Basic BMC Performance At Ready State |
| 90 | [Documentation] Check performance of memory, CPU & file system of BMC. |
| 91 | [Tags] Test_Basic_BMC_Performance_At_Ready_State |
George Keishing | 128643a | 2016-12-15 11:36:46 -0600 | [diff] [blame] | 92 | Open Connection And Log In |
Sivas SRR | ea85d1f | 2016-11-13 22:44:28 -0600 | [diff] [blame] | 93 | Check BMC CPU Performance |
| 94 | Check BMC Mem Performance |
Sivas SRR | aca5571 | 2016-12-21 04:32:35 -0600 | [diff] [blame] | 95 | Check BMC File System Performance |
| 96 | |
Sivas SRR | 01262bd | 2017-03-19 10:00:23 -0500 | [diff] [blame] | 97 | Check Core Dump Exist After Code Update |
| 98 | [Documentation] Check core dump existence on BMC after code update. |
| 99 | [Tags] Check_Core_Dump_Exist_After_Code_Update |
| 100 | Check For Core Dumps |
| 101 | |
| 102 | Enable Core Dump File Size To Be Unlimited |
| 103 | [Documentation] Set core dump file size to unlimited. |
| 104 | [Tags] Enable_Core_Dump_File_size_To_Be_unlimited |
| 105 | Set Core Dump File Size Unlimited |
| 106 | |
George Keishing | 80dd5af | 2017-02-08 07:01:25 -0600 | [diff] [blame] | 107 | *** Keywords *** |
| 108 | |
George Keishing | 5e78582 | 2017-04-04 10:15:50 -0500 | [diff] [blame] | 109 | Prepare BMC For Update |
| 110 | [Documentation] Prerequisite operation before code update. |
| 111 | Check Boot Count And Time |
| 112 | Prune Journal Log |
| 113 | Power Off Request |
| 114 | Set Policy Setting RESTORE_LAST_STATE |
| 115 | Prepare For Update |
| 116 | Check If BMC is Up 20 min 10 sec |
| 117 | Check Boot Count And Time |
| 118 | |
| 119 | # Temporary fix for lab migration for driver which is booted with |
| 120 | # BMC state "/xyz/openbmc_project/state/BMC0/". |
| 121 | ${status}= Run Keyword And Return Status Temp BMC URI Check |
| 122 | Run Keyword If '${status}' == '${False}' |
| 123 | ... Wait For BMC Ready |
| 124 | ... ELSE Wait For Temp BMC Ready |
| 125 | |
| 126 | # TODO: openbmc/openbmc#815 |
| 127 | Sleep 1 min |
| 128 | |
| 129 | |
George Keishing | 80dd5af | 2017-02-08 07:01:25 -0600 | [diff] [blame] | 130 | Check Boot Count And Time |
| 131 | [Documentation] Check for unexpected reboots. |
| 132 | Set BMC Reset Reference Time |
| 133 | Log To Console \n Boot Count: ${BOOT_COUNT} |
| 134 | Log To Console \n Boot Time: ${BOOT_TIME} |
| 135 | Run Keyword If ${BOOT_COUNT} > ${MAX_BOOT_COUNT} |
| 136 | ... Log Phantom Reboot!!! Unexpected reboot detected level=WARN |
| 137 | |
George Keishing | 3cb1ade | 2017-03-23 09:03:06 -0500 | [diff] [blame] | 138 | Temp BMC URI Check |
| 139 | [Documentation] Check for transient "BMC0" interface. |
| 140 | ${resp}= Openbmc Get Request /xyz/openbmc_project/state/BMC0/ |
| 141 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 142 | |
| 143 | Check Temp BMC State |
| 144 | [Documentation] BMC state should be "Ready". |
| 145 | # quiet - Suppress REST output logging to console. |
| 146 | ${state}= |
| 147 | ... Read Attribute /xyz/openbmc_project/state/BMC0/ CurrentBMCState |
| 148 | Should Be Equal Ready ${state.rsplit('.', 1)[1]} |
| 149 | |
| 150 | Wait For Temp BMC Ready |
| 151 | [Documentation] Check for BMC "Ready" until timedout. |
| 152 | Wait Until Keyword Succeeds |
| 153 | ... 10 min 10 sec Check Temp BMC State |
| 154 | |