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