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 | efc3ff2 | 2017-12-12 11:49:25 -0600 | [diff] [blame] | 11 | ... - Set Host Power host setting Policy to ALWAYS_POWER_OFF |
George Keishing | 8db0e1b | 2016-10-20 13:46:54 -0500 | [diff] [blame] | 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 |
Rahul Maheshwari | 724e591 | 2017-04-20 06:04:37 -0500 | [diff] [blame] | 25 | ... - Identify REST url post update |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 26 | |
Michael Walsh | 5ce9805 | 2017-04-12 16:40:31 -0500 | [diff] [blame] | 27 | Library ../../lib/gen_robot_keyword.py |
| 28 | Library String |
Sweta Potthuri | 3a8ae26 | 2017-03-10 00:02:09 -0600 | [diff] [blame] | 29 | |
Michael Walsh | 5ce9805 | 2017-04-12 16:40:31 -0500 | [diff] [blame] | 30 | Resource code_update_utils.robot |
Michael Walsh | 5ce9805 | 2017-04-12 16:40:31 -0500 | [diff] [blame] | 31 | Resource ../../lib/state_manager.robot |
| 32 | Resource ../../lib/utils.robot |
Rahul Maheshwari | 724e591 | 2017-04-20 06:04:37 -0500 | [diff] [blame] | 33 | Resource ../../lib/list_utils.robot |
Michael Walsh | 5ce9805 | 2017-04-12 16:40:31 -0500 | [diff] [blame] | 34 | Resource ../../lib/openbmc_ffdc.robot |
| 35 | Resource ../../extended/obmc_boot_test_resource.robot |
| 36 | |
| 37 | Test Teardown Run Key FFDC On Test Case Fail |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 38 | |
| 39 | *** Variables *** |
| 40 | |
Michael Walsh | 5ce9805 | 2017-04-12 16:40:31 -0500 | [diff] [blame] | 41 | ${QUIET} ${1} |
| 42 | # Boot failures are not acceptable so we set the threshold to 0. |
| 43 | ${boot_fail_threshold} ${0} |
| 44 | |
| 45 | ${FILE_PATH} ${EMPTY} |
| 46 | ${FORCE_UPDATE} ${0} |
Rahul Maheshwari | 724e591 | 2017-04-20 06:04:37 -0500 | [diff] [blame] | 47 | ${REST_URL_FILE_PATH} ${EMPTY} |
George Keishing | 80dd5af | 2017-02-08 07:01:25 -0600 | [diff] [blame] | 48 | |
| 49 | # There are two reboots issued by code update. |
Michael Walsh | 5ce9805 | 2017-04-12 16:40:31 -0500 | [diff] [blame] | 50 | ${MAX_BOOT_COUNT} ${2} |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 51 | |
Gunnar Mills | 7c8923f | 2016-12-12 21:19:52 -0600 | [diff] [blame] | 52 | *** Test Cases *** |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 53 | |
Sivas SRR | aca5571 | 2016-12-21 04:32:35 -0600 | [diff] [blame] | 54 | Initiate Code Update BMC |
Michael Walsh | 5ce9805 | 2017-04-12 16:40:31 -0500 | [diff] [blame] | 55 | [Documentation] Initiate a code update on the BMC. |
Sivas SRR | aca5571 | 2016-12-21 04:32:35 -0600 | [diff] [blame] | 56 | [Tags] Initiate_Code_Update_BMC |
George Keishing | 5e870cd | 2016-08-24 10:05:47 -0500 | [diff] [blame] | 57 | |
George Keishing | 830211e | 2017-07-19 08:44:07 -0500 | [diff] [blame] | 58 | ${status}= Run Keyword If '${LAST_KNOWN_GOOD_VERSION}' != '${EMPTY}' |
| 59 | ... Run Keyword And Return Status |
| 60 | ... Validate BMC Version ${LAST_KNOWN_GOOD_VERSION} |
George Keishing | fb10f49 | 2017-03-07 21:34:18 -0600 | [diff] [blame] | 61 | |
George Keishing | 830211e | 2017-07-19 08:44:07 -0500 | [diff] [blame] | 62 | Run Keyword if '${status}' == '${True}' |
| 63 | ... Pass Execution The BMC already has the requested build loaded so no further action will be taken. |
George Keishing | 50787fc | 2016-09-21 03:44:26 -0500 | [diff] [blame] | 64 | |
George Keishing | 5e78582 | 2017-04-04 10:15:50 -0500 | [diff] [blame] | 65 | # Enable user to bypass prerequisite operations. |
| 66 | # Use cases for if BMC is not in working state. |
| 67 | Run Keyword If ${FORCE_UPDATE} == ${0} |
| 68 | ... Prepare BMC For Update |
George Keishing | 2582bee | 2016-11-17 21:41:49 -0600 | [diff] [blame] | 69 | |
Michael Walsh | 5ce9805 | 2017-04-12 16:40:31 -0500 | [diff] [blame] | 70 | Run Key U Preserve BMC Network Setting |
| 71 | Run Key SCP Tar Image File To BMC \ ${FILE_PATH} |
| 72 | Run Key Activate BMC Flash Image |
| 73 | Run Key U OBMC Boot Test \ OBMC Reboot (off) |
| 74 | Run Key U Check Boot Count And Time |
George Keishing | 80dd5af | 2017-02-08 07:01:25 -0600 | [diff] [blame] | 75 | Run Keyword If ${BOOT_COUNT} == ${1} |
Michael Walsh | 5ce9805 | 2017-04-12 16:40:31 -0500 | [diff] [blame] | 76 | ... Log Boot time not updated by kernel. level=WARN |
Sivas SRR | ea85d1f | 2016-11-13 22:44:28 -0600 | [diff] [blame] | 77 | |
George Keishing | 80dd5af | 2017-02-08 07:01:25 -0600 | [diff] [blame] | 78 | *** Keywords *** |
| 79 | |
George Keishing | 5e78582 | 2017-04-04 10:15:50 -0500 | [diff] [blame] | 80 | Prepare BMC For Update |
| 81 | [Documentation] Prerequisite operation before code update. |
| 82 | Check Boot Count And Time |
| 83 | Prune Journal Log |
| 84 | Power Off Request |
George Keishing | efc3ff2 | 2017-12-12 11:49:25 -0600 | [diff] [blame] | 85 | Set BMC Power Policy ALWAYS_POWER_OFF |
George Keishing | d85b28f | 2017-08-17 00:31:54 -0500 | [diff] [blame] | 86 | |
George Keishing | 5e78582 | 2017-04-04 10:15:50 -0500 | [diff] [blame] | 87 | Prepare For Update |
| 88 | Check If BMC is Up 20 min 10 sec |
| 89 | Check Boot Count And Time |
| 90 | |
| 91 | # Temporary fix for lab migration for driver which is booted with |
| 92 | # BMC state "/xyz/openbmc_project/state/BMC0/". |
| 93 | ${status}= Run Keyword And Return Status Temp BMC URI Check |
| 94 | Run Keyword If '${status}' == '${False}' |
| 95 | ... Wait For BMC Ready |
| 96 | ... ELSE Wait For Temp BMC Ready |
| 97 | |
George Keishing | 80dd5af | 2017-02-08 07:01:25 -0600 | [diff] [blame] | 98 | Check Boot Count And Time |
| 99 | [Documentation] Check for unexpected reboots. |
| 100 | Set BMC Reset Reference Time |
| 101 | Log To Console \n Boot Count: ${BOOT_COUNT} |
| 102 | Log To Console \n Boot Time: ${BOOT_TIME} |
| 103 | Run Keyword If ${BOOT_COUNT} > ${MAX_BOOT_COUNT} |
| 104 | ... Log Phantom Reboot!!! Unexpected reboot detected level=WARN |
| 105 | |
George Keishing | 3cb1ade | 2017-03-23 09:03:06 -0500 | [diff] [blame] | 106 | Temp BMC URI Check |
| 107 | [Documentation] Check for transient "BMC0" interface. |
| 108 | ${resp}= Openbmc Get Request /xyz/openbmc_project/state/BMC0/ |
| 109 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 110 | |
George Keishing | 3cb1ade | 2017-03-23 09:03:06 -0500 | [diff] [blame] | 111 | Wait For Temp BMC Ready |
| 112 | [Documentation] Check for BMC "Ready" until timedout. |
| 113 | Wait Until Keyword Succeeds |
| 114 | ... 10 min 10 sec Check Temp BMC State |