blob: 9ba485b318fa57cc1755da52ea5bb964f21a44de [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 Keishing43a021f2017-01-30 11:10:13 -060027Resource ../../lib/state_manager.robot
George Keishing80dd5af2017-02-08 07:01:25 -060028Resource ../../lib/utils.robot
Sweta Potthuri3a8ae262017-03-10 00:02:09 -060029Resource ../../lib/openbmc_ffdc.robot
30
Sivas SRR5a40e7f2017-04-02 23:16:48 -050031Library String
32Suite Setup Validate BMC Image File Name ${FILE_PATH}
33
Sweta Potthuri3a8ae262017-03-10 00:02:09 -060034Test Teardown FFDC On Test Case Fail
George Keishing5e870cd2016-08-24 10:05:47 -050035
36*** Variables ***
37
George Keishing80dd5af2017-02-08 07:01:25 -060038${FILE_PATH} ${EMPTY}
George Keishing5e785822017-04-04 10:15:50 -050039${FORCE_UPDATE} ${0}
George Keishing80dd5af2017-02-08 07:01:25 -060040
41# There are two reboots issued by code update.
42${MAX_BOOT_COUNT} ${2}
George Keishing5e870cd2016-08-24 10:05:47 -050043
Gunnar Mills7c8923f2016-12-12 21:19:52 -060044*** Test Cases ***
George Keishing5e870cd2016-08-24 10:05:47 -050045
Sivas SRRaca55712016-12-21 04:32:35 -060046Test Basic BMC Performance Before Code Update
47 [Documentation] Check performance of memory, CPU & file system of BMC.
48 [Tags] Test_Basic_BMC_Performance_Before_Code_Update
49 Open Connection And Log In
50 Check BMC CPU Performance
51 Check BMC Mem Performance
52 Check BMC File System Performance
53
Sivas SRR01262bd2017-03-19 10:00:23 -050054Check Core Dump Exist Before Code Update
55 [Documentation] Check core dump existence on BMC before code update.
56 [Tags] Check_Core_Dump_Exist_Before_Code_Update
57 Check For Core Dumps
58
Sivas SRRaca55712016-12-21 04:32:35 -060059Initiate Code Update BMC
George Keishing43a021f2017-01-30 11:10:13 -060060 [Documentation] BMC code update process initiation
61 [Setup] Set State Interface Version
Sivas SRRaca55712016-12-21 04:32:35 -060062 [Tags] Initiate_Code_Update_BMC
George Keishing5e870cd2016-08-24 10:05:47 -050063
George Keishing43a021f2017-01-30 11:10:13 -060064 Check If File Exist ${FILE_PATH}
George Keishing5e870cd2016-08-24 10:05:47 -050065 System Readiness Test
George Keishing50787fc2016-09-21 03:44:26 -050066
George Keishingfb10f492017-03-07 21:34:18 -060067 # TODO: Disabling version check until new logic are in place.
68 # ${status}= Run Keyword and Return Status
69 # ... Validate BMC Version before
70
71 # Run Keyword if '${status}' == '${False}'
72 # ... Pass Execution Same Driver version installed
George Keishing50787fc2016-09-21 03:44:26 -050073
George Keishing5e785822017-04-04 10:15:50 -050074 # Enable user to bypass prerequisite operations.
75 # Use cases for if BMC is not in working state.
76 Run Keyword If ${FORCE_UPDATE} == ${0}
77 ... Prepare BMC For Update
George Keishing2582bee2016-11-17 21:41:49 -060078
George Keishing5e870cd2016-08-24 10:05:47 -050079 Preserve BMC Network Setting
80 SCP Tar Image File to BMC ${FILE_PATH}
81
82 Activate BMC flash image
83
George Keishingb3700812016-08-31 03:03:30 -050084 Run Keyword And Ignore Error Trigger Warm Reset
George Keishingf68c9eb2016-12-01 08:09:58 -060085 # Warm reset adds 3 seconds delay before forcing reboot
86 # To minimize race conditions, we wait for 7 seconds
87 Sleep 7s
George Keishing5e870cd2016-08-24 10:05:47 -050088 ${session_active}= Check If warmReset is Initiated
89 Run Keyword If '${session_active}' == '${True}'
90 ... Trigger Warm Reset via Reboot
91
George Keishingc4d3dc02016-09-19 03:45:55 -050092 Check If BMC is Up 30 min 10 sec
George Keishing80dd5af2017-02-08 07:01:25 -060093 Check Boot Count And Time
George Keishing5e870cd2016-08-24 10:05:47 -050094 Sleep 1 min
George Keishingfb10f492017-03-07 21:34:18 -060095 # Validate BMC Version
George Keishing43a021f2017-01-30 11:10:13 -060096
97 # Now that the code update is completed, make sure we use the correct
98 # interface while checking for BMC ready state.
99 Set State Interface Version
100 Wait For BMC Ready
George Keishing80dd5af2017-02-08 07:01:25 -0600101 Check Boot Count And Time
102 Run Keyword If ${BOOT_COUNT} == ${1}
103 ... Log Boot Time not Updated by Kernel!!! level=WARN
Sivas SRRea85d1f2016-11-13 22:44:28 -0600104
Sivas SRRaca55712016-12-21 04:32:35 -0600105Test Basic BMC Performance At Ready State
106 [Documentation] Check performance of memory, CPU & file system of BMC.
107 [Tags] Test_Basic_BMC_Performance_At_Ready_State
George Keishing128643a2016-12-15 11:36:46 -0600108 Open Connection And Log In
Sivas SRRea85d1f2016-11-13 22:44:28 -0600109 Check BMC CPU Performance
110 Check BMC Mem Performance
Sivas SRRaca55712016-12-21 04:32:35 -0600111 Check BMC File System Performance
112
Sivas SRR01262bd2017-03-19 10:00:23 -0500113Check Core Dump Exist After Code Update
114 [Documentation] Check core dump existence on BMC after code update.
115 [Tags] Check_Core_Dump_Exist_After_Code_Update
116 Check For Core Dumps
117
118Enable Core Dump File Size To Be Unlimited
119 [Documentation] Set core dump file size to unlimited.
120 [Tags] Enable_Core_Dump_File_size_To_Be_unlimited
121 Set Core Dump File Size Unlimited
122
George Keishing80dd5af2017-02-08 07:01:25 -0600123*** Keywords ***
124
George Keishing5e785822017-04-04 10:15:50 -0500125Prepare BMC For Update
126 [Documentation] Prerequisite operation before code update.
127 Check Boot Count And Time
128 Prune Journal Log
129 Power Off Request
130 Set Policy Setting RESTORE_LAST_STATE
131 Prepare For Update
132 Check If BMC is Up 20 min 10 sec
133 Check Boot Count And Time
134
135 # Temporary fix for lab migration for driver which is booted with
136 # BMC state "/xyz/openbmc_project/state/BMC0/".
137 ${status}= Run Keyword And Return Status Temp BMC URI Check
138 Run Keyword If '${status}' == '${False}'
139 ... Wait For BMC Ready
140 ... ELSE Wait For Temp BMC Ready
141
142 # TODO: openbmc/openbmc#815
143 Sleep 1 min
144
145
George Keishing80dd5af2017-02-08 07:01:25 -0600146Check Boot Count And Time
147 [Documentation] Check for unexpected reboots.
148 Set BMC Reset Reference Time
149 Log To Console \n Boot Count: ${BOOT_COUNT}
150 Log To Console \n Boot Time: ${BOOT_TIME}
151 Run Keyword If ${BOOT_COUNT} > ${MAX_BOOT_COUNT}
152 ... Log Phantom Reboot!!! Unexpected reboot detected level=WARN
153
George Keishing3cb1ade2017-03-23 09:03:06 -0500154Temp BMC URI Check
155 [Documentation] Check for transient "BMC0" interface.
156 ${resp}= Openbmc Get Request /xyz/openbmc_project/state/BMC0/
157 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
158
159Check Temp BMC State
160 [Documentation] BMC state should be "Ready".
161 # quiet - Suppress REST output logging to console.
162 ${state}=
163 ... Read Attribute /xyz/openbmc_project/state/BMC0/ CurrentBMCState
164 Should Be Equal Ready ${state.rsplit('.', 1)[1]}
165
166Wait For Temp BMC Ready
167 [Documentation] Check for BMC "Ready" until timedout.
168 Wait Until Keyword Succeeds
169 ... 10 min 10 sec Check Temp BMC State
170