blob: 83fa77a3f1f7e2225e15e587fa9487c8472cb52b [file] [log] [blame]
George Keishingbcb32882017-10-28 11:09:47 -05001*** Settings ***
2Documentation BMC OEM serial update utilities keywords.
3
4Resource code_update_utils.robot
Steven Sombar217402f2019-02-19 13:16:25 -06005Resource serial_connection/serial_console_client.robot
George Keishingbcb32882017-10-28 11:09:47 -05006
7*** Keywords ***
8
9Reset 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
31Reset Network Interface
32 [Documentation] Turn the ethernet network interface off and then on again
33 ... through the serial console.
34
Steven Sombar217402f2019-02-19 13:16:25 -060035 Import Resource ${CURDIR}/serial_connection/serial_console_client.robot
George Keishingbcb32882017-10-28 11:09:47 -050036 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