1*** Settings *** 2Documentation Firmware image (BMC and Host) upload test using TFTP protocol. 3 4# Test Parameters: 5# TFTP_SERVER The TFTP server host name or IP address. 6# IMAGE_FILE_NAME The BMC or Host image file name. 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/boot_utils.robot 15Resource ../../lib/bmc_redfish_resource.robot 16Resource ../../lib/openbmc_ffdc.robot 17Resource ../../lib/code_update_utils.robot 18Library ../../lib/code_update_utils.py 19Library ../../lib/gen_robot_valid.py 20 21Suite Setup Suite Setup Execution 22Suite Teardown Redfish.Logout 23Test Setup Printn 24Test Teardown FFDC On Test Case Fail 25 26Force Tags tftp_update 27 28*** Test Cases *** 29 30TFTP Download Install With ApplyTime OnReset Policy 31 [Documentation] Download image to BMC using TFTP with OnReset policy and verify installation. 32 [Tags] TFTP_Download_Install_With_ApplyTime_OnReset_Policy 33 34 # Set and verify the firmware OnReset policy. 35 Redfish.Patch ${REDFISH_BASE_URI}UpdateService body={'ApplyTime' : 'OnReset'} 36 ${apply_time}= Read Attribute ${SOFTWARE_VERSION_URI}apply_time RequestedApplyTime 37 Rvalid Value apply_time valid_values=['xyz.openbmc_project.Software.ApplyTime.RequestedApplyTimes.OnReset'] 38 Rprint Vars apply_time 39 40 # Download image from TFTP server to BMC. 41 Redfish.Post /redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate 42 ... body={"TransferProtocol" : "TFTP", "ImageURI" : "${TFTP_SERVER}/${IMAGE_FILE_NAME}"} 43 44 # Wait for image tar file to download complete. 45 ${image_id}= Wait Until Keyword Succeeds 60 sec 10 sec Get Latest Image ID 46 Rprint Vars image_id 47 48 # Let the image get extracted and it should not fail. 49 Sleep 5s 50 Check Image Update Progress State match_state='Disabled', 'Updating' image_id=${image_id} 51 52 # Get image version currently installation in progress. 53 ${install_version}= Get Firmware Image Version image_id=${image_id} 54 Rprint Vars install_version 55 56 Check Image Update Progress State match_state='Updating' image_id=${image_id} 57 58 # Wait for the image to install complete. 59 Wait Until Keyword Succeeds 5 min 15 sec 60 ... Check Image Update Progress State match_state='Enabled' image_id=${image_id} 61 62 Redfish OBMC Reboot (off) 63 64 # Verify the image is installed and functional. 65 ${cmd}= Set Variable grep ^VERSION_ID= /etc/os-release | cut -f 2 -d '=' | sed 's/"//g' 66 ${functional_version} ${stderr} ${rc}= BMC Execute Command ${cmd} 67 Rvalid Value functional_version valid_values=['${install_version}'] 68 Rprint Vars functional_version 69 70 71*** Keywords *** 72 73Suite Setup Execution 74 [Documentation] Do the suite setup. 75 76 Redfish.Login 77 Rvalid Value TFTP_SERVER 78 Rvalid Value IMAGE_FILE_NAME 79