xref: /openbmc/openbmc-test-automation/gui/test/server_config/test_obmc_gui_firmware_update.robot (revision b2a2d948d555cb6e5169b9f21d489a3b089b4387)
1*** Settings ***
2
3Documentation  Test Open BMC GUI server configuration firmware update.
4
5Resource        ../../lib/resource.robot
6Resource        ../../../lib/logging_utils.robot
7
8Suite Setup     Launch Browser And Login OpenBMC GUI
9Suite Teardown  Close Browser
10Test Setup      Test Setup Execution
11Test Teardown   Re-Launch GUI on Failure
12
13Test Tags       OBMC_GUI_Firmware_Update
14
15*** Variables ***
16${xpath_select_server_config}   //*[@id="nav__top-level"]/li[4]/button
17${xpath_select_firmware}        //a[@href='#/configuration/firmware']
18${xpath_choose_file_button}     //*[@id="firmware__upload-form"]/div[1]/label/span[1]
19${xpath_scroll_down}            //a[contains(text(), "Scroll down")]
20${xpath_tftp_server_ip}         //*[@id="tftp-ip"]
21${xpath_tftp_filename}          //*[@id="tftp-file-name"]
22${xpath_download_firmware}      //*[@id="firmware__upload-form"]/div[2]/fieldset/div[1]/div[3]/input
23${xpath_download_progress}      //*[@id="firmware__upload-form"]/div[2]/fieldset/div[2]
24
25*** Test Cases ***
26
27Verify Select Firmware From Server Configuration
28    [Documentation]  Verify ability to select firmware option from server
29    ...  configuration sub-menu.
30    [Tags]  Verify_Select_Firmware_From_Server_Configuration
31
32    Wait Until Page Contains  Firmware
33    Page Should contain  Manage BMC and server firmware
34
35
36Verify Scroll Down Link
37    [Documentation]  Verify scroll down link works.
38    [Tags]  Verify_Scroll_Down_Link
39
40    Page Should Contain Element  ${xpath_scroll_down}
41    Click Element  ${xpath_scroll_down}
42    Page Should Contain Element  ${xpath_choose_file_button}
43
44
45Verify Choose File Button Click
46    [Documentation]  Verify choose file button is clickable.
47    [Tags]  Verify_Choose_File_Button_Click
48
49    Page Should Contain  No file chosen
50    Page Should Contain Element  ${xpath_choose_file_button}
51    Click Element  ${xpath_choose_file_button}
52
53Verify BMC Firmware Download
54    # BMC Firmware File Path located at TFTP server.
55    ${BMC_IMAGE_FILE_PATH}
56    [Template]  Upload Firmware using TFTP Server
57    [Documentation]  Verify BMC image is download from TFTP server.
58    [Tags]  Verify_BMC_Firmware_Download
59
60
61Verify Host Firmware Download
62    # Host Firmware File Path located at TFTP server.
63    ${PNOR_IMAGE_FILE_PATH}
64    [Template]  Upload Firmware using TFTP Server
65    [Documentation]  Verify Host image is download from TFTP server.
66    [Tags]  Verify_Host_Firmware_Download
67
68
69*** Keywords ***
70
71Test Setup Execution
72   [Documentation]  Do test case setup tasks.
73
74    Delete All Error Logs
75    Click Element  ${xpath_select_server_config}
76    Wait Until Page Does Not Contain Element  ${xpath_refresh_circle}
77    Click Element  ${xpath_select_firmware}
78
79Upload Firmware using TFTP Server
80    [Documentation]  Upload firmware using TFTP server.
81    [Arguments]  ${firmware_file_name}
82
83    Page Should Contain Button  ${xpath_download_firmware}
84    Page Should Contain Element  ${xpath_tftp_server_ip}
85    Page Should Contain Element  ${xpath_tftp_filename}
86
87    Input Text  ${xpath_tftp_server_ip}  ${TFTP_SERVER}
88    Input Text  ${xpath_tftp_filename}  ${firmware_file_name}
89    Click Button  ${xpath_download_firmware}
90    Wait Until Element Is Visible  ${xpath_download_progress}  timeout=180
91    Wait Until Element Is Not Visible  ${xpath_download_progress}  timeout=180
92
93    Check No Error Log Exist
94
95Check No Error Log Exist
96    [Documentation]  No error log should be logged.
97
98    ${resp}=  OpenBMC Get Request  ${BMC_LOGGING_ENTRY}list  quiet=${1}
99    Should Be Equal As Strings  ${resp.status_code}  ${HTTP_NOT_FOUND}
100    ...  msg=Codeupdate Failed with error.
101
102Re-Launch GUI on Failure
103    [Documentation]  On failure of test case, close and re-launch GUI.
104
105    Return From Keyword If  '${TEST_STATUS}' != 'FAIL'
106
107    Logout And Close Browser
108    Launch Browser And Login OpenBMC GUI
109