blob: 00ad0ab281e4b42963e713b0a02dd7414f9b10ac [file] [log] [blame]
George Keishing5e870cd2016-08-24 10:05:47 -05001*** Settings ***
2Documentation 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 Keishing8db0e1b2016-10-20 13:46:54 -050011... - 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 Keishingdc5aa58e92016-09-27 01:35:11 -050014... - Issue poweroff
George Keishing0bd59f12016-12-14 10:39:21 -060015... - Prune archived journal logs
George Keishingdc5aa58e92016-09-27 01:35:11 -050016... - Prepare for Update
George Keishingdc5aa58e92016-09-27 01:35:11 -050017... - Wait for BMC to come online clean
George Keishing1b150202016-09-29 08:51:58 -050018... - Wait for BMC_READY state
George Keishing5e870cd2016-08-24 10:05:47 -050019... - 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
26Resource code_update_utils.robot
George Keishing8db0e1b2016-10-20 13:46:54 -050027Resource ../../lib/boot/boot_resource_master.robot
George Keishing43a021f2017-01-30 11:10:13 -060028Resource ../../lib/state_manager.robot
George Keishing80dd5af2017-02-08 07:01:25 -060029Resource ../../lib/utils.robot
Sweta Potthuri3a8ae262017-03-10 00:02:09 -060030Resource ../../lib/openbmc_ffdc.robot
31
32Test Teardown FFDC On Test Case Fail
George Keishing5e870cd2016-08-24 10:05:47 -050033
34*** Variables ***
35
George Keishing80dd5af2017-02-08 07:01:25 -060036${FILE_PATH} ${EMPTY}
37
38# There are two reboots issued by code update.
39${MAX_BOOT_COUNT} ${2}
George Keishing5e870cd2016-08-24 10:05:47 -050040
Gunnar Mills7c8923f2016-12-12 21:19:52 -060041*** Test Cases ***
George Keishing5e870cd2016-08-24 10:05:47 -050042
Sivas SRRaca55712016-12-21 04:32:35 -060043Test 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
51Initiate Code Update BMC
George Keishing43a021f2017-01-30 11:10:13 -060052 [Documentation] BMC code update process initiation
53 [Setup] Set State Interface Version
Sivas SRRaca55712016-12-21 04:32:35 -060054 [Tags] Initiate_Code_Update_BMC
George Keishing5e870cd2016-08-24 10:05:47 -050055
George Keishing43a021f2017-01-30 11:10:13 -060056 Check If File Exist ${FILE_PATH}
George Keishing5e870cd2016-08-24 10:05:47 -050057 System Readiness Test
George Keishing50787fc2016-09-21 03:44:26 -050058
George Keishingfb10f492017-03-07 21:34:18 -060059 # TODO: Disabling version check until new logic are in place.
60 # ${status}= Run Keyword and Return Status
61 # ... Validate BMC Version before
62
63 # Run Keyword if '${status}' == '${False}'
64 # ... Pass Execution Same Driver version installed
George Keishing50787fc2016-09-21 03:44:26 -050065
George Keishing80dd5af2017-02-08 07:01:25 -060066 Check Boot Count And Time
George Keishing0bd59f12016-12-14 10:39:21 -060067 Prune Journal Log
George Keishing43a021f2017-01-30 11:10:13 -060068 Power Off Request
Rahul Maheshwari4c1b99f2016-12-19 17:52:04 -060069 Run Keyword And Ignore Error
70 ... Set Policy Setting RESTORE_LAST_STATE
George Keishingdc5aa58e92016-09-27 01:35:11 -050071 Prepare For Update
Rahul Maheshwarid0fd8832016-10-14 03:15:51 -050072
Michael Walsh2b70ead2017-02-20 16:27:11 -060073 Check If BMC is Up 20 min 10 sec
George Keishing80dd5af2017-02-08 07:01:25 -060074 Check Boot Count And Time
George Keishing5e870cd2016-08-24 10:05:47 -050075
George Keishing43a021f2017-01-30 11:10:13 -060076 Wait For BMC Ready
George Keishing1b150202016-09-29 08:51:58 -050077
George Keishing2582bee2016-11-17 21:41:49 -060078 # TODO: openbmc/openbmc#815
79 Sleep 1 min
80
George Keishing5e870cd2016-08-24 10:05:47 -050081 Preserve BMC Network Setting
82 SCP Tar Image File to BMC ${FILE_PATH}
83
84 Activate BMC flash image
85
George Keishingb3700812016-08-31 03:03:30 -050086 Run Keyword And Ignore Error Trigger Warm Reset
George Keishingf68c9eb2016-12-01 08:09:58 -060087 # Warm reset adds 3 seconds delay before forcing reboot
88 # To minimize race conditions, we wait for 7 seconds
89 Sleep 7s
George Keishing5e870cd2016-08-24 10:05:47 -050090 ${session_active}= Check If warmReset is Initiated
91 Run Keyword If '${session_active}' == '${True}'
92 ... Trigger Warm Reset via Reboot
93
George Keishingc4d3dc02016-09-19 03:45:55 -050094 Check If BMC is Up 30 min 10 sec
George Keishing80dd5af2017-02-08 07:01:25 -060095 Check Boot Count And Time
George Keishing5e870cd2016-08-24 10:05:47 -050096 Sleep 1 min
George Keishingfb10f492017-03-07 21:34:18 -060097 # Validate BMC Version
George Keishing43a021f2017-01-30 11:10:13 -060098
99 # Now that the code update is completed, make sure we use the correct
100 # interface while checking for BMC ready state.
101 Set State Interface Version
102 Wait For BMC Ready
George Keishing80dd5af2017-02-08 07:01:25 -0600103 Check Boot Count And Time
104 Run Keyword If ${BOOT_COUNT} == ${1}
105 ... Log Boot Time not Updated by Kernel!!! level=WARN
Sivas SRRea85d1f2016-11-13 22:44:28 -0600106
Sivas SRRaca55712016-12-21 04:32:35 -0600107
108Test Basic BMC Performance At Ready State
109 [Documentation] Check performance of memory, CPU & file system of BMC.
110 [Tags] Test_Basic_BMC_Performance_At_Ready_State
George Keishing128643a2016-12-15 11:36:46 -0600111 Open Connection And Log In
Sivas SRRea85d1f2016-11-13 22:44:28 -0600112 Check BMC CPU Performance
113 Check BMC Mem Performance
Sivas SRRaca55712016-12-21 04:32:35 -0600114 Check BMC File System Performance
115
George Keishing80dd5af2017-02-08 07:01:25 -0600116*** Keywords ***
117
118Check Boot Count And Time
119 [Documentation] Check for unexpected reboots.
120 Set BMC Reset Reference Time
121 Log To Console \n Boot Count: ${BOOT_COUNT}
122 Log To Console \n Boot Time: ${BOOT_TIME}
123 Run Keyword If ${BOOT_COUNT} > ${MAX_BOOT_COUNT}
124 ... Log Phantom Reboot!!! Unexpected reboot detected level=WARN
125