openbmc-test-automation
openbmc-test-automation copied to clipboard
[Redfish] redfish/update_service/test_redfish_bmc_code_update.robot check task status failed
I use openbmc-test-automation v3.0-stable branch and run the redfish/update_service/test_redfish_bmc_code_update.robot
test case.
robot -v OPENBMC_HOST:x.x.x.x -v IMAGE_FILE_PATH:v2.12.2.all.tar --include Redfish_Code_Update_With_ApplyTime_OnResetredfish/update_service/test_redfish_bmc_code_update.robot
The Keyword 'Verify Task Progress State' failed after retrying for 5 minutes. The last error was: Completed != Running
Does the status of redfish update correct?
https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/update_service.hpp
I had manually used redfish command to update bmc image by image-bmc tarball
$ curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/octet-stream" -X POST -T v2.12.2.all.tar https://${bmc}/redfish/v1/UpdateService
{
"@odata.id": "/redfish/v1/TaskService/Tasks/0",
"@odata.type": "#Task.v1_4_3.Task",
"Id": "0",
"TaskState": "Running",
"TaskStatus": "OK"
}
The image-bmc already untar to /run/initramfs
# ls -l /run/initramfs/
drwxr-xr-x 2 root root 1320 Mar 9 2018 bin
drwxr-xr-x 4 root root 260 Mar 9 2018 etc
-rw-r--r-- 1 root root 33554432 Nov 27 05:37 image-bmc
-rwxr-xr-x 1 root root 9585 Mar 9 2018 init
-rw-r--r-- 1 root root 40 Nov 27 05:25 init-options
-rw-r--r-- 1 root root 0 Nov 27 05:25 init-options-base
drwxr-xr-x 3 root root 340 Mar 9 2018 lib
drwxr-xr-x 18 root root 245 Apr 5 2011 ro
drwxr-xr-x 5 root root 0 Nov 27 05:25 rw
drwxr-xr-x 2 root root 680 Mar 9 2018 sbin
-rwxr-xr-x 1 root root 1917 Mar 9 2018 shutdown
-rwxr-xr-x 1 root root 5180 Mar 9 2018 update
drwxr-xr-x 6 root root 120 Mar 9 2018 usr
drwxr-xr-x 4 root root 80 Mar 9 2018 var
-rw-r--r-- 1 root root 271 Mar 9 2018 whitelist
But the TaskState of task inventory still keeping on Running
$curl -H "X-Auth-Token: $token" -k https://${bmc}/redfish/v1/TaskService/Tasks/
{
"@odata.id": "/redfish/v1/TaskService/Tasks",
"@odata.type": "#TaskCollection.TaskCollection",
"Members": [
{
"@odata.id": "/redfish/v1/TaskService/Tasks/0"
}
],
"[email protected]": 1,
"Name": "Task Collection"
}
$ curl -H "X-Auth-Token: $token" -k https://${bmc}/redfish/v1/TaskService/Tasks/0
{
"@odata.id": "/redfish/v1/TaskService/Tasks/0",
"@odata.type": "#Task.v1_4_3.Task",
"EndTime": "2023-11-27T05:20:05+00:00",
"Id": "0",
"Messages": [
{
"@odata.type": "#Message.v1_0_0.Message",
"Message": "The task with id 0 has started.",
"MessageArgs": [
"0"
],
"MessageId": "TaskEvent.1.0.1.TaskStarted",
"Resolution": "None.",
"Severity": "OK"
},
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The request failed due to an internal service error. The service is still operational.",
"MessageArgs": [],
"MessageId": "Base.1.11.0.InternalError",
"MessageSeverity": "Critical",
"Resolution": "Resubmit the request. If the problem persists, consider resetting the service."
}
],
"Name": "Task 0",
"Payload": {
"HttpHeaders": [
"Host: 100.100.100.64",
"User-Agent: curl/7.68.0",
"Accept: */*",
"Content-Length: 33566720"
],
"HttpOperation": "POST",
"JsonBody": "null",
"TargetUri": "/redfish/v1/UpdateService"
},
"PercentComplete": 0,
"StartTime": "2023-11-27T05:20:03+00:00",
"TaskMonitor": "/redfish/v1/TaskService/Tasks/0/Monitor",
"TaskState": "Running",
"TaskStatus": "OK"
}
@susilsi7 please take a look into this ?
Robot code expecting "TaskState": "Completed" under 5 mins once you upload the image to BMC.
I think you encounter some issue. I see below in your Task 0.
"Messages" -> { "@odata.type": "#Message.v1_1_1.Message", "Message": "The request failed due to an internal service error. The service is still operational.", "MessageArgs": [], "MessageId": "Base.1.11.0.InternalError", "MessageSeverity": "Critical", "Resolution": "Resubmit the request. If the problem persists, consider resetting the service." }