blob: fb2bc4ef22494520d2e1ef4ce56b8dc99783915b [file] [log] [blame]
Sushil Singhc08932e2019-09-10 15:23:10 -05001*** Settings ***
2Documentation Redfish BMC/Host signed and unsigned code update
3... over BMC functional signed image.
4
5# Test Parameters:
6# IMAGE_FILE_PATH The path to the BMC/Host image file.
7#
8# Firmware update states:
9# Enabled Image is installed and either functional or active.
10# Disabled Image installation failed or ready for activation.
11# Updating Image installation currently in progress.
12
13Resource ../../lib/resource.robot
14Resource ../../lib/bmc_redfish_resource.robot
15Resource ../../lib/openbmc_ffdc.robot
16Resource ../../lib/common_utils.robot
17Resource ../../lib/code_update_utils.robot
18Resource ../../lib/redfish_code_update_utils.robot
19Resource ../../extended/code_update/update_bmc.robot
20Library ../../lib/gen_robot_valid.py
21Library ../../lib/var_funcs.py
22
23Suite Setup Suite Setup Execution
24Suite Teardown Redfish.Logout
25Test Setup Printn
26Test Teardown FFDC On Test Case Fail
27
28*** Test Cases ***
29
30Redfish Signed Code Update
31 [Documentation] BMC/Host signed code update over functional signed
32 ... image, when FieldMode is set to true value.
33 [Tags] Redfish_Signed_Code_Update
34 [Template] Redfish Signed Firmware Update
35
36 # image_file_path
37 ${IMAGE_FILE_PATH}
38
39
40Redfish Fail Unsigned Code Update
41 [Documentation] BMC/Host unsigned code update over functional signed
42 ... image, when Field Mode is set to true to value.
43 [Tags] Redfish_Fail_Unsigned_Code_Update
44 [Template] Redfish Unsigned Firmware Update
45
46 # image_file_path
47 ${IMAGE_FILE_PATH}
48
49
Sushil Singh2a520ee2019-09-16 14:19:17 -050050REST Failure When Field Mode Set To Disable
51 [Documentation] Verify error while disabling field mode from enabled mode.
52 [Tags] REST_Failure_When_Field_Mode_Set_To_Disable
53
54 ${args}= Create Dictionary data=${0}
55 ${resp}= OpenBMC Post Request ${SOFTWARE_VERSION_URI}attr/FieldModeEnabled data=${args}
56 Should Be Equal As Strings ${resp.status_code} ${HTTP_METHOD_NOT_ALLOWED}
57
58
Sushil Singhc08932e2019-09-10 15:23:10 -050059*** Keywords ***
60
61Suite Setup Execution
62 [Documentation] Do the suite setup.
63
64 Valid File Path IMAGE_FILE_PATH
65 Redfish.Login
66 Delete All BMC Dump
67 Redfish Purge Event Log
68
69
70Redfish Signed Firmware Update
71 [Documentation] Update the BMC/Host firmware via redfish interface.
72 [Arguments] ${image_file_path}
73
74 # Description of argument(s):
75 # IMAGE_FILE_PATH The path to the image file.
76
77 Field Mode Should Be Enabled
78 ${image_version}= Get Version Tar ${image_file_path}
79 ${state}= Get Pre Reboot State
80 Rprint Vars state
81 Redfish Upload Image And Check Progress State Immediate
82 ${image_info}= Get Software Inventory State By Version ${image_version}
83 Run Keyword If 'BMC update' == '${image_info["image_type"]}'
84 ... Reboot BMC And Verify BMC Image Immediate start_boot_seconds=${state['epoch_seconds']}
85 ... ELSE
86 ... Poweron Host And Verify Host Image
87
88
89Redfish Unsigned Firmware Update
90 [Documentation] Update the BMC/Host firmware via redfish interface.
91 [Arguments] ${image_file_path}
92
93 # Description of argument(s):
94 # IMAGE_FILE_PATH The path to the image file.
95
96 Field Mode Should Be Enabled
97 Set ApplyTime policy=Immediate
98 Redfish Upload Image ${REDFISH_BASE_URI}UpdateService ${image_file_path}
99 ${image_id}= Get Latest Image ID
100 Rprint Vars image_id
101 Sleep 5s
102 Wait Until Keyword Succeeds 8 min 20 sec
103 ... Check Image Update Progress State
104 ... match_state='Disabled', 'Updating', 'Disabled' image_id=${image_id}
105 Delete Software Object
106 ... /xyz/openbmc_project/software/${image_id}
107