blob: e211a312a9e580d4cbc821a4129e9e5f0a1ca390 [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
Sivas SRRaca55712016-12-21 04:32:35 -060089Test 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 Keishing128643a2016-12-15 11:36:46 -060092 Open Connection And Log In
Sivas SRRea85d1f2016-11-13 22:44:28 -060093 Check BMC CPU Performance
94 Check BMC Mem Performance
Sivas SRRaca55712016-12-21 04:32:35 -060095 Check BMC File System Performance
96
Sivas SRR01262bd2017-03-19 10:00:23 -050097Check 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
102Enable 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 Keishing80dd5af2017-02-08 07:01:25 -0600107*** Keywords ***
108
George Keishing5e785822017-04-04 10:15:50 -0500109Prepare 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 Keishing80dd5af2017-02-08 07:01:25 -0600130Check 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 Keishing3cb1ade2017-03-23 09:03:06 -0500138Temp 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
143Check 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
150Wait 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