blob: 40ed966aa7b729ef47e4892b1e2139208f342a10 [file] [log] [blame]
Charles Paul Hofer9f74d3a2017-08-18 09:54:28 -05001*** Settings ***
2Documentation Update the BMC code on a target BMC.
3... Execution Method:
4... python -m robot -v OPENBMC_HOST:<hostname>
5... -v IMAGE_FILE_PATH:<path/*.tar> bmc_code_update.robot
6
7Library ../../lib/code_update_utils.py
8Variables ../../data/variables.py
9Resource ../../lib/boot_utils.robot
10Resource code_update_utils.robot
11Resource ../../lib/code_update_utils.robot
George Keishing1eb85f52017-08-30 22:55:13 -050012Resource ../../lib/openbmc_ffdc.robot
13Resource ../../lib/dump_utils.robot
Charles Paul Hofer9f74d3a2017-08-18 09:54:28 -050014
George Keishing00715492017-08-18 11:46:37 -050015Test Teardown Code Update Test Teardown
Charles Paul Hofer9f74d3a2017-08-18 09:54:28 -050016
George Keishing09712a12017-10-16 12:52:42 -050017Force Tags BMC_Code_Update
18
Charles Paul Hofer9f74d3a2017-08-18 09:54:28 -050019*** Variables ***
20
21${QUIET} ${1}
22${IMAGE_FILE_PATH} ${EMPTY}
Charles Paul Hoferc1fa2bc2017-08-18 16:44:03 -050023${ALTERNATE_IMAGE_FILE_PATH} ${EMPTY}
Charles Paul Hoferb7842a52017-09-22 10:11:33 -050024${SKIP_UPDATE_IF_ACTIVE} false
Charles Paul Hofer9f74d3a2017-08-18 09:54:28 -050025
26*** Test Cases ***
27
28REST BMC Code Update
29 [Documentation] Do a BMC code update by uploading image on BMC via REST.
30 [Tags] REST_BMC_Code_Update
George Keishing1eb85f52017-08-30 22:55:13 -050031 [Setup] Code Update Setup
Charles Paul Hofer9f74d3a2017-08-18 09:54:28 -050032
Charles Paul Hofer21845462017-09-27 12:40:33 -050033 Upload And Activate Image ${IMAGE_FILE_PATH}
34 ... skip_if_active=${SKIP_UPDATE_IF_ACTIVE}
Charles Paul Hofer9f74d3a2017-08-18 09:54:28 -050035 OBMC Reboot (off)
Charles Paul Hofere43fb2f2017-09-26 15:36:18 -050036 Verify Running BMC Image ${IMAGE_FILE_PATH}
Charles Paul Hofer9f74d3a2017-08-18 09:54:28 -050037
38
Charles Paul Hoferc1fa2bc2017-08-18 16:44:03 -050039Upload And Activate Multiple BMC Images
40 [Documentation] Upload another BMC image and verify that its state is
41 ... different from all others.
42 [Tags] Upload_And_Activate_Multiple_BMC_Images
43 [Template] Activate Image And Verify No Duplicate Priorities
44 [Setup] Upload And Activate Multiple BMC Images Setup
45
46 # Image File Path Image Purpose
47 ${ALTERNATE_IMAGE_FILE_PATH} ${VERSION_PURPOSE_BMC}
48
49
Charles Paul Hofer42f17462017-09-12 14:09:32 -050050BMC Set Priority To Invalid Values
51 [Documentation] Attempt to set the priority of an image to an invalid
52 ... value and expect an error.
53 [Tags] BMC_Set_Priority_To_Invalid_Values
54 [Template] Set Priority To Invalid Value And Expect Error
55
56 # Version Type Priority
57 ${VERSION_PURPOSE_BMC} ${-1}
58 ${VERSION_PURPOSE_BMC} ${256}
59
60
Charles Paul Hofer9f74d3a2017-08-18 09:54:28 -050061Delete BMC Image
62 [Documentation] Delete a BMC image from the BMC flash chip.
63 [Tags] Delete_BMC_Image
64
65 ${software_object}= Get Non Running BMC Software Object
66 Delete Image And Verify ${software_object} ${VERSION_PURPOSE_BMC}
Charles Paul Hoferc1fa2bc2017-08-18 16:44:03 -050067
68
George Keishing97ecb272017-09-12 04:30:20 -050069BMC Image Priority Attribute Test
70 [Documentation] Set "Priority" attribute.
71 [Tags] BMC_Image_Priority_Attribute_Test
72 [Template] Temporarily Set BMC Attribute
73
74 # Property Value
75 Priority ${0}
76 Priority ${1}
77 Priority ${127}
78 Priority ${255}
79
80
Charles Paul Hoferc1fa2bc2017-08-18 16:44:03 -050081*** Keywords ***
82
George Keishing97ecb272017-09-12 04:30:20 -050083Temporarily Set BMC Attribute
84 [Documentation] Update the BMC attribute value.
85 [Arguments] ${attribute_name} ${attribute_value}
86
87 # Description of argument(s):
88 # attribute_name BMC software attribute name (e.g. "Priority").
89 # attribute_value Value to be written.
90
91 ${image_ids}= Get Software Objects ${VERSION_PURPOSE_BMC}
92 ${init_bmc_properties}= Get Host Software Property ${image_ids[0]}
93 ${initial_priority}= Set Variable ${init_bmc_properties["Priority"]}
94
95 Set Host Software Property ${image_ids[0]} ${attribute_name}
96 ... ${attribute_value}
97
98 ${cur_bmc_properties}= Get Host Software Property ${image_ids[0]}
99 Should Be Equal As Integers ${cur_bmc_properties["Priority"]}
100 ... ${attribute_value}
101
102 # Revert to to initial value.
103 Set Host Software Property
104 ... ${image_ids[0]} ${attribute_name} ${initial_priority}
105
106
Charles Paul Hoferc1fa2bc2017-08-18 16:44:03 -0500107Upload And Activate Multiple BMC Images Setup
108 [Documentation] Check that the ALTERNATE_FILE_PATH variable is set.
109
George Keishing1eb85f52017-08-30 22:55:13 -0500110 Should Not Be Empty ${ALTERNATE_IMAGE_FILE_PATH}
111
112Code Update Setup
113 [Documentation] Do code update test case setup.
114 # - Clean up all existing BMC dumps.
115
116 Delete All Dumps
Charles Paul Hoferb9264082017-09-29 15:00:19 -0500117 Run Keyword And Ignore Error Smart Power Off
George Keishing00715492017-08-18 11:46:37 -0500118
119Code Update Test Teardown
120 [Documentation] Do code update test case teardown.
121 # 1. Collect FFDC if test case failed.
122 # 2. Collect FFDC if test PASS but error log exists.
123
124 FFDC On Test Case Fail
125 Run Keyword If '${TEST_STATUS}' == 'PASS' Check Error And Collect FFDC