blob: 493dc0772b27facc750cc6f12965e399f7765303 [file] [log] [blame]
Rahul Maheshwarib940e192020-07-07 01:52:24 -05001*** Settings ***
2
3Documentation Test OpenBMC GUI "Overview" menu.
4
Rahul Maheshwari41747da2020-11-17 09:09:52 -06005Resource ../../lib/gui_resource.robot
manashsarma2544cb12020-08-23 14:25:08 -05006Resource ../../../lib/logging_utils.robot
manashsarmafb353662020-08-27 05:12:04 -05007Resource ../../../lib/list_utils.robot
manashsarma6d584de2020-08-30 02:33:07 -05008Resource ../../../lib/bmc_network_utils.robot
9
10Library String
Rahul Maheshwarib940e192020-07-07 01:52:24 -050011
rramyasr-in13242572022-11-08 01:44:52 -060012Suite Setup Run Keywords Launch Browser And Login GUI AND Redfish.Login
13Suite Teardown Run Keywords Close Browser AND Redfish.Logout
Rahul Maheshwarib940e192020-07-07 01:52:24 -050014Test Setup Test Setup Execution
15
16
17*** Variables ***
18
manashsarma43568c22020-08-19 12:16:24 -050019${xpath_overview_page_header} //h1[contains(text(), "Overview")]
rramyasr-in22ed4ae2021-12-03 04:50:41 -060020${xpath_edit_network_settings_button} (//*[text()="View more"])[3]
21${view_all_event_logs} (//*[text()="View more"])[5]
rramyasr-inb18e15e2022-08-11 05:22:20 -050022${xpath_launch_host_console} //*[@data-test-id='overviewQuickLinks-button-solConsole']
rramyasr-in00b55452021-12-01 23:47:03 -060023${xpath_led_button} //*[@data-test-id='overviewInventory-checkbox-identifyLed']
rramyasr-in305d23a2022-01-19 01:32:04 -060024${view_all_Dumps} (//*[text()="View more"])[7]
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -050025
Rahul Maheshwarib940e192020-07-07 01:52:24 -050026*** Test Cases ***
27
28Verify Existence Of All Sections In Overview Page
29 [Documentation] Verify existence of all sections in Overview page.
30 [Tags] Verify_Existence_Of_All_Sections_In_Overview_Page
31
rramyasr-in1a79b662022-06-13 00:25:50 -050032 Page Should Contain BMC date and time
Ashwini Chandrappa516f70d2021-12-14 01:21:29 -060033 Page Should Contain Firmware information
Rahul Maheshwarib940e192020-07-07 01:52:24 -050034 Page Should Contain Server information
Ashwini Chandrappa516f70d2021-12-14 01:21:29 -060035 Wait Until Page Contains Network information timeout=10
rramyasr-in532c37f2021-12-03 03:39:14 -060036 Page Should Contain Power information
37 Page Should Contain Event logs
38 Page Should Contain Inventory and LEDs
rramyasr-ine6818d12022-01-13 07:23:40 -060039 Page Should Contain Dumps
Rahul Maheshwarib940e192020-07-07 01:52:24 -050040
rramyasr-in19e553c2022-10-27 02:17:41 -050041
manashsarma6d584de2020-08-30 02:33:07 -050042Verify Network Information In Overview Page
43 [Documentation] Verify values under network information section.
George Keishingf9248952021-05-28 07:52:37 -050044 [Tags] Verify_Network_Information_In_Overview_Page
manashsarma6d584de2020-08-30 02:33:07 -050045
46 ${hostname}= Get BMC Hostname
47 Page Should Contain ${hostname}
48
49 # Get all IP addresses and prefix lengths on system.
50
rramyasr-in690fcd42022-10-27 03:25:39 -050051 ${resp}= Redfish.Get Attribute /redfish/v1/Managers/bmc/EthernetInterfaces/eth0 IPv4StaticAddresses
52 ${ip_addr}= Set Variable ${resp[0]['Address']}
53 Page Should Contain ${ip_addr}
manashsarma6d584de2020-08-30 02:33:07 -050054
manashsarma6d584de2020-08-30 02:33:07 -050055
manashsarmae18f99e2020-08-28 10:12:57 -050056Verify Server Information Section
57 [Documentation] Verify values under server information section in overview page.
58 [Tags] Verify_Server_Information_Section
59
60 ${redfish_machine_model}= Redfish.Get Attribute /redfish/v1/Systems/system/ Model
61 Page Should Contain ${redfish_machine_model}
62
63 ${redfish_serial_number}= Redfish.Get Attribute /redfish/v1/Systems/system/ SerialNumber
64 Page Should Contain ${redfish_serial_number}
65
66 ${redfish_motherboard_manufacturer}= Redfish.Get Attribute
manashsarma58de7d72020-09-07 21:05:21 -050067 ... /redfish/v1/Systems/system/ Manufacturer
manashsarmae18f99e2020-08-28 10:12:57 -050068
69 Page Should Contain ${redfish_motherboard_manufacturer}
70
71
manashsarma554ddec2020-08-26 00:46:02 -050072Verify BMC Information Section
73 [Documentation] Verify BMC information section in overview page.
74 [Tags] Verify_BMC_Information_Section
75
76 ${firmware_version}= Redfish Get BMC Version
77 Page Should Contain ${firmware_version}
78
79
manashsarma43568c22020-08-19 12:16:24 -050080Verify Edit Network Setting Button
81 [Documentation] Verify navigation to network setting page after clicking the button in overview page.
82 [Tags] Verify_Edit_Network_Setting_Button
83
84 Click Element ${xpath_edit_network_settings_button}
85 Wait Until Page Contains Element ${xpath_network_page_header}
86
87
manashsarmafb353662020-08-27 05:12:04 -050088Verify Event Under High Priority Events Section
89 [Documentation] Verify event under high priority events section in case of any event.
90 [Tags] Verify_Event_Under_High_Priority_Events_Section
91
92 Redfish Purge Event Log
93 Click Element ${xpath_refresh_button}
94 Generate Test Error Log
Ashwini Chandrappa243a1f22021-07-26 01:10:04 -050095 Click Element ${xpath_refresh_button}
manashsarmafb353662020-08-27 05:12:04 -050096 Wait Until Page Contains xyz.openbmc_project.Common.Error.InternalFailure timeout=30s
97
98
manashsarma7d0a4122020-08-23 13:41:03 -050099Verify View All Event Logs Button
100 [Documentation] Verify view all event log button in overview page.
101 [Tags] Verify_View_All_Event_Logs_Button
102
103 Generate Test Error Log
104 Page Should Contain Element ${view_all_event_logs} timeout=30
105 Click Element ${view_all_event_logs}
106 Wait Until Page Contains Element ${xpath_event_header} timeout=30
107
108
rramyasr-inb18e15e2022-08-11 05:22:20 -0500109Verify Host Console Button In Overview Page
110 [Documentation] Click host console button and verify page navigation to host console page.
111 [Tags] Verify_Host_Console_Button_In_Overview_Page
manashsarmaa3a25362020-08-23 09:23:28 -0500112
rramyasr-inb18e15e2022-08-11 05:22:20 -0500113 Click Element ${xpath_launch_host_console}
114 Wait Until Page Contains Element ${xpath_host_console_heading}
manashsarmaa3a25362020-08-23 09:23:28 -0500115
116
manashsarmaffb30932020-08-24 07:31:54 -0500117Verify Server LED Turn On
118 [Documentation] Turn on server LED via GUI and verify its status via Redfish.
119 [Tags] Verify_Server_LED_Turn_On
120
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500121 # Turn Off the server LED via Redfish and refresh GUI.
George Keishing52eb7c22022-03-11 10:58:53 -0600122 Set IndicatorLED State Off
123
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500124 Refresh GUI
manashsarmaffb30932020-08-24 07:31:54 -0500125
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500126 # Turn ON the LED via GUI.
manashsarmaffb30932020-08-24 07:31:54 -0500127 Click Element At Coordinates ${xpath_led_button} 0 0
128
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500129 # Cross check that server LED ON state via Redfish.
George Keishing52eb7c22022-03-11 10:58:53 -0600130 Verify Identify LED State Via Redfish Lit
manashsarmaffb30932020-08-24 07:31:54 -0500131
132
133Verify Server LED Turn Off
134 [Documentation] Turn off server LED via GUI and verify its status via Redfish.
135 [Tags] Verify_Server_LED_Turn_Off
136
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500137 # Turn On the server LED via Redfish and refresh GUI.
George Keishing52eb7c22022-03-11 10:58:53 -0600138 Set IndicatorLED State Lit
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500139 Refresh GUI
manashsarmaffb30932020-08-24 07:31:54 -0500140
Ashwini Chandrappa90c6a812021-07-07 04:50:00 -0500141 # Turn OFF the LED via GUI.
manashsarmaffb30932020-08-24 07:31:54 -0500142 Click Element At Coordinates ${xpath_led_button} 0 0
143
144 # Cross check that server LED off state via Redfish.
George Keishing52eb7c22022-03-11 10:58:53 -0600145 Verify Identify LED State Via Redfish Off
manashsarmaffb30932020-08-24 07:31:54 -0500146
147
manashsarma65c9e142020-08-23 07:27:52 -0500148Verify BMC Time In Overview Page
149 [Documentation] Verify that BMC date from GUI matches with BMC time via Redfish.
150 [Tags] Verify_BMC_Time_In_Overview_Page
151
152 ${date_time}= Redfish.Get Attribute ${REDFISH_BASE_URI}Managers/bmc DateTime
153 ${converted_date}= Convert Date ${date_time} result_format=%Y-%m-%d
154
155 Page Should Contain ${converted_date}
156
157
manashsarma43458ff2021-08-17 05:42:47 -0500158Verify BMC Information At Host Power Off State
159 [Documentation] Verify that BMC information is displayed at host power off state.
160 [Tags] Verify_BMC_Information_At_Host_Power_Off_State
161
162 Redfish Power Off stack_mode=skip
163 ${firmware_version}= Redfish Get BMC Version
164 Page Should Contain ${firmware_version}
165
166
rramyasr-in305d23a2022-01-19 01:32:04 -0600167Verify View More Button For Dumps
168 [Documentation] Verify view more button for dumps button in overview page.
169 [Tags] Verify_View_More_Button_For_Dumps
170
171 Wait Until Page Contains Element ${view_all_Dumps} timeout=30
172 Click Element ${view_all_Dumps}
173 Wait Until Page Contains Element ${xpath_dumps_header} timeout=30
174
Rahul Maheshwarib940e192020-07-07 01:52:24 -0500175*** Keywords ***
176
177Test Setup Execution
178 [Documentation] Do test case setup tasks.
179
180 Click Element ${xpath_overview_menu}
181 Wait Until Page Contains Element ${xpath_overview_page_header}
rramyasr-in7776e322022-10-10 11:01:13 -0500182 Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30
George Keishing52eb7c22022-03-11 10:58:53 -0600183
rramyasr-in13242572022-11-08 01:44:52 -0600184
George Keishing52eb7c22022-03-11 10:58:53 -0600185Verify Identify LED State Via Redfish
186 [Documentation] Verify that Redfish identify LED system with given state.
187 [Arguments] ${expected_state}
188 # Description of argument(s):
189 # expected_state Expected value of Identify LED.
190
191 # Python module: get_member_list(resource_path)
192 ${systems}= Redfish_Utils.Get Member List /redfish/v1/Systems
193 FOR ${system} IN @{systems}
194 ${led_value}= Redfish.Get Attribute ${system} IndicatorLED
195 Should Be True '${led_value}' == '${expected_state}'
196 END
197
198
199Set IndicatorLED State
George Keishinge23afb52022-03-17 08:25:49 -0500200 [Documentation] Perform redfish PATCH operation.
George Keishing52eb7c22022-03-11 10:58:53 -0600201 [Arguments] ${led_state} ${expect_resp_code}=[200, 204]
202 # Description of argument(s):
203 # led_state IndicatorLED state to "off", "Lit" etc.
204 # expect_resp_code Expected HTTPS response code. Default [200, 204]
205
206 # Python module: get_member_list(resource_path)
207 ${systems}= Redfish_Utils.Get Member List /redfish/v1/Systems
208 FOR ${system} IN @{systems}
209 Redfish.Patch ${system} body={"IndicatorLED":${led_state}} valid_status_codes=${expect_resp_code}
210 END