blob: 7b4dfb176e095d1c457d830cacddf30e90162cba [file] [log] [blame]
Sivas SRR2757d6f2018-04-20 06:36:32 -05001*** Settings ***
2
3Documentation Test Open BMC GUI server configuration firmware update.
4
5Resource ../../lib/resource.robot
Sivas SRRb78a77a2018-06-22 09:01:36 -05006Resource ../../../../lib/logging_utils.robot
Sivas SRR2757d6f2018-04-20 06:36:32 -05007
8Suite Setup Launch Browser And Login OpenBMC GUI
Rahul Maheshwari43333ff2018-11-26 23:18:36 -06009Suite Teardown Close Browser
Sivas SRR2757d6f2018-04-20 06:36:32 -050010Test Setup Test Setup Execution
Sivas SRRb78a77a2018-06-22 09:01:36 -050011Test Teardown Run Keyword If Test Failed Re-Launch GUI on Failure
Sivas SRR2757d6f2018-04-20 06:36:32 -050012
13*** Variables ***
14${xpath_select_server_config} //*[@id="nav__top-level"]/li[4]/button
15${xpath_select_firmware} //a[@href='#/configuration/firmware']
16${xpath_choose_file_button} //*[@id="firmware__upload-form"]/div[1]/label/span[1]
Rahul Maheshwari2f8aaa02018-11-29 00:23:09 -060017${xpath_scroll_down} //a[contains(text(), "Scroll down")]
Sivas SRRb78a77a2018-06-22 09:01:36 -050018${xpath_tftp_server_ip} //*[@id="tftp-ip"]
19${xpath_tftp_filename} //*[@id="tftp-file-name"]
20${xpath_download_firmware} //*[@id="firmware__upload-form"]/div[2]/fieldset/div[1]/div[3]/input
21${xpath_download_progress} //*[@id="firmware__upload-form"]/div[2]/fieldset/div[2]
Sivas SRR2757d6f2018-04-20 06:36:32 -050022
23*** Test Cases ***
24
25Verify Select Firmware From Server Configuration
26 [Documentation] Verify ability to select firmware option from server
27 ... configuration sub-menu.
28 [Tags] Verify_Select_Firmware_From_Server_Configuration
29
30 Wait Until Page Contains Firmware
31 Page Should contain Manage BMC and server firmware
32
Sivas SRRb78a77a2018-06-22 09:01:36 -050033
34Verify Scroll Down Link
35 [Documentation] Verify scroll down link works.
36 [Tags] Verify_Scroll_Down_Link
37
38 Page Should Contain Element ${xpath_scroll_down}
39 Click Element ${xpath_scroll_down}
40 Page Should Contain Element ${xpath_choose_file_button}
41
42
Sivas SRR2757d6f2018-04-20 06:36:32 -050043Verify Choose File Button Click
44 [Documentation] Verify choose file button is clickable.
45 [Tags] Verify_Choose_File_Button_Click
46
47 Page Should Contain No file chosen
48 Page Should Contain Element ${xpath_choose_file_button}
49 Click Element ${xpath_choose_file_button}
50
Sivas SRRb78a77a2018-06-22 09:01:36 -050051Verify BMC Firmware Download
52 # BMC Firmware File Path located at TFTP server.
53 ${BMC_IMAGE_FILE_PATH}
54 [Template] Upload Firmware using TFTP Server
55 [Documentation] Verify BMC image is download from TFTP server.
56 [Tags] Verify_BMC_Firmware_Download
57
58
59Verify Host Firmware Download
60 # Host Firmware File Path located at TFTP server.
61 ${PNOR_IMAGE_FILE_PATH}
62 [Template] Upload Firmware using TFTP Server
63 [Documentation] Verify Host image is download from TFTP server.
64 [Tags] Verify_HOST_Firmware_Download
65
66
Sivas SRR2757d6f2018-04-20 06:36:32 -050067*** Keywords ***
68
69Test Setup Execution
70 [Documentation] Do test case setup tasks.
71
Sivas SRRb78a77a2018-06-22 09:01:36 -050072 Delete All Error Logs
Sivas SRR2757d6f2018-04-20 06:36:32 -050073 Click Element ${xpath_select_server_config}
74 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
75 Click Element ${xpath_select_firmware}
Sivas SRRb78a77a2018-06-22 09:01:36 -050076
77Upload Firmware using TFTP Server
78 [Documentation] Upload firmware using TFTP server.
79 [Arguments] ${firmware_file_name}
80
81 Page Should Contain Button ${xpath_download_firmware}
82 Page Should Contain Element ${xpath_tftp_server_ip}
83 Page Should Contain Element ${xpath_tftp_filename}
84
85 Input Text ${xpath_tftp_server_ip} ${TFTP_SERVER}
86 Input Text ${xpath_tftp_filename} ${firmware_file_name}
87 Click Button ${xpath_download_firmware}
88 Sleep 180s
89 Wait Until Page Does Not Contain Element ${xpath_download_progress}
90
91 # ${message}= Handle Alert timeout=300s
92 # Didn't work so commenting out currently.
93 # Alert not getting captured.
94 # TODO: Issue https://github.com/openbmc/openbmc-test-automation/issues/1412
95
96 Check No Error Log Exist
97
98Check No Error Log Exist
99 [Documentation] No error log should be logged.
100
Steven Sombara8800da2018-12-18 16:19:05 -0600101 ${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}list quiet=${1}
Sivas SRRb78a77a2018-06-22 09:01:36 -0500102 Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
103 ... msg=Codeupdate Failed with error.
104
105Re-Launch GUI on Failure
106 [Documentation] On failure of test case, close and re-launch GUI.
107
108 Logout And Close Browser
109 Launch Browser And Login OpenBMC GUI