bmc code update with automation/redfish

David Wang (王振宇) DavidWang at quantatw.com
Thu Jun 4 18:18:48 AEST 2020


Hi George,

I’m testing BMC by automation with test_redfish_bmc_code_update.robot.
It failed. However I can successfully update bmc manually so I try to find the reason of failure.

When I upload image by REST:
1. -X POST -T <tar_file> https://${bmc}/upload/image

2. ls -l /tmp/images
   drwx------   	2 root     root           280 Jun  4 06:45 c78e674a

3. -X PUT -d '{"data": "xyz.openbmc_project.Software.Activation.RequestedActivations.Active"}' \
   https://${bmc}/xyz/openbmc_project/software/c78e674a/attr/RequestedActivation
  
4. Then bmc untar the tar file to /run/initramfs/ and remove the tar file
	ls -l /run/initramfs
	-rw-r--r--    1 root     root       4229844 Jun  4 06:46 image-kernel
	-rw-r--r--    1 root     root      23703552 Jun  4 06:46 image-rofs
	-rw-r--r--    1 root     root        850304 Jun  4 06:46 image-rwfs
	-rw-r--r--    1 root     root        433712 Jun  4 06:46 image-u-boot

When I upload image by Redfish (or automation): 
1. -X POST -T <tar_file> https://${bmc}/redfish/v1/UpdateService

2. BMC immediately completes steps 2 to 4 above. So there’s no folder named “c78e674a” in /tmp/images. 
	ls -l /run/initramfs
  -rw-r--r--    1 root     root       4229844 Jun  4 06:53 image-kernel
  -rw-r--r--    1 root     root      23703552 Jun  4 06:53 image-rofs
  -rw-r--r--    1 root     root        850304 Jun  4 06:53 image-rwfs
  -rw-r--r--    1 root     root        433712 Jun  4 06:53 image-u-boot
	
3. Then robot try to “Get Latest Image ID” by command
  cd /tmp/images/; stat -c '%Y %n' * | sort -k1,1nr | head -n 1
  But the folder has been removed, so the robot finds nothing, and then fails.
	
Here’s the question:
It seems that the robot expects the folder "c78e674a" to exist. 
However, when uploading an image through Redfish command, once the tar file is uploaded, bmc untar and remove it.
How can I fix it? Do you have any suggestion?
Please leave any comments, thank you.

Regards,
David



More information about the openbmc mailing list