Fix of new code update path
Changes:
- Added support for new code update path
/redfish/v1/UpdateService/update
Tested:
- Ran successfully
oem/nuvoton/test_redfish_mcu_fw_update.robot
redfish/update_service/test_redfish_host_code_update.robot
redfish/update_service/test_redfish_signed_image_update.robot
Change-Id: I01282c2c25ee43990fa9ba905243bbebed5da774
Signed-off-by: Sushil Singh <susilsi7@in.ibm.com>
diff --git a/lib/redfish_code_update_utils.robot b/lib/redfish_code_update_utils.robot
index 8a55005..916540e 100644
--- a/lib/redfish_code_update_utils.robot
+++ b/lib/redfish_code_update_utils.robot
@@ -202,11 +202,26 @@
[Return] ${list_inv}
+Get Redfish Update Service URI
+ [Documentation] Get Redfish firmware update URI.
+
+ ${update_url}= Redfish.Get Attribute ${REDFISH_BASE_URI}UpdateService HttpPushUri
+
+ Log To Console Firmware update URI: ${update_url}
+
+ [Return] ${update_url}
+
+
Redfish Upload Image And Check Progress State
[Documentation] Code update with ApplyTime.
Log To Console Start uploading image to BMC.
- Redfish Upload Image ${REDFISH_BASE_URI}UpdateService ${IMAGE_FILE_PATH}
+
+ # URI : /redfish/v1/UpdateService
+ # "HttpPushUri": "/redfish/v1/UpdateService/update",
+
+ ${redfish_update_uri}= Get Redfish Update Service URI
+ Redfish Upload Image ${redfish_update_uri} ${IMAGE_FILE_PATH}
Log To Console Completed image upload to BMC.
${image_id}= Get Latest Image ID
diff --git a/oem/nuvoton/test_redfish_mcu_fw_update.robot b/oem/nuvoton/test_redfish_mcu_fw_update.robot
index d1dcd3e..47e5429 100644
--- a/oem/nuvoton/test_redfish_mcu_fw_update.robot
+++ b/oem/nuvoton/test_redfish_mcu_fw_update.robot
@@ -93,7 +93,11 @@
Set ApplyTime policy=${apply_time}
- Redfish Upload Image /redfish/v1/UpdateService ${image_file_path}
+ # URI : /redfish/v1/UpdateService
+ # "HttpPushUri": "/redfish/v1/UpdateService/update",
+
+ ${redfish_update_uri}= Get Redfish Update Service URI
+ Redfish Upload Image ${redfish_update_uri} ${image_file_path}
Sleep 30s
${image_version}= Get Version Tar ${image_file_path}
diff --git a/redfish/update_service/test_redfish_host_code_update.robot b/redfish/update_service/test_redfish_host_code_update.robot
index b9e8aed..e4d78c8 100644
--- a/redfish/update_service/test_redfish_host_code_update.robot
+++ b/redfish/update_service/test_redfish_host_code_update.robot
@@ -81,6 +81,10 @@
Redfish.Login
${post_code_update_actions}= Get Post Boot Action
Set ApplyTime policy=${apply_Time}
+
+ # URI : /redfish/v1/UpdateService
+ # "HttpPushUri": "/redfish/v1/UpdateService/update",
+
Redfish Upload Image And Check Progress State
Run Key ${post_code_update_actions['Host image']['${apply_time}']}
Redfish.Login
@@ -92,7 +96,12 @@
[Documentation] Update the firmware via redfish interface and do BMC reboot.
Set ApplyTime policy="Immediate"
- Redfish Upload Image ${REDFISH_BASE_URI}UpdateService ${IMAGE_FILE_PATH}
+
+ # URI : /redfish/v1/UpdateService
+ # "HttpPushUri": "/redfish/v1/UpdateService/update",
+
+ ${redfish_update_uri}= Get Redfish Update Service URI
+ Redfish Upload Image ${redfish_update_uri} ${IMAGE_FILE_PATH}
${image_id}= Get Latest Image ID
Wait Until Keyword Succeeds 1 min 10 sec
... Check Image Update Progress State match_state='Updating' image_id=${image_id}
diff --git a/redfish/update_service/test_redfish_signed_image_update.robot b/redfish/update_service/test_redfish_signed_image_update.robot
index 0da82f2..8241662 100755
--- a/redfish/update_service/test_redfish_signed_image_update.robot
+++ b/redfish/update_service/test_redfish_signed_image_update.robot
@@ -94,7 +94,11 @@
${before_inv_list}= redfish_utils.Get Member List /redfish/v1/UpdateService/FirmwareInventory
Log To Console Current images on the BMC before upload: ${before_inv_list}
- Redfish Upload Image /redfish/v1/UpdateService ${IMAGE_FILE_PATH}
+ # URI : /redfish/v1/UpdateService
+ # "HttpPushUri": "/redfish/v1/UpdateService/update",
+
+ ${redfish_update_uri}= Get Redfish Update Service URI
+ Redfish Upload Image ${redfish_update_uri} ${IMAGE_FILE_PATH}
# Python module: get_member_list(resource_path)
${after_inv_list}= redfish_utils.Get Member List /redfish/v1/UpdateService/FirmwareInventory
@@ -126,7 +130,12 @@
Field Mode Should Be Enabled
Set ApplyTime policy=Immediate
- Redfish Upload Image ${REDFISH_BASE_URI}UpdateService ${image_file_path}
+
+ # URI : /redfish/v1/UpdateService
+ # "HttpPushUri": "/redfish/v1/UpdateService/update",
+
+ ${redfish_update_uri}= Get Redfish Update Service URI
+ Redfish Upload Image ${redfish_update_uri} ${image_file_path}
${image_id}= Get Latest Image ID
Rprint Vars image_id
Sleep 5s