George Keishing | bcb3288 | 2017-10-28 11:09:47 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation BMC OEM serial update utilities keywords. |
| 3 | |
| 4 | Resource code_update_utils.robot |
Steven Sombar | 217402f | 2019-02-19 13:16:25 -0600 | [diff] [blame] | 5 | Resource serial_connection/serial_console_client.robot |
George Keishing | bcb3288 | 2017-10-28 11:09:47 -0500 | [diff] [blame] | 6 | |
| 7 | *** Keywords *** |
| 8 | |
| 9 | Reset Network Interface During Code Update |
| 10 | [Documentation] Disable and re-enable the network while doing code update. |
| 11 | [Arguments] ${image_file_path} ${reboot} |
| 12 | |
| 13 | # Resetting the network will be done via the serial console. |
| 14 | # |
| 15 | # Description of argument(s): |
| 16 | # image_file_path Path to the image file to update to. |
| 17 | # reboot If set to true, will reboot the BMC after the code |
| 18 | # update is finished. |
| 19 | |
| 20 | ${version_id}= Upload And Activate Image ${image_file_path} wait=${0} |
| 21 | Reset Network Interface |
| 22 | |
| 23 | # Verify code update was successful and 'Activation' state is 'Active'. |
| 24 | Wait For Activation State Change ${version_id} ${ACTIVATING} |
| 25 | ${software_state}= Read Properties ${SOFTWARE_VERSION_URI}${version_id} |
| 26 | Should Be Equal As Strings &{software_state}[Activation] ${ACTIVE} |
| 27 | |
| 28 | Run Keyword If '${reboot}' OBMC Reboot (off) stack_mode=normal |
| 29 | |
| 30 | |
| 31 | Reset Network Interface |
| 32 | [Documentation] Turn the ethernet network interface off and then on again |
| 33 | ... through the serial console. |
| 34 | |
Steven Sombar | 217402f | 2019-02-19 13:16:25 -0600 | [diff] [blame] | 35 | Import Resource ${CURDIR}/serial_connection/serial_console_client.robot |
George Keishing | bcb3288 | 2017-10-28 11:09:47 -0500 | [diff] [blame] | 36 | Set Library Search Order SSHLibrary Telnet |
| 37 | Execute Command On Serial Console ifconfig eth0 down |
| 38 | Sleep 30s |
| 39 | Execute Command On Serial Console ifconfig eth0 up |