blob: f04d567098d8d236237447bdfbfdd3c3380181ce [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
17*** Variables ***
18
19${QUIET} ${1}
20${IMAGE_FILE_PATH} ${EMPTY}
Charles Paul Hoferc1fa2bc2017-08-18 16:44:03 -050021${ALTERNATE_IMAGE_FILE_PATH} ${EMPTY}
Charles Paul Hoferb7842a52017-09-22 10:11:33 -050022${SKIP_UPDATE_IF_ACTIVE} false
Charles Paul Hofer9f74d3a2017-08-18 09:54:28 -050023
24*** Test Cases ***
25
26REST BMC Code Update
27 [Documentation] Do a BMC code update by uploading image on BMC via REST.
28 [Tags] REST_BMC_Code_Update
George Keishing1eb85f52017-08-30 22:55:13 -050029 [Setup] Code Update Setup
Charles Paul Hofer9f74d3a2017-08-18 09:54:28 -050030
Charles Paul Hofer21845462017-09-27 12:40:33 -050031 Upload And Activate Image ${IMAGE_FILE_PATH}
32 ... skip_if_active=${SKIP_UPDATE_IF_ACTIVE}
Charles Paul Hofer9f74d3a2017-08-18 09:54:28 -050033 OBMC Reboot (off)
Charles Paul Hofere43fb2f2017-09-26 15:36:18 -050034 Verify Running BMC Image ${IMAGE_FILE_PATH}
Charles Paul Hofer9f74d3a2017-08-18 09:54:28 -050035
36
Charles Paul Hoferc1fa2bc2017-08-18 16:44:03 -050037Upload And Activate Multiple BMC Images
38 [Documentation] Upload another BMC image and verify that its state is
39 ... different from all others.
40 [Tags] Upload_And_Activate_Multiple_BMC_Images
41 [Template] Activate Image And Verify No Duplicate Priorities
42 [Setup] Upload And Activate Multiple BMC Images Setup
43
44 # Image File Path Image Purpose
45 ${ALTERNATE_IMAGE_FILE_PATH} ${VERSION_PURPOSE_BMC}
46
47
Charles Paul Hofer42f17462017-09-12 14:09:32 -050048BMC Set Priority To Invalid Values
49 [Documentation] Attempt to set the priority of an image to an invalid
50 ... value and expect an error.
51 [Tags] BMC_Set_Priority_To_Invalid_Values
52 [Template] Set Priority To Invalid Value And Expect Error
53
54 # Version Type Priority
55 ${VERSION_PURPOSE_BMC} ${-1}
56 ${VERSION_PURPOSE_BMC} ${256}
57
58
Charles Paul Hofer9f74d3a2017-08-18 09:54:28 -050059Delete BMC Image
60 [Documentation] Delete a BMC image from the BMC flash chip.
61 [Tags] Delete_BMC_Image
62
63 ${software_object}= Get Non Running BMC Software Object
64 Delete Image And Verify ${software_object} ${VERSION_PURPOSE_BMC}
Charles Paul Hoferc1fa2bc2017-08-18 16:44:03 -050065
66
George Keishing97ecb272017-09-12 04:30:20 -050067BMC Image Priority Attribute Test
68 [Documentation] Set "Priority" attribute.
69 [Tags] BMC_Image_Priority_Attribute_Test
70 [Template] Temporarily Set BMC Attribute
71
72 # Property Value
73 Priority ${0}
74 Priority ${1}
75 Priority ${127}
76 Priority ${255}
77
78
Charles Paul Hoferc1fa2bc2017-08-18 16:44:03 -050079*** Keywords ***
80
George Keishing97ecb272017-09-12 04:30:20 -050081Temporarily Set BMC Attribute
82 [Documentation] Update the BMC attribute value.
83 [Arguments] ${attribute_name} ${attribute_value}
84
85 # Description of argument(s):
86 # attribute_name BMC software attribute name (e.g. "Priority").
87 # attribute_value Value to be written.
88
89 ${image_ids}= Get Software Objects ${VERSION_PURPOSE_BMC}
90 ${init_bmc_properties}= Get Host Software Property ${image_ids[0]}
91 ${initial_priority}= Set Variable ${init_bmc_properties["Priority"]}
92
93 Set Host Software Property ${image_ids[0]} ${attribute_name}
94 ... ${attribute_value}
95
96 ${cur_bmc_properties}= Get Host Software Property ${image_ids[0]}
97 Should Be Equal As Integers ${cur_bmc_properties["Priority"]}
98 ... ${attribute_value}
99
100 # Revert to to initial value.
101 Set Host Software Property
102 ... ${image_ids[0]} ${attribute_name} ${initial_priority}
103
104
Charles Paul Hoferc1fa2bc2017-08-18 16:44:03 -0500105Upload And Activate Multiple BMC Images Setup
106 [Documentation] Check that the ALTERNATE_FILE_PATH variable is set.
107
George Keishing1eb85f52017-08-30 22:55:13 -0500108 Should Not Be Empty ${ALTERNATE_IMAGE_FILE_PATH}
109
110Code Update Setup
111 [Documentation] Do code update test case setup.
112 # - Clean up all existing BMC dumps.
113
114 Delete All Dumps
George Keishing00715492017-08-18 11:46:37 -0500115
116Code Update Test Teardown
117 [Documentation] Do code update test case teardown.
118 # 1. Collect FFDC if test case failed.
119 # 2. Collect FFDC if test PASS but error log exists.
120
121 FFDC On Test Case Fail
122 Run Keyword If '${TEST_STATUS}' == 'PASS' Check Error And Collect FFDC