blob: 0e290a24396194b9b67f7a4dc4eac2b51b7fea0c [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
Michael Walsh5ce98052017-04-12 16:40:31 -050026Library ../../lib/gen_robot_keyword.py
27Library String
Sweta Potthuri3a8ae262017-03-10 00:02:09 -060028
Michael Walsh5ce98052017-04-12 16:40:31 -050029Resource code_update_utils.robot
30Resource ../../lib/boot/boot_resource_master.robot
31Resource ../../lib/state_manager.robot
32Resource ../../lib/utils.robot
33Resource ../../lib/openbmc_ffdc.robot
34Resource ../../extended/obmc_boot_test_resource.robot
35
36Test Teardown Run Key FFDC On Test Case Fail
George Keishing5e870cd2016-08-24 10:05:47 -050037
38*** Variables ***
39
Michael Walsh5ce98052017-04-12 16:40:31 -050040${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 Keishing80dd5af2017-02-08 07:01:25 -060046
47# There are two reboots issued by code update.
Michael Walsh5ce98052017-04-12 16:40:31 -050048${MAX_BOOT_COUNT} ${2}
George Keishing5e870cd2016-08-24 10:05:47 -050049
Gunnar Mills7c8923f2016-12-12 21:19:52 -060050*** Test Cases ***
George Keishing5e870cd2016-08-24 10:05:47 -050051
Sivas SRRaca55712016-12-21 04:32:35 -060052Test 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 SRR01262bd2017-03-19 10:00:23 -050060Check 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 SRRaca55712016-12-21 04:32:35 -060065Initiate Code Update BMC
Michael Walsh5ce98052017-04-12 16:40:31 -050066 [Documentation] Initiate a code update on the BMC.
Sivas SRRaca55712016-12-21 04:32:35 -060067 [Tags] Initiate_Code_Update_BMC
George Keishing5e870cd2016-08-24 10:05:47 -050068
George Keishingfb10f492017-03-07 21:34:18 -060069 # 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 Keishing50787fc2016-09-21 03:44:26 -050075
George Keishing5e785822017-04-04 10:15:50 -050076 # 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 Keishing2582bee2016-11-17 21:41:49 -060080
Michael Walsh5ce98052017-04-12 16:40:31 -050081 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 Keishing80dd5af2017-02-08 07:01:25 -060086 Run Keyword If ${BOOT_COUNT} == ${1}
Michael Walsh5ce98052017-04-12 16:40:31 -050087 ... Log Boot time not updated by kernel. level=WARN
Sivas SRRea85d1f2016-11-13 22:44:28 -060088
George Keishinga126e212017-03-24 08:07:17 -050089
90Install 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 SRRaca55712016-12-21 04:32:35 -060097Test 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 Keishing128643a2016-12-15 11:36:46 -0600100 Open Connection And Log In
Sivas SRRea85d1f2016-11-13 22:44:28 -0600101 Check BMC CPU Performance
102 Check BMC Mem Performance
Sivas SRRaca55712016-12-21 04:32:35 -0600103 Check BMC File System Performance
104
Sivas SRR01262bd2017-03-19 10:00:23 -0500105Check 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
110Enable 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 Keishing80dd5af2017-02-08 07:01:25 -0600115*** Keywords ***
116
George Keishing5e785822017-04-04 10:15:50 -0500117Prepare 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 Keishing80dd5af2017-02-08 07:01:25 -0600138Check 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 Keishing3cb1ade2017-03-23 09:03:06 -0500146Temp 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
151Check 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
158Wait 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